Idioms (patterns from the curated set)
-
Gain-then-bound — turn a small raw band into a usable range:
clamp(bass * 14, 0, 1.8)Multiply the raw band up, then clamp so a loud passage can’t blow the parameter out. Nearly every reactive binding is a variant of this.
On a luminance parameter —
brightness,glow,flash— the composite carries light past 1.0 and an engine tonemap rolls it off with the hue intact, so overshooting is a soft loss of contrast rather than a cliff. Keep the clamp anyway: what it buys is that the peak stays proportionate to the rest of the frame, and it is the difference between a beat that reads as the music and one that reads as a camera flash. See the additive-ceiling note in Parameter roster. -
Baseline + reactive — a resting value plus an audio-driven add:
0.4 + clamp((bass + mid) * 8, 0, 1.1)The constant is what you see in silence; the clamped term is the reaction.
-
Slow drift — a parameter that wanders on its own:
time * 0.03Small coefficients (
0.008–0.08in the library) set how fast a hue rotates. That is a ramp, though — it only ever goes one way. For a drift that genuinely wanders,noisesays it in one call:noise(time * 0.3)Presets in this library used to fake that with a sum of detuned sines — four of them, with periods chosen not to line up, in
attractor_dejongalone. That idiom still works and there is no need to go and rewrite it, but write new ones withnoise: it is one term instead of four, and it has no period at all rather than a very long one. -
Per-beat variety — something different on each beat, not merely louder:
0.4 + hash(floor(time * 2)) * 0.6hashturns each integer into an unrelated number, which no sine sum can do. -
Beat gate — add something only on beat frames:
0.5 + beat * 0.8beatis0most frames and1on a beat, so this jumps by0.8on each beat. -
Beat-phase breathing — a smooth ramp between beats:
1.0 + bar * 0.25barsweeps0 → 1between beats, sozoomeases up and resets each beat. -
Soft threshold —
smoothstepwhereclampwould snap:smoothstep(0.15, 0.45, bass)A
0 → 1ramp that eases in and out instead of cornering. -
Cyclic wrap — keep a rotating value in one turn:
mod(time * 0.2, 1.0)Floored
modnever returns a negative, so a hue driven this way never jumps. -
Two-mode preset — one file that behaves differently by energy or tempo:
select(tempo > 130, 1 + bass * 3, 1 + bass * 0.6)
Built from a8ce055 at version 0.115.0. This site tracks main and is not versioned per release.