@olilarkin I’ve tried copying your MetaParamTest example with a slightly different concept.
Using an kActiveParam to drive which param a knob reads from.
And it stubbornly refuses to work. Here is what I’m trying to do:
pGraphics->AttachControl(new IVKnobControl(eqControlsPanel.SubRectVertical(3, 0), kParamFreq1, "Freq", knobStyle, true, false, -150.f, 150.f, -150.f), 0, "EQ");
pGraphics->AttachControl(new IVKnobControl(eqControlsPanel.SubRectVertical(3, 1), kParamGain1, "Gain", knobStyle, true, false, -150.f, 150.f, 0.f), 1, "EQ");
pGraphics->AttachControl(new IVKnobControl(eqControlsPanel.SubRectVertical(3, 2), kParamQ1, "Q", knobStyle, true, false, -150.f, 150.f, -150.f), 2, "EQ");
pGraphics->ForControlInGroup("EQ", [&](IControl* pControl)
{
pControl->SetActionFunction([&](IControl* pCaller)
{
const int activeBandId = GetParam(kActiveBand)->Int();
const int baseParamId = pCaller->GetTag() + 1;
const int newParamId = baseParamId + 5 * activeBandId;
pCaller->SetParamIdx(newParamId);
SendParameterValueFromDelegate(newParamId, GetParam(newParamId)->GetNormalized(), true);
#if 0
SendCurrentParamValuesFromDelegate();
#endif
#if 0
double x = GetParam(newParamId)->GetNormalized();
SetParameterValue(newParamId, x);
pCaller->SetValueFromDelegate(x);
#endif
});
});
You can see I’ve tried a few things, and in no case does changing the knob param using SetParamIdx actually change the knob and update properly. It becomes broken from that point and the knobs stop working properly.
What am I doing wrong?