Sample-accurate parameter automation

Hi,

Another question again:

I am building an effect that should accommodate quick parameter changes (think a wah pedal with a quickly-changing filter frequency).

VST3 supports sample-accurate parameter automation.

How do I correctly get to the parameters for each sample?

Do I just call GetParam() for each sample, or is there a better / more efficient way?

Obviously, I aim to absolutely minimise CPU usage.

Thanks,

Matt

I would first question if you really need sample accurate parameter changes since it will add complexity. Most plugins don’t need them. You’ll probably want some kind of smoothing on most parameters that you might want to automate precisely, and that somewhat negates the need for sample accurate

Do I just call GetParam() for each sample, or is there a better / more efficient way?

GetParam()->Value() just gets the value, it doesn’t tell you the sample offset, so you need to implement the OnParamChange() method and queue the param changes when sampleOffset > -1. In this example I’ve just queued them into a buffer, but there are better ways you could do that.

Many thanks once again Oli, I’ve got it working very satisfactorily.

Matt