@audio/spatial-autopan
v1.1.3
Published
Auto-panner — LFO-driven stereo panning. Constant-power cos/sin law
Readme
@audio/spatial-autopan

Auto-panner — LFO-driven stereo panning. Constant-power cos/sin law
npm install @audio/spatial-autopanimport autoPanner from '@audio/spatial-autopan'Collapses the input to mono (mid) each sample, then sweeps it between speakers with a sine LFO through the same constant-power cos/sin law as spatial-panner. Modifies left/right in place; sweep phase is carried on params._phase across calls.
autoPanner(left, right, { rate: 0.5, depth: 1 }) // both modified in place| Param | Default | |
|---|---|---|
| rate | 0.5 | Sweep speed, Hz (0.01–20) |
| depth | 1 | Sweep excursion, 0 (center) – 1 (full L/R) |
| fs | 44100 | Sample rate |
Use when: tremolo-style auto-pan; the sweep is continuous across blocks — reuse the same params object per instance.
Part of @audio/spatial — the spatial family umbrella.
MIT © audiojs
