Initialize value at init?
-
What's the proper way to initialize a variable to the value of a parameter?
I'm trying this, which works, when when I restart HISE, the value is always 0const var Knob1 = Content.getComponent("Knob1"); var initializedValue = Knob1.getValue();
-
@Dan-Korneff are you giving the variable the value inside a callback?
-
@ulrik I'm not. I'm trying to set this variable at init so I can reference it in the Knob1 callback.
-
Got a working solution. Just declare the variable as undefined, and then use an if statement in the knob callback to define if == undfined