Doesn't seem that people have asked this before, but is there a way to not play a sample on boot?
I'm trying to use Mozzi to play sound effects on a diorama, for this I need to start samples based on events/timers, etc.
Sample.start works well for this as it resets sample position to 0 (and it will effectively start playing from the beginning), but also all the samples start playing right at the start of the sketch!
If there isn't a way to do this, this is a feature request to add a "Sample.stop" method. After calling it, Sample.next() should return 0. Quick look at the source shows that it should be possible to implement it by moving sample position to the end of the sample, this will also support proper functioning of isPlaying function, etc. If the implementation is that simple, I can provide a PR.
Doesn't seem that people have asked this before, but is there a way to not play a sample on boot?
I'm trying to use Mozzi to play sound effects on a diorama, for this I need to start samples based on events/timers, etc.
Sample.startworks well for this as it resets sample position to 0 (and it will effectively start playing from the beginning), but also all the samples start playing right at the start of the sketch!If there isn't a way to do this, this is a feature request to add a "Sample.stop" method. After calling it,
Sample.next()should return 0. Quick look at the source shows that it should be possible to implement it by moving sample position to the end of the sample, this will also support proper functioning of isPlaying function, etc. If the implementation is that simple, I can provide a PR.