Lemur Monitors Lemur Mouse User Manual


 
The Lemur User Manual
93
when a = 1, the vector is completely filled with items = value
when a = 0.5, the vector is half filled
Examples :
fill(1, 0.524, 4) = {0.524, 0.524, 0.524, 0.524}
fill(0, 0.524, 4) = {0, 0, 0, 0}
fill(0.5, 0.524, 4) = {0.524, 0.524, 0, 0}
firstof(a) : Returns the position of the first non-null item in a vector
this is often used with switches in radio mode : firstof(x) returns the
position of the enabled switch in the matrix
Examples:
firstof({0,0,1}) = 2
firstof({1,0,0}) = 0
if the vector only contains null items, the function returns the size of
the vector
firstof({0,0,0}) = 3
replace(a, b, position) : Takes an array, and replace the items starting at
“position” with b
b can be an array or a singleton
Examples:
replace({0,0,0,0}, {12,2}, 0) = {12, 2, 0, 0}
replace({0,0,0,0}, 0.15, 3) = {0, 0, 0, 0.15}
If position is not an integer, the parser converts it using the
floor function (next lower integer)
set(a, value, position) : Takes an array, and change the item at "position" to
"value"
position can be an array or a singleton
Examples:
set({0,0,0,0}, 12, 0) = {12, 0, 0, 0}
set({0,0,0,0}, 12, {0,2}) = {12, 0, 12, 0}
If position is not an integer, the parser converts it using the
floor function (next lower integer)
sizeof(a) : Returns the size of an vector (or 1 if applied on a
singleton)