Skip to content

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.03

    Small coefficients (0.0080.08 in 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, noise says 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_dejong alone. That idiom still works and there is no need to go and rewrite it, but write new ones with noise: 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.6

    hash turns each integer into an unrelated number, which no sine sum can do.

  • Beat gate — add something only on beat frames:

    0.5 + beat * 0.8

    beat is 0 most frames and 1 on a beat, so this jumps by 0.8 on each beat.

  • Beat-phase breathing — a smooth ramp between beats:

    1.0 + bar * 0.25

    bar sweeps 0 → 1 between beats, so zoom eases up and resets each beat.

  • Soft thresholdsmoothstep where clamp would snap:

    smoothstep(0.15, 0.45, bass)

    A 0 → 1 ramp that eases in and out instead of cornering.

  • Cyclic wrap — keep a rotating value in one turn:

    mod(time * 0.2, 1.0)

    Floored mod never 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.