Formula Parser

This function requires at least a Wings Vioso license. See also Licenses and functions.

Wings Vioso RX features a formula parser which allows values to be changed mathematically or generated on a time basis. The formula parser may be used in the following cases:

Use of the formula parser requires detailed mathematical knowledge as the required functions need to be entered as a mathematical formulas. In addition to a mathematical operation a formula can also contain logic comparisons. The various options offered by the formula parser are explained in section Formula parser reference list.

To give you a chance to find out about variables and formula parser we have prepared a tutorial and demo project which allows an insight also for users who think they have a lower mathematical ability. See also Screen field control via formulas.

 

Control of screen field parameters

 

Changing values

Value Out variables  …allow sending of information to other Avio devices and controlling of parameters in  Wings Vioso RX.

Value In variables  …receive values from Avio devices for further use in  Wings Vioso RX.

Function generator  …generates functions and/or a time-based value which can also be used in Avio.

Internal Variables  ...for internal calculations using the formula parser and exchange of data within Wings Vioso RX.

 Text Out variables  ...allow sending of text to other Avio devices.

Text In variables  ...receive text from Avio devices for further use in Wings Vioso RX.

 

 

Please note the following:

 

Formula parser reference list

Here you will find all the functions offered by the formula parser. Important note:

 

Operators supported

Single-character operators

-

turns into a negative value

°

converts degrees into radians

_rtd

converts radians  into degrees

_r

converts radians into the interval [0, 1]

converts degrees into the interval [0, 1]

 

 Double-character operators (in order of priority)

^

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

==

is equal to

Attention: For internal purposes, Wings Vioso RX uses the file format "double precision floating point" for variables, which might cause problems when comparisons are used carelessly.

!=

is not equal ('Attention: see above)

||

logical "OR"

&&

logical "AND"

=

allocation (parser requires write authorization, otherwise error!)

 

Constants

_pi

&pi;, Pi

_e

e, Euler's number

 

Trigonometric functions

sin(x)

sinus (x)

cos(x)

cosinus (x)

tan(x)

tangens (x)

asin(x)

arcus sinus (x) (inverse function)

acos(x)

arcus cosinus (x) (inverse function)

atan(x)

arcus tangens (x) (inverse function)

atan2(x, y)

arcus tangens (quadrant selections), values between -PI and PI

 

Hyperbolic functions

sinh(x)

sinus hyperbolicus (x)

cosh(x)

cosinus hyperbolicus (x)

tanh(x)

tangens hyperbolicus (x)

asinh(x)

arcus sinus hyperbolicus (x) (inverse function)

acosh(x)

arcus cosinus hyperbolicus (x) (inverse function)

atanh(x)

arcus tangens hyperbolicus (x) (inverse function)

 

Exponential function

exp(x)

e^(x)

 

Logarithm

ln(x)

Logarithm to base e

log2(x)

Logarithm to base 2

log10(x)

Logarithm to base 10

 

Integer conversion

round(x)

rounding to integer

floor(x)

greatest integer greater than or equal to x

ceil(x)

smallest integer greater than or equal to x

 

Random number generator

rng()

random number between 0 and 1 (random number generator)

 

Various

sqrt(x)

square root (x)

abs(x)

absolute value (x)

sign

sign (x)

saturate(x)

clamp x to [0, 1]

step(value, x)

(x >= value) ? 1 : 0

clamp(x, min, max)

restricts x to the interval between min and max

smoothstep(min, max, x)

Hermite interpolant  for x between min and max, x < min => 0, x > max => 1

lerp(a, b, x)

linear inter/extrapolation between a and b, x == 0 => a, x == 1 => b

 

Area allocation

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

maps x from interval [from_min, from_max] (values outside this range are truncated) to interval [to_min, to_max].

The following functions search for variables via their names without knowing about their context (read and write access). This may turn out to be problem if variables have equal names but are used in different contexts. Please note that the variable name is between quotation marks.

map_int("variable name", min, max)

restricts the value range of variable "variable name" to integers between min and max.

map8("variable name")

restricts the value range of variable "variable name" to integers between 0 and 255.

map16("variable name")

restricts the value range of variable "variable name" to integers between 0 and 65535.

cmp8("variable name", value)

restricts the value range of variable "variable name" to integers between 0 and 255 and compares it to "value".

mp16("variable name", value)

restricts the value range of variable "variable name" to integers between 0 and 65535 and compares it to "value".

cmp_dmx("variable name", value)

restricts the value range of variable "variable name" to integers between 0 and 255 and compares it to "value".

cmp_midi("variable name", value)

restricts the value range of variable "variable name" to integers between 0 and 127 and compares it to "value".

 

 Variable parameter functions

sum(a, b, c, ...)

a + b + c + ...

avg(a, b, c, ...)

average (a, b, c, ...)

min(a, b, c, ...)

minimum (a, b, c, ...)

max(a, b, c, ...)

maximum (a, b, c, ...)

 

Conditional functions

if (condition) then (expression A) else (expression B)

If "condition " is true, then execute "expression A", else "expression B"

(condition) ? (expression A) : (expression B)

as above, but simplified notation

 

System variables

Global variables

tYear

year, 4-digits (PC setting)

tMonth

month, 1...12 (PC setting)

tDay

day, 1...31 (PC setting)

tWeekday

weekdays, Sunday = 0, Monday = 1, ... Saturday = 6

tHour

hour, 0...24 (PC setting)

tMin

minutes, 0...60 (PC setting)

tSec

seconds, 0...60 (PC setting)

tSys

PC system time (shortcut ts)

peakLevel01

channel 1 peak level (stereo L) (short cut pl1)

peakLevel02

channel 2 peak level (stereo R) (shortcut pl1)

rmsLevel01

channel 1 RMS level (stereo L) (shortcut rl1)

rmsLevel02

Channel 2 RMS level (stereo R) (shortcut rl2)

 

Track variables

alpha

track transparency (shortcut al)

xPos

X position of track screen field (shortcut xp)

yPos

Y position of track screen field (short cut yp)

xZoom

X-size of track screen field (short cut xz)

yZoom

Y size of track screen field (shortcut yz)

xRot

rotation around the X-axis (shortcut xr)

yRot

rotation around the Y axis (shortcut yr)

zRot

rotation around the z axis (shortcut zr)

xRotC

X position of rotational center (shortcut xc)

yRotC

Y position of rotational center (shortcut yc)

 

Time variables

Time variables always refer to one track and refer to the current locator position. Therefore, they can only be used in the Properties Table Realtime and not in the Media Pool Variables.

tObjAbs

absolute, timeline-based time from object beginning to object end(shortcut toa).

tObjRel

relative, object-based time from object beginning to object end (shortcut tor)

tDispAbs

absolute, timeline-based time from fade-in beginning to fade-out end (shortcut tda)

tDispRel

relative, object-based time from fade-out beginning to fade-out end (object duration) (shortcut tdr)

tFadeInAbs

absolute, timeline-based time from fade-in beginning to fade-in end (shortcut tfia)

tFadeInRel

relative, object-based time from the fade-in beginning to the fade-in end (shortcut tfir)

tFadeOutAbs

absolute, timeline-based time from fade-out beginning to end (shortcut tfoa)

tFadeOutRel

relative, object-based time from fade-out beginning to fade-out end (shortcut tfor)

tTlAbs

absolute timeline time (shortcut tta)

tTlRel

relative timeline time from the beginning of the timeline to the end of the last object as values from 0 to 1 (shortcut ttr)

 

Further variables

ObjWidth

object width in screen coordinates

ObjHeight

object height in screen coordinates

ScreenRatio

screen aspect ratio

 

Generation of variables

create variable name

creates a variable "variable name". The variable must be created before it is used the first time.