Update ValueTreeState parameters in audioThread with async call to listeners


#1

I need to update an AudioProcessorValueTreeState value synchronously in the audio thread but all I have found to do this is
AudioProcessorValueTreeState::Parameter::setValue() which is also calling synchronously listeners. Since my parameter change listeners are triggering GUI updates I would like to have them called asynchronously.

Is there any way to update an AudioProcessorValueTreeState parameters from the AudioThread without making a synchronous call to the listeners, rather in an async callback?


#2

AudioProcessor-Parameters are not designed to be updated inside the audio thread.

Either their updated by the host (through automation etc…) or by the GUI of your plugin, in a way that the host can catch parameter changes (void setValueNotifyingHost) to record the automation.

Otherwise the whole automation logic inside your host would be impossible to implement.

Of course you could use extra state values, which work independently from parameters.