@maruaudio/dsp/modulation/stereo-auto-panner moves an existing stereo pair with one shared sine LFO. It keeps the state, rate, depth and position of @maru/modulation-auto-panner and maps the position to a bipolar pan (pan = 2 × position − 1), applied through the Web Audio StereoPannerNode stereo-input balance law of @maru/mixing-constant-power-pan. At centre the stereo image passes through, rather than each channel being panned as its own mono source.
const state = initStereoAutoPannerNode(48000)
setStereoAutoPannerRate(state, 2)
stereoAutoPannerNodeTick(state, left, right)
// state.outLeft, state.outRightParameters
| Setter | Range the setter enforces | Default |
|---|---|---|
setStereoAutoPannerRate | 0.01 to 20 Hz | 1 Hz |
setStereoAutoPannerDepth | 0 to 1 | 1 |
Neither setter restarts the phase.
Lifecycle
initStereoAutoPannerNode → setters → stereoAutoPannerNodeTick, reading outLeft and outRight → resetStereoAutoPannerNode, which restarts the LFO and keeps rate and depth. The state is scalar: no audio history, tail or latency. Ticks allocate nothing and do no I/O.
When to use it
Moving a stereo bus, a stereo synth or a stereo return from side to side without collapsing it to mono first.
Limits
- Stereo in, stereo out, one frame per tick.
- At pan exactly 0, including depth 0, the output is the input pair unchanged, bypassing the shared law's tiny centre crossfeed.
- Outputs are raw doubles; the downstream processor rounds to f32.
- At a pan extreme correlated input sums into one channel, so the level there can exceed either input channel.