FOLD / OVERSAMPLE
Soft clip, measured.
A sine into a tanh clipper. 4× interpolates, clips, then decimates through a 32-tap Kaiser FIR. The audio thread does not allocate.
128-frame quantum · 1 ms worklet clock
EXPERIMENT
Oversampling versus aliasing
6 kHz sine, 44.1 kHz, drives ×1, ×8, and ×40. Alias energy is everything outside DC, 6 kHz, and 18 kHz. At 48 kHz those aliases would land back on the harmonics and hide.
AUDIT
Realtime safety
Silence, full-scale input, drive jumps, bypass toggles, then five minutes of high-drive 4× audio. The worklet has no sub-millisecond clock, so in-process time is an upper bound. Mean is wall-clock render time divided by quanta.
KERNEL
tanĥ(x) = x(27+x²)/(27+9x²), held at ±1 past ±3
4× uses a 32-tap Kaiser lowpass, β = 5, cutoff at Fs/8. Polyphase interpolation (gain 4), the clipper, then the same FIR keeps every fourth sample. Drive, output, and bypass ease through a 20 ms one-pole. Changing mode fades the wet path over 8 ms.