
85
Advanced Expression Features
There are two types of expressions supported by the Lemur:
Variables
and
Functions
. In
previous chapters we defined variable expressions that belonged to Lemur objects. In this
chapter we introduce the concept of global variables as well as global user-defined
functions. These expressions can be accessed from any Lemur object. Finally, we look at a
special global variable built into the Lemur called time that you can use to create
automated and repetitive behaviors in your Lemur configurations.
Available Built-in Functions and Operators
When constructing an expression, you can make use of a number of built-in operators
and mathematical functions. Here is a list:
Syntax
Example
Description
+, -, *, /, pow, sqrt, round,
floor
a+b, b-a, a*b, pow(a,b)
Basic arithmetic operators
sin, cos, tan, log, log10, exp,
acos, asin, atan
sin(a), cos(a+b), etc.
Trigonometric operators
>, >=, ==, <, <=, !=
a>b, a<b, a!=b
Logical operators
&&,
||
,
|
a&&b, a
||
b
Bitwise operators
clamp, range
clamp (a, min, max), range
(a, min, max)
Change input value range
Local and Global Variables
Variables listed under a Lemur object are
local
variables. The MultiSlider object named
Env below has its built-in variable x followed by three expressions serving as local
variables, Dewey, Huey, and Louie.