
88
Let’s look at some of the operations you can perform on vectors. Assume we have a
Multislider object called moo and a Multiball object called bar. Below we have listed some
expressions involving vectors and the results they would produce. Assume moo.x
contains {0.2 0.3 0.6} and bar.x contains {0.25 0.5}
moo.x * 3
Multiply all elements of moo.x by 3, returns {0.6 0.9 1.8}
moo.x + 2
Add 2 to all elements of moo.x, returns {2.2 2.3 2.6}
moo.x>0.5
Return a vector consisting of 1 or 0 depending on whether moo.x is
greater than 0.5, returns {0. 0. 1.}
moo.x + bar.x
Add all elements of two vectors. The size of the result is the
smaller of the two input vectors. Returns {0.45 0.8}
moo.x[0]
The first (zeroth) element of moo.x, returns 0.2
bar.x[1]
The second element of bar.x, return 0.5
moo.x[0.5]
Interpolated value between bar.x[0] and bar.x[1], returns 0.3
{moo.x, bar.x}
Concatenates moo.x and bar.x, returns {0.2 0.3 0.6 0.25 0.5}
{moo.x[0],bar.x[1.5]}
Creates a new vector consiting of the first element of moo.x and
the average of the second and third elements of bar.x, returns {0.2
0.625}
Using the Time Variable
If you look at the Variables folder in the Project Browser, you will see a pre-defined
variable called time.
The time variable is a millisecond value you can use for creating time-varying behavior in
your Lemur. It represents the number of milliseconds since your Lemur was turned on,
although it resets to 0 every hour. The time value is intended to be manipulated by
mathematical operators, particularly multiplication (*), division (/), and the modulo
operator (%).