@maruaudio/dsp/dynamics/follower-limiter is the CHOMPI firmware's peak-follower limiter, an extension of the stmlib Limiter. An asymmetric one-pole slope follower tracks |x| (coefficient 0.05 rising, 0.0004 falling); the gain is 1/peak above 1, else 1; the result goes through the rational soft limit x(27 + x²)/(27 + 9x²). A compressor path and a hard clamp follow the firmware. All arithmetic is f32 in firmware order, including the (9·x)·x association.
const state = initFollowerLimiterNode() // TAPE trim 0.7
const y = followerLimiterProcess(state, x)Parameters
There are no setters: the trim goes to init, compressor controls to each call.
| Argument | Range as coded | Default | Unit |
|---|---|---|---|
initFollowerLimiterNode(trim) | FOLLOWER_LIMITER_TRIM_TAPE (0.7) or TRIM_NONE (1); any number, rounded to f32 | 0.7 | linear |
followerLimiterProcessComp(state, x, preGain, threshold, ratio, makeup) | Not clamped; target gain 1/(ratio·(1 + peak − threshold)) above threshold, approached with coefficient 0.001 rising and 0.005 falling | — | linear |
Lifecycle
initFollowerLimiterNode (peak 0.5, comp gain 0) → one of followerLimiterProcess, followerLimiterProcessComp or followerLimiterProcessHard per sample → resetFollowerLimiterNode, which restores the peak to 0.5 and the comp gain to 0 and keeps the trim. The comp path's follower falls with coefficient 0.0002.
When to use it
Keeping a firmware-matched output stage or feedback loop near unity: the soft path for musical limiting, the hard path where the output must stay in ±1.
Limits
- Mono sample tick. Coefficients are per sample, so timing scales with the rate (the firmware runs at 48 kHz). The comp gain starts at 0, as in the zero-initialized firmware. The hard clamp maps NaN to −1, like DaisySP
fclamp.