Skip to content
Русский

Eased parameters — the [smoothing] table

An optional top-level [smoothing] table low-passes chosen params so band- and beat-driven motion eases instead of snapping. Each entry is a time constant in seconds (a bare number, not an expression):

[smoothing]
zoom = 0.12 # a punchy pump that still eases
bg_bright = 0.3
hue = 0.4 # a slow, fluid hue drift

A param not listed is applied instantly; 0 also means no smoothing. The smoothing runs on real elapsed time, so it is identical at any refresh rate, and it resets on a preset switch (a switch snaps to the new preset’s first value). Validated non-negative and finite at load.

An eased value reaches its target exactly, but only after about ten to fifteen time constants. That matters for a parameter the engine floors — lsystem’s visible_depth, shape_collage’s count, parametric_curve’s samples: it takes its step only on arrival, so visible_depth = "3 + floor(clamp(onset * 2, 0, 1))" under a short [smoothing] constant draws generation 4 only if the onset is held until the ease arrives. On a transient the target is back at 3 first, and generation 4 never draws at all. A step that must land inside a transient targets the midpoint instead, 3.5 + floor(...), so the floored value crosses mid-glide.

Snap up, glide down — the { attack, release } form

One constant slows the rise exactly as much as it slows the fall, so a longer tau trades a jarring attack for a mushy one. An entry may instead name two constants, and the smoother picks by direction:

[smoothing]
hue = 0.4 # unchanged: symmetric, one constant
burst = { attack = 0.02, release = 0.7 } # snap up in ~2 frames, glide down over ~0.7 s

attack applies while the incoming value is above the held one, release while it is at or below. Both are validated the same way, and 0 on either side still means instant on that side — { attack = 0, release = 0.5 } is an instant hit with a slow decay. A scalar entry is exactly { attack = t, release = t }, so nothing about the existing form changed.

The price: a two-constant entry is no longer a low-pass, it is a rectifier. A direction-dependent time constant does not treat a rise and a fall alike, so under sustained material the output acquires a DC offset and rides above its input’s mean. That is the envelope-follower behaviour you are asking for on a percussive accent, and a surprise on anything continuous — a fast-attack hue will drift upward rather than tracking. Reach for the pair on things that should hit (burst, mirror_reflect, thickness on a beat); leave continuous params symmetric.

Built from 13c7582 at version 0.158.0. This site tracks main and is not versioned per release.