@maruaudio/dsp/distortion/taper is a stereo tape processor: a companding encode, a flutter fractional delay, a golden-ratio bias slew, a mid/sub split with a sine-shaped low band, two head-bump band-pass resonators, the matching decode and a soft clip. Coefficients scale by sampleRate / 44100; fixed PRNG seeds make renders repeatable, and dither is left to the engine.
Parameters
cookTaperNodeInto(state, target, input, tilt, shape, flutter, flutterSpeed, bias, headBump, headFrequency, output) clamps nine controls to 0 to 1 into a TaperCooked record and writes the bias slew and head-bump filters to state.
| Control | Cooked as |
|---|---|
input | Gain (2 × input)² |
tilt | Encode amount 2 × tilt; decode max(−1, −2 × (1 − tilt)) |
shape | Encode, decode and mid split frequencies |
flutter, flutterSpeed | Depth flutter⁶ × 50 × scale (at most 498 samples); rate 0.02 × speed³ / scale |
bias | Signed 2 × bias − 1: under-bias below 0.5, over-bias slew above |
headBump, headFrequency | Bump drive and mix; resonators at 25 + 175 × f² Hz and 0.9375 × that |
output | Gain 2 × output |
Lifecycle
initTaperNode(rate) allocates the 1002-sample delays, slew table and clip history → prepareTaperNodeSampleRate re-stamps the rate and clears history, so recook afterwards → cook → taperNodeTick(state, left, right, cooked) → taperNodeOutputLeft and taperNodeOutputRight → resetTaperNode outside realtime. clearTaperNodeStep (≤ 256 stores, done at taperClearStoreCount) and finalizeTaperNodeClear clear it live, keeping the head coefficients.
When to use it
Tape-style saturation, flutter and head bump on a stereo bus, drums or a mix.
Limits
- Stereo in and out; the output lags the input by one sample (clip stage).
cookTaperNodeallocates a record; usecookTaperNodeIntoin realtime code. The clamps are the kernel node's conditional clamp.