Skip to content

Functions

FunctionArgsResult
sin(x)1Sine of x (radians).
cos(x)1Cosine of x (radians).
abs(x)1Absolute value.
floor(x)1Largest integer ≤ x.
sqrt(x)1Square root. sqrt of a negative is NaN — guard it with select or max(x, 0).
log(x)1Natural logarithm (base e). Same posture as sqrt at the edges: log(0) is -inf and log(-1) is NaN — guard with select or max(x, tiny). There is no log10; divide by ln(10) = 2.302585. See Decibels.
min(a, b)2Smaller of a, b.
max(a, b)2Larger of a, b.
pow(base, exp)2base raised to exp. Shape a response curve: pow(bass * 8, 2) is punchier, pow(x, 0.5) gentler.
mod(a, b)2Floored modulo, a - b * floor(a / b). Divisor-signed, so mod(-0.2, 1.0) is 0.8 — it wraps cleanly for a cyclic hue or phase.
clamp(x, lo, hi)3x bounded to [lo, hi]. Total even if lo > hi.
lerp(a, b, t)3Linear blend a + (b - a) * t.
smoothstep(e0, e1, x)3Eased 0 → 1 ramp as x crosses e0 → e1 (0 below, 1 above). The easing primitive — smoother than clamp for a threshold.
select(cond, x, y)3x if cond != 0.0, else y. Only the taken branch is evaluated.
bin(x)1The spectrum at normalized position x (0 = lowest frequency, 1 = highest), interpolated between adjacent bands. See below.
hash(x)1A scattered value in [0, 1): neighbouring arguments give unrelated results. Seeded per preset — see below.
noise(x)1Smooth value noise in [0, 1]: a wander that changes over one unit of x. Seeded per preset — see below.

Calling a function with the wrong number of arguments, or referencing an unknown name, is a compile error — the preset is rejected at load and the app keeps the previous good set (it does not crash). Division by zero yields inf/NaN rather than panicking, but you should avoid it — a NaN parameter produces undefined-looking visuals.

Built from a8ce055 at version 0.115.0. This site tracks main and is not versioned per release.