Ok, so I´m working on my latest project Wusik 4000, which uses modules for Envelopes, OSCs, effects, and such. The thing is, lets say I have multiple modules, each module has its own buffer to use for the next module, and if we have a polyvoice module, its buffer * voices. (which can be 1 to 128 voices) So, its a heck load of buffers we have. BlockSize could change from one call to another, so what I will do is just check if the current size is larger and resize blocks, but not when its less, otherwise it would eat too much CPU when we have to resize, lets say, 20, 40 or even 80 modules. :shock: If anyone has a better idea, I´m open to suggestions, of course, and please, do suggest.
Another thing is how I will handle variables that I want to share. How can I give a module (which is a Juce VST plugin file) a pointer to a variable? So far I´m using setStateInformation to send a class that has some info on it that I want to be shared, so I don´t have to use “expensive” getpar/setpar calls. Now, I´m pretty sure this is an idiotic way, but to be honest, I don´t know how else I could handle that, so, please, don´t make fun, I´m very exhausted and may be missing something simple to use instead. :oops: Since modules will be open-source, I want my code to look elegant. :mrgreen: So, please, any ideas on how I could handle this instead?
For voices I will just use a simple method, the AMP Envelopes will determinate voice allocation, as they will be the MASTER on the whole thing. So an AMP Envelope will get the basic notes, and output notes but put like this. Note.delta * (voicenumberoriginalbuffer) so the output buffer will be originalbuffervoices. Its silly, but it was the best I could do by using the JUCE VST plugin format. Now, this is passed to another module that knows that the input buffer has the AMP envelope information like this, and notes are set like this.
But another problem arises, polyvoice modulations. Mono modulations I could just use setParameter, but its still “expensive” to use that. So I was hoping on using a more direct way, by sending a pointer to each module to some internal variables instead. Still, each modulation needs its own buffer data. Oh well…
Anyway, just brainstorming out loud in the hopes someone will give me some hints… (pretty please?)
Best Regards, WilliamK