I’m not sure if we should take the VST3 standard. I also see some problems when we have to check the parameters for changes. There are also questions about how this works when you are using the ValueTreeListener to update your parameters also for the DSP code.
We have a plugin with >10000 parameters. I don’t think I can check them all when the buffer size is 32 samples and I like to have the DSP code decoupled from parameter value classes.
At the moment we have to use the listeners to update also the DSP parameters. This is really annoying because it is called from different threads at any time.
The solution that the JUCE CLAP extension implements is a callback that is also called in the processing thread for every event just before the audio processing starts. It looks like this:
void handleDirectEvent(const clap_event_header_t *event, int sampleOffset)
This callback handles all event types in one place. This means we get parameter changes, midi and note expressions all in one single place. This makes things super simple and it does not add CPU load when no parameter is automated. I like this idea, especially if we want to go for sample accurate events. We already have this for MIDI, why can we not use the same list also for automation?
This are the types the event can have:
For JUCE it would be a good solution to pass them into the process-block function directly. We can still call the old process method with the midi-only events and run them parallel. We could mark it as deprecated for the next 20 years.
I’m sure we could also simplify the MPE implementation and don’t have to find out by ourselves what parameters have changed or listen to changes also for parameters used in DSP code.
The current API does not fit the needs of the current time anymore. We have much more than MIDI events and audio data and we want to be sample accurate. I think we should make some bigger changes…
Edit: I think we should also have a look at the CLAP features and implementation when we add support for sample-accurate automation. Would be great to see a JUCE CLAP wrapper in the future. Other companies using CLAP as a basis have extensions for the other formats.