Gen~ codebox vs RNBO codebox~ performance wise
Hello fellow Max users,
I'm a new RNBO owner , and I feel like it's time for me to try to build my first VST plugin. I consider myself a rather experienced Max users, although in the past I almost always happened to create projects either for personal use or on demand bespoken patches for individual artists. Therefore, performance optimisation has never been my biggest concern (as long as the patch was running decently either on my computer or on my client's one, that is!). This time though, as I plan to release the vst instrument to a wider audience, I look to strive for a good overall performance.
The planned instrument will be a rather complex sample player / waveform synth with plethora of controls. I plan to use codebox as much as possible as I feel more comfortable with scripting rather than visual programming when it comes to big projects. One of the key features is going to be morphing between samples uploaded by the user by phase aligning and volume mixing them. This, plus other features, mean that some of the processes will have to happen at sample rate (codebox in gen~). For most of the other features (envelopes, filters, etc.), though, working with RNBO's codebox~ ( = sample vector rate) would be sufficient.
So the question is: would it be worth to split the dsp into two interacting levels, gen~ for sample rate precision, and 'standard' sample vector rate for the rest? Or should I not bother too much, and write all the code straight in gen~ ?
Also, in case I decided to go for the two level options.. in Max msp I use to run the heavy gen~ patches inside a poly~ in order to be able to mute/unmute it dynamically. But as far as I can understand, in RNBO that's not a possibility. What's your best strategy to minimise the consumption of computing power in a gen~ patch whose utilisation is not constant ?
Thanks in advance.
@alessandro RNBO codebox~ actually is a single sample expression language just like gen~ codebox (in fact the gen~ code is translated into a RNBOExpr expression when used inside of RNBO).
Only the RNBO visual graph is processed in blocks.
For turning dsp on/off, any rnbo subpatcher can be managed like poly with the ability to mute/unmute voices. Although if you are primarily using codebox, you could also manage some of that logic within the code itself, and parameters to enable/disable certain sections.