Relationship between Params and Controls

I am trying to understand the relationship between Params and Controls, and what’s possible.

I understand that a one-to-many mapping of params to controls is possible, and happens automatically. When you pass the same param to a slider and a knob, they both show updates to the param and become “linked”.

But how should we establish a many-to-many relationship?
For example, let’s say we have 4 knobs for ADSR envelope, but we also have a graphic control that displays a visual envelope with control points. Each knob gets kParamAttack, kParamDecay, kParamSustain, kParamRelease, but we want the graphic control to be bound to all four.

How does a control get bound to four (arbitrary) parameters so that when any of them updates, the control is redrawn? The IControl interface looks like a control is meant to handle only one param.

Thanks!

the IControl::mVals member is a vector that can hold multiple param-tuples (paramIdx + value)

Take a look at e.g. the IVXYPadControl to see how a control can be linked to multiple parameters. One of the IControl constructors takes a std::initializer list which you can use to set up your custom ADSR display control to link to all the relevant parameters for your ADSR envelope. It’s commented out but the IVMultiSlider in the IPlugInstrument example demonstrates this (although the CTOR is taking a start parameter & number of adjacent parameters is defined by the template argument)

there’s also IVRangeSliderControl which takes two params (a min and max).