Automation Not Working When Bounced Offline

Finishing a plugin right now and realized when I bounce a track offline using my plugin the automation of my plugin does not work at all.

Automation works when playing in real-time, but about 20% of then time a parameter changes values a beat or two late.

Using APVTS and slider attachments.

Any thoughts on what I could be doing wrong?

How/where are you getting the parameter values for your processing?

Essentially like this:

void valueTreePropertyChanged (ValueTree &treeWhosePropertyHasChanged, const Identifier &property) override
    {
        updateSettings();
    }

…

void updateSettings()
    {
        samplerInstrument.changeNumVoices(apvts.getRawParameterValue("Voices")->load());
        samplerInstrument.attackVal = apvts.getRawParameterValue("Attack")->load();//
        samplerInstrument.releaseVal = apvts.getRawParameterValue("Release")->load();//
     }

I understand this probably isn’t the correct way, but have had a very difficult time finding an example of how to do this properly.

Realized valueTreePropertyChanged is not called when offline bouncing. Still looking for solution

Figured it out, parameterChanged works well. Just had to add all may parameters as listeners with:

for (auto& p : getParameters())
    {
        apvts.addParameterListener(static_cast<AudioProcessorParameterWithID*>(p)->paramID, this);
    }

And at the beginning of my process function I call update if parameterChanged declared there has been a change.

or just get the parameter values at the start of processBlock

like @Mrugalla said, receive your parameters values directly in the processBlock.

The message thread might be completely blocked while offline rendering, any listener specific actions will not work (and whats worse, will be delayed or happening in parallel causing data races)

I think the “only” save way to receive your current parameter values is to access them inside processBlock.
Also if you use the same parameter more than one time, inside processBlock, it is better to store them locally in a variable, because they might change while executing processBlock.

1 Like

Ahh yes that makes sense, it’s just I have about 70 apvts parameters and I’m guessing I shouldn’t be trying to update that many parameters every buffer. Is there a standard way to only update if has been changed from the process block?