Scaling value ranges using formulas

 

Adding formulas

The easiest way to add a formula is via the Wizard. To do so click on Wizard and select one of the following formulas:

After this click OK to enter the formula. Alternatively, you can also enter a formula directly. Click Test and enter a source value to test the formula. Then click Connect to make the connection using the formula.

Supported functions

For direct entry of formulas the following operators and functions can be used:

^

to the power (for defining an exponent)

/

division

%

modulo (rest after a division)

*

multiplication

-

subtraction

+

addition

<

is less than

<=

is less than or equal to

>

is greater than

>=

is greater than or equal to

==

equal

~=

unequal

or

logical "OR"

and

logical "AND"

=

assignment

sin(x)

sinus (x)

cos(x)

cosine (x)

map(from_min, from_max, to_min, to_max, x)

maps x from interval [from_min, from_max] (values outside this range are cut off) onto Interval [to_min, to_max].

sqrt(x)

square root (x)

abs(x)

absolute value (x)

clamp(x, min, max)

limits x to the interval between min and max

_pi

π, Pi

rng()

random number generator generates a random number between 0 and 2^31 (highest number to be displayed); When you enter a parameter, e.g. rng(5), the function outputs a random number between 0 and the entered parameter. If two parameters are entered, e.g. rng(10,20) the function generates a random number between the first and the second parameter.

 

See also Connecting and editing channels.