Unsolved Table Index Stepsize
-
Hello, I tried to change the stepsize of my UI knob of the Wavetable TableIndex. For the Knob it works but not for the function. here is my code:
const var knobValues = [0.0, 0.2, 0.4, 0.6, 0.8, 1.0]; inline function onWaveMix1Control(component, value) { WavetableSynthesiser1.setAttribute(WavetableSynthesiser1.TableIndexValue, knobValues[value]); } Content.getComponent("WaveMix1").setControlCallback(onWaveMix1Control); inline function onWaveMix2Control(component, value) { WavetableSynthesiser2.setAttribute(WavetableSynthesiser2.TableIndexValue, knobValues[value]); } Content.getComponent("WaveMix2").setControlCallback(onWaveMix2Control);
-
-
@meto396 what is the range of the knob? seeing your array length is 5, the knob has to be 0-4 with stepSize=1
If you intend to use different step values, there are other ways to do this without an array.
const var NB_STEPS = 5; // later in your functions local index = Math.round(value * NB_STEPS) / NB_STEPS; // output -> 0.0, 0.2, 0.4...