Page 1 of 1
multiball range scripting
Posted: 13 Nov 2013 10:53
by Eric
hello everyone,
a little help needed here for a newbie in scripting. I want to define the value's range of any of the balls in the multiball object let say from - 1 to 1. I guess i have to enter and expression/script in the object, but i'm king of loss, and my google researched remained poor!
thanks a lot in advance for the help!
Re: multiball range scripting
Posted: 13 Nov 2013 13:56
by Macciza
Hi
Lots of ways to do it - heres a few tips . .
Chuck a MultiBall and a Monitor on screen - Put MultiBall.x in the Monitor to see what you get, hmm 0 -1 - Standard Lemur values . . .
You want -1 to 1 : a range of 2. So if you get a range of 0-2 and take off 1 - What does that do? Try MultiBall.x*2-1 . . .
To make it a bit easier define new variable say
and then you can map that .. . .
Hope that helps
Re: multiball range scripting
Posted: 13 Nov 2013 14:37
by mat
Hey, as an advanced way you can also route the output of an axis to an range object, as done here:
http://liine.net/en/community/user-library/view/5/
This would give you the possibility to dynamically change the output. ...there are really lots of ways to transform the output of an object on lemur
cheers*mat
Re: multiball range scripting
Posted: 14 Nov 2013 01:49
by Macciza
Yep ,
There a lots of ways of achieving similar things in Lemur . . .
So a few more tips . . .
Lets see, you want to change the 'range' of a value . . . lets have a look in the manual for something (no, not the Range object) . . .
or even better a quick peek at the Internal functions list in the Project panel - hey, theres a range(a,min,max) function in the Arithmetic section . . .
So if we stick with the x value example, we can use range(x,-1,1) - which will return -1 to 1 …. and use that as need
You could also factor that out into its own script by making a one line function - bipolar(x) ~ range(x,1,1) then use it as needed. i.e. bipolar(Fader.x) etc . .
You could also make vars for the lo and hi val (lo / hi) and then set them as needed and make your maths or scripts reference them i.e. range(x,lo,hi) etc . .
It can depend on so many things - it can be hard-coded, allow for easy editor setup, be scripted for enduser setup; can use explicit maths, built-in/user functions, constants / variables, etc etc
Hope that helps
MM