Stepped Frequency Selector
-
Hi all, I'm trying to create a knob to select specific frequencies in steps, something like this:
//TEST const var Filter1 = Synth.getEffect("Filter1"); const var Low_Freq_Knob = Content.getComponent("Low_Freq_Knob"); const var a = [20, 30, 60, 100]; inline function onLow_Freq_KnobControl(component, value) { for (i = 0; i < 4; i++); { if (Low_Freq_Knob.getValue() == i) Filter1.setAttribute(Filter1.Frequency, a[i]); } }; Content.getComponent("Low_Freq_Knob").setControlCallback(onLow_Freq_KnobControl);
Unfortunately, it doesn't work; if I use Console.print(Filter1.Frequency), I get four "1" in a row, instead of the four values specified in the "a" array.
The Knob paramters are: min=0, max=3, step=1, mid=1
Any suggestions?
Thanks a lot -
-
@d-healey Thanks, I read it immediately
-
@d-healey Of course, that solved my problem :) thanks a lot mate!