I’m doing some parameter linking between various identical parameters but in different bands of a multiband processor. They are stored in the AudioProcessorValueTreeState. At the moment I use the parameterChanged callback to trigger the dependent parameters from the controlling parameter along with some logic to avoid feedback loops. This works fine except for automation which gets very confused, particularly in Ableton.
So from my study of other plugins (Ozone, Waves Scheps 73 stereo link mode) it seems they manage to update the plugin’s parameter internally and in the GUI without notifying the host.
Is there a way to do something similar with the valuetreestate? I have tried using setValue on the parameter directly but this puts it out of sync with the GUI and the ValueTreeState as far as I can tell. Any suggestions in general with linked parameters would be helpful!
I usually have 3 different kinds of parameters stored in different places:
AudioProcessorValueTreeState: Parameters for things that need to be automated and stored with the plugin.
AudioProcessorValueTreeState: The state member variable (which is a ValueTree that gets saved with the plugin) for things that don’t need to be controlled/automated from the DAW, but should be saved with the session. (Some visual settings for example)
ValueTree: I usually use a separate ValueTree object for things that need neither automation nor saving with the session. I usually call this communicationValueTree and use it for things like what you described.
Interesting, so I do something similar for separating audio parameters from non-parametric GUI state.
RE: the last point so you use this for messaging/syncing GUI elements then update the actual parameters from that at some point?
yes, exactly, so I have a central point for all communication to hook into and debug and even classes that are far apart from each other have a clean way of communicating with each other.
So your suggestions about using the ValueTree for non-parametric state got the cogs whirring and I realised that I could use it to set a flag from the Slider/Button attachments to allow only knobs/sliders/etc. update linked parameters and block automation attempts. Not the most elegant of solutions but it works.
Might be of help to someone!