Help with Button to ramp a Knob value up and down 0.- 1. > 1. - 0.
-
Is there any simple function for this, or using Timer?
Can anyone provide an example? :) -
@Rognvald I found this as a starting point.. :)
const var Knob = Content.getComponent("Knob"); const TH = Engine.createTransportHandler(); // 18 = tempo factor = 1/64T TH.setEnableGrid(true, 18); // Set sync mode Internal or External TH.setSyncMode(TH.PreferExternal); // ON GRID CHANGE FUNCTION // You start and stop this using "TH.startInternalClock" & TH.stopInternalClock inline function GridChange(clock, arg2, arg3) { local v = (clock % 200) / 100; local value = v < 1.0 ? v : 2 - v; // Trigger the knob Knob.setValue(value); Knob.changed(); }; TH.setOnGridChange(true, GridChange); inline function onKnobControl(component, value) { Console.print(value); }; Content.getComponent("Knob").setControlCallback(onKnobControl); // START STOP INTERNAL CLOCK inline function onStartInternalClockControl(component, value) { if (value) TH.startInternalClock(0); else TH.stopInternalClock(0); }; Content.getComponent("StartInternalClock").setControlCallback(onStartInternalClockControl);