I just started looking into lemurs scripting/expressions.
And was wondering what a simple method would be to convert a Faders.x value 0 - 1 to say control the speed of e.g. a multi-ball which has a range of -5 - 5.
so e.g. a fader value if .5 would equate to a speed of zero, 1 would be speed 5, and 0 speed -5
It's been a while since I've scripted, and my math is pretty rusty.
This is a basic enough a question, I don't want to seem lazy, but I'm sure assistance in this would also help other sunday scripters like me getting started with lemur.
If i find something in the meantime I'll post it, either way, your help is appreciated.
Basic scripting question: Faders & negative/positive values
-
- Newbie
- Posts: 10
- Joined: 18 Dec 2011 12:19
-
- Newbie
- Posts: 18
- Joined: 08 Dec 2011 02:00
Re: Basic scripting question: Faders & negative/positive val
Or you could use the range function:
range(x, -5, 5) , it assumes the first value (x in this case) to be between 0 and 1.
range(x, -5, 5) , it assumes the first value (x in this case) to be between 0 and 1.
-
- Newbie
- Posts: 10
- Joined: 18 Dec 2011 12:19
Re: Basic scripting question: Faders & negative/positive val
Doh! Thanks armatronix, so simple, now i really feel stupid, heh
Also thank you mbncp for making me aware of the range function, very practical.
Also thank you mbncp for making me aware of the range function, very practical.