Automation does not work as expected

Hello @daniel,
Continuing the discussion from Issue with parameter automation in DAW:

I’m working on fixing automation in my audio plugin project, and was going through some similar posts,
I’m having trouble with automation as, it does not work when plugin GUI is closed. I’m using APVTS to create parameters.

Per discussion on this Issue with parameter automation in DAW - #9 by daniel, it mentions It is okay to use getRawParameter(“paramId”) returned to atomic, I’m exactly doing that but automation issue still persists.
The dynamic_cast solution here that you suggested looks reasonable, I just wanted to make sure, I use it in the processor instead of assigning getRawParameter(“paramId”) to atomic
, correct?

Any suggestion/help is appreciated. TIA!

1 Like

Please have a look at a JUCE example plugin. All you need to do is to create audio parameters and add them to the audio processor. Automation will work out of the box for every parameter:

1 Like

@kunz Thank you for the link. I have audio parameters created and added to APVTS using parameterLayout() and attachments. And automation works fine when plugin GUI is open in the DAW, but on closing the plugin GUI, plugin effects are applied but automation does not work.

If the effects are applied, then what about the automation does not work?

@HowardAntares Not sure if I’m following. But what is happening on closing plugin GUI is plugin Fx are intact like delay, reverb whatever is applied but automation is gone.

Gone from where? Do they vanish from the automation lanes? The UI is completely unrelated to automation. The host sends and receives automation values for parameters which are automatable when the transport is running (and even when stopped, in many hosts), and, assuming your Processor is a listener for the parameters it cares about, the Processor’s parameterChanged() function is where you would receive those change notifications and update your DSP. Are you not setting your Processor as a Listener via the APVTS’s addParameterListener() function (and removing it upon destruction)?

@HowardAntares apologies for the confusion. When the plugin window is closed, automation does not reflect on the parameters it is applied to. In order to have automation working, plugin window must be open all the time.
checking on this part, I think that’s what is missing from my code, do I need to add that function in processor cpp?

That’s what connects your Processor to changes in the Parameters. I think you can also use the getRawParameter() function to get pointers to the parameter values, but you’d have to use that in your Processor, and I don’t know how that works with automation, because I’ve never used it personally.

Currently I’m using getRawParameter() but looks like it is not working, going to try this route.