This is sort of why I was talking above about how it would be so much more convenient if the plugin could tell the host how many voices there are and the host would just allocate notes to those voices directly and none of this modulation stuff was related to notes, but rather directly to voices.S0lo wrote: Fri Jul 15, 2022 4:49 pmThing is, with a modular synth, all voices are always ON and free running. It's the VCAs that close the sound. Plus, figuring out when a sound actually ends can be very hard to impossible with complex patches and feedback loops, it might never end.mystran wrote: Fri Jul 15, 2022 3:44 pmI'd imagine you zero global modulation on reset() and per-voice modulation when you start a new voice (or end the previous in case there's a distinction).S0lo wrote: Fri Jul 15, 2022 3:11 pm So this also entails that after the modulation is done. Either the host or the plug-in should set the mod amount to zero, otherwise the final value is destructive. Who is responsible of that?
I could end the mod when a new note comes in though, but haven't thought of the implication yet.
Interestingly, I was just thinking about another related issue: if one is multi-threading voices, then it'd be much more efficient to just dispatch the whole block once and then do whatever buffer splitting needs to be done locally in each voice. Even if in practice they all split at the same points, that's a lot less task dispatch overhead and you could just hand over the whole event list to all the voices directly and let each of them skip over the stuff they don't care about and then potentially split in the voices themselves...
...except this doesn't quite work, because we still need to go through the events globally first in order to find the note-on messages and allocate voices.. and then you have the same voice potentially processing different notes for different parts of the buffer, so if you want them to split the buffer internally, you probably have to build a separate event list for each voice?
