v1.2.0
v1.2.0 - twice the polyphony
- new feature: more polyphony - 2x as many voices (30 now versus 14 before)
- bug fix: buffer's weren't deallocating when getting used, causing memory overages and freezes (possible what happened to you @rcf and @ninoshiro)
I've did more thorough testing of the extremes (i.e. in the case of plonky using possibly 8 instruments with polyphony on each). based on tests I've found that a decent hard limit is up to 30 voices + 80 buffers. if I try using all the buffers and all the voices (i.e. playing a fast sequence on plonky and then dialing through all the instruments) I can see that I top out at ~800 MB of RAM. before this change there were 200 buffers would was a definite no-go and probably caused lots of freezes for people, sorry about that. now, with 80 buffers and buffer stealing in place, you should stay within the RAM (~1000 MB on shield/stock norns) in the most extreme cases.
I also added an api to limit the number of voices, so if you want to use this as a library you can cut down on CPU/RAM by doing:
mxsamples=include("mx.samples/lib/mx.samples")
mx=mxsamples:new()
mx:max_voices(4) -- limits to only 4 voices
that being said, there are some samples that are more expensive than others (i.e. longer samples), so if you have the right combination of samples all playing at the same time with lots of polyphony you might get a freeze. if you do, let me know and I can problem solve some more, maybe reduce a little further.