Link Search Menu Expand Document

ExprTK support

Several processes allow to write simple math expressions. Such processes include:

  • Micromap: for very simple math expressions, e.g. x * 100.
  • Expression Audio Generator: generates multi-channel audio.
  • Expression Audio Filter: filters multi-channel audio.
  • Expression Value Generator: generates values suitable for the device explorer on every tick.
  • Expression Value Filter: filters values suitable for the device explorer.
  • Arraygen: generates an array of values.
  • Arraymap: applies the function to each value of the input array.

ExprTK

These expressions are evaluated within score using the ExprTK library.

Write expressions on multiple lines in the process’s built-in editor. For the canonical syntax, variable scopes, functions and complete examples, see the ExprTK language reference.

Choose a value process for device-explorer values, an audio process for per-frame audio, Arraygen for a generated list, or Arraymap to transform an incoming list. Their available inputs and persistent variables differ; use the variable scope tables rather than assuming every binding is available everywhere.

Audio handling

Audio expressions process frames, with channels stored in arrays, and write to out. See audio handling and equivalent loop/vector examples.

Using arrays in ExprTK

Value processes distinguish scalar inputs (x, px, po) from array inputs (xv, pxv, pov). See array syntax, polar-coordinate conversion and Object filter unwrapping. Arraygen below is an alternative for generating arrays.

Using Arraygen

Arraygen

Arraygen will generate an array with as many elements as chosen. The expression will be used to generate each element. i represents the current element index, starting from zero and n is useable as the total count of elements.

Arraygen can also return arrays:

Arraygen used for arrays

Download the example score here.

Try this on web

Compare three related rhythms in Arraygen Signal Study. One expression uses each list element’s index to generate a different oscillation rate, and Signal display plots the results. Change the expression’s time multiplier to speed up or slow down all three together while preserving their rate relationships.

Using Arraymap

Arraymap

Arraymap applies the expression to every element used as input. The same variables are useable than for Arraygen, the only difference is that triggering is bound to the presence of an input value instead of the timeline.

Available variables

The complete variable reference lists time, controls, persistent memory, scalar and array inputs, audio outputs, sampling rate and array indices by process.

Available functions

See ExprTK and score-provided functions, including random and noise with parameter descriptions and examples.

Examples

The canonical expression examples preserve the Logistic, Noisify, Sine, Square, Wobbly and distortion expressions, together with links to all expression preset folders in the user library.

Go directly to a relocated section: