Basic scripting question: Faders & negative/positive values

Discuss Lemur and share techniques.
Post Reply
voyagingmind
Newbie
Posts:10
Joined:18 Dec 2011 12:19
Basic scripting question: Faders & negative/positive values

Post by voyagingmind » 18 Dec 2011 21:41

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.


mbncp
Regular
Posts:87
Joined:08 Dec 2011 07:25

Re: Basic scripting question: Faders & negative/positive val

Post by mbncp » 19 Dec 2011 07:27

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.

voyagingmind
Newbie
Posts:10
Joined:18 Dec 2011 12:19

Re: Basic scripting question: Faders & negative/positive val

Post by voyagingmind » 20 Dec 2011 06:45

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.

Post Reply