Lemur Monitors Lemur Mouse User Manual


 
Parser Reference
86
This can be very useful to derive “clean” values from the time variable (see below for
a definition of Lemur time):
time%1 = 0.25 (if time = 2043.25)
5.1.3. Functions
Functions are the other founding stone of expressions in the Lemur. There is a
variety of internal (pre-defined) Functions but you can also define your own Function.
You can create a Function by setting up a variable named xxx(a,b) and set its value
as something like a-b+2.
The Functions can then be taken as the value for other Variables, where they receive
“real” Lemur values as arguments. You could use the above function by making a Variable
named yyy with the value xxx(Fader.x,Multiball.y). In this case a and b are
substitutes by the current values of Fader.x and MultiBall.y.
Please note that most Functions that can act on singletons can adapt to vectors as
well. For instance :
round(1.2) = 1
round({1.2, 3.8, 0.1}) = {1, 4, 0}
5.1.4. Expressions
Using all those bricks, you can create named Expressions (Variables) or use
Expressions as Objects' parameters (attraction, etc.)
When entering a vector as a parameter for a multi-state Object (Switches,
MultiBall, Leds, Pads), the parser will do its best to map each item in the vector to each sub-
object
For instance :
entering {0.1, 0.5, 1.0} as the attraction for a Multiball that has 3 balls sets :
attraction for Ball 0 : 0.1
attraction for Ball 1 : 0.5
attraction for Ball 2 : 1.0
When mapping a vector Variable to MIDI (the x parameter of a Multiball with 10 balls,
or a user-created Expression that evaluates as a vector), the parser will try to stretch the
mapping to all the items.
For example:
A custom Expression called "vec" with value set to :
{Ball.x+Ball.y, Ball.x-Ball.y}.
If you know go into the MIDI panel and want to map the Expression to a MIDI
controller, you just have to put controller 10 into the first controller field and the second field
will automatically be set to 11.