Functions
| Function | Args | Result |
|---|---|---|
sin(x) | 1 | Sine of x (radians). |
cos(x) | 1 | Cosine of x (radians). |
abs(x) | 1 | Absolute value. |
floor(x) | 1 | Largest integer ≤ x. |
sqrt(x) | 1 | Square root. sqrt of a negative is NaN — guard it with select or max(x, 0). |
log(x) | 1 | Natural 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) | 2 | Smaller of a, b. |
max(a, b) | 2 | Larger of a, b. |
pow(base, exp) | 2 | base raised to exp. Shape a response curve: pow(bass * 8, 2) is punchier, pow(x, 0.5) gentler. |
mod(a, b) | 2 | Floored 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) | 3 | x bounded to [lo, hi]. Total even if lo > hi. |
lerp(a, b, t) | 3 | Linear blend a + (b - a) * t. |
smoothstep(e0, e1, x) | 3 | Eased 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) | 3 | x if cond != 0.0, else y. Only the taken branch is evaluated. |
bin(x) | 1 | The spectrum at normalized position x (0 = lowest frequency, 1 = highest), interpolated between adjacent bands. See below. |
hash(x) | 1 | A scattered value in [0, 1): neighbouring arguments give unrelated results. Seeded per preset — see below. |
noise(x) | 1 | Smooth 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.