Inverting a knob
-
Hello everyone,
i'd like to invert a knob, so the minimum value would be 1 and the maximum 0. Using the properties of the knob doesn't work and found this post (https://forum.hise.audio/post/14243)While i understand the idea of this simple line, i don't know how to implement it in a function linked to my knob. Here's what i wrote (I have some experience with C# and a tiny bit of Unity3D oriented Javascipt, so i'm a newbie with Hise scripting ):
const var knobAmount = COntent.getComponent("LFOAmount"); inline function onKnobControl(value){ 1-amountKnob.getValue(0, 1); }
I'm sure i miss something simple, but i can't figure out what...
Thanks in advance!
-
@Ender you already have
value
as callback's argumentSo:
inline function onKnobControl(value) { local invVal = 1-value; Console.print(invVal); }
-
@ustk said in Inverting a knob:
@Ender you already have
value
as callback's argumentSo:
inline function onKnobControl(value) { local invVal = 1-value; Console.print(invVal); }
Hello @ustk ,
I just had to do some little adjustment to the function you wrote and everything works like i want :)
Thank you very much for your help!