Hi!
In case of âone MIDI event per sampleâ it would be just as bad, that is correct. But, usually MIDI data is not that dense. You canât even transport 48000 events per second using a HW MIDI cable
In case of ramps or similar, DAWs âthin outâ the MIDI events that are generated from that.
Sample accurate automation has, at least in case of VST3, support for being sample accurate for ramps and curves, which is a good thing. For this to work efficiently, you need to transfer the data that matters, and only eval it where it matters, only if it matters.
This is not comparable to how MIDI works, it needs to be treated and handled in a different way, which is why I chimed in here. It has nothing to do with splitting processing blocks which came up as a sketchy workaround to increase parameter resolution due to lack of a better alternative.
So, If you get a bunch of curve segments, that is an efficient solution to transport the data. Itâs as precise and accurate as you want it, and it works great for curves and ramps, which are continuous (value changes each sample). Which is probably why Steinberg designed it in this way.
Quote from the VST docs:
Performing sample-accurate automation requires even more overhead, because the DSP value must be calculated for each single sample. While this cannot be avoided entirely, it is the choice of the plug-in implementation how much processing time to spend on automation accuracy. The host always transmits value changes in a way that allows a sample-accurate reconstruction of the underlying automation curve.
Read more here: Parameters and Automation - VST 3 Developer Portal
I donât have a good suggestion for a sensible abstraction in JUCE, but calling the for-loop you suggested for 50 parameters each sample is too costly. Because, In case of continuous (ramped or curved) automation, JUCE would somehow need to evaulate all active automation curves, produce a âparameter changedâ event per sample, filling lots of large buffers, etc.
Iâd prefer to get access to the curve segments instead and then decide what to do with it, without producing such overhead.
JUCE already evals everything at sample 0 in the audio buffer (which replicates vst2 behavior). Having the option to eval more often and getting a list of the points in the buffer where the curve changes could be a way forward, plus a helper for evaluating the curves on JUCEs side.
I canât specify the whole thing spontaneously in a comment, it seems deep and complex and full of special cases.
tldr, Just saying, this needs more due diligence, looking at the solutions for sample accurate automation in the various plugin formats should come first.
I might also be wrong, if the assumption that everything between automation points is ONLY AND ALWAYS ramped (no parametric curves, steps created by two events on the same sample), it would work to just get a set of events, similar to what you suggested, but Iâm pretty certain that there IS support for parametric curves. 