Finding Values of Knob controlled by another
-
Hey Gang,
Heres the sitch...
I have a Master FX Knob set to NormalizedPerecntage. It is scripted to control some FX Knobs.
One of these FX Knobs controls the WET Amount of the Reverb and is set to 60%.
I need the Master FX Knob to to see 60% as the highest value for the WET Amount on that Reverb.
If the Reverb WET Amount is changed via the FX Knob that controls it, the Master FX Knob will then see the new amount as the highest value and so on...
Can anyone point me in the direction for this one?
Thanks!
-
Think I might have covered that in this videoActually it's a video on my Patreon, it's called "Linked knobs controlling reverb"
-
@d-healey Awesome, Ill check this out tonight or tomorrow!
-
@d-healey Hey David, Im doing something wrong here.
The knobs that control the FX work correctly. The Master has no effect at all on anything EXCEPT the linked Saturator knob. All it does is turn it back to 0 instantly.
Can you spot what Im doing wrong here?
//MAIN EFFECTS const KnobsMax = [1, 1]; //Knobs Being Controlled const knobs = []; for (i = 0; i < 4; i++) { knobs.push(Content.getComponent("knb" + i)); knobs[i].setControlCallback(onknobControl); } //Link Buttons const btns = []; for (i = 0; i < 2; i++) { btns.push(Content.getComponent("linkbtn" + i)); } //Linked FX const var SatLink = Synth.getEffect("Saturator1"); const var ChorLink = Synth.getEffect("Chorus1"); const var PhaseLink = Synth.getEffect("PhaseFX1"); const var BitLink = Synth.getEffect("BitCrusher"); //Linked Knobs Callbacks inline function onknobControls(component, value) { local index = knobs.indexOf(component); KnobsMax[index] = value; setSaturator(index, value); setChorus(index, value); setPhaser(index, value); setBitCrusher(index, value); } //Master Knob const MainFXknb = Content.getComponent("MainFXknb"); MainFXknb.setControlCallback(onMainFXknbControl); inline function onMainFXknbControl(component, value) { for(i = 0; i < knobs.length; i++) { if(btns[i].getValue()) { knobs[i].setValue(knobsMax[i] * value); setSaturator(i, knobsMax[i] * value); setChorus(i, knobsMax[i] * value); setPhaser(i, knobsMax[i] * value); setBitCrusher(i, knobsMax[i] * value); } } } inline function setSaturator(index, value) { SatLink[index].setAttribute(Saturator1[index].WetAmount, value); } inline function setChorus(index, value) { ChorLink[index].setAttribute(Chorus1[index].Rate, value); } inline function setPhaser(index, value) { PhaseLink[index].setAttribute(PhaseFX1[index].Mix, value); } inline function setBitCrusher(index, value) { BitLink[index].setAttribute(BitCrusher[index].Quant, value); }