I have a plugin where several parameters are linked. For example, for the left and right channels.
The link can be turned on and off so that, for example, even if the parameters differ, they can still be moved simultaneously and the difference is maintained, even when moving only one parameter.
Currently, I do this in the GUI by simply adding the delta from the starting point to the linked other parameter (in the case of a slider). This works very well. It’s also possible to create antiproportional links this way.
Unfortunately, this does not work if the parameter is controlled externally, because it is not possible to distinguish whether the change comes from automation or from an external controller, or is it?
Is there any way to detect whether a parameter is being changed by an external control device, maybe through beginChangeGesture/endChangeGesture?
How could this problem be solved creatively? I am grateful for any suggestions.
I would assume that you are using `sliderValueChanged`. It should work if you call setValue() with juce::dontSendNotification in the parameter attachment.
___
I don’t know much about the external control surface
If the host is handling the control surface, that works like automation envelopes in the host, the plugins (at least Juce based ones) don’t have a way to know if the parameter changes happen because of host automation or because of external control surface movements.
Linked parameters are different across different plugin formats.
I believe the VST3 spec states that no automatable parameter shall influence another parameter. So, a good way to do it is to have a third, non-automatable parameter, which controls the other two parameters.
I don’t know about AU but it does have the concept of metaparameters, which I believe are for this purpose.
So, for cross-format compatibility, I would make a controlling, non-automatable metaparameter and document that the user has to use that on their control surface. For AAX, you can use page tables to hide the automatable parameters from the control surface by default.
There is always an ambiguity, if you want to use the parameters directly in your DSP:
The automation doesn’t know anything about the link, so if the user draws an automation, it can and will contradict the linked movement.
IMHO the cleanest solution is to discard one parameter and use the other value for both.
You can also change the UI so the right knob controls the left one as well when linked, so they always move in unison.
To get a relative link is a bit more tricky, because the information of the distance of both at the time of activating link needs to be stored as well.