Skip to main content

pan

Function pan 

Source
pub fn pan(p: f32, secs: f32, format: AudioFormat) -> Vec<f32>
Expand description

Broadband seeded noise panned to p, -1 hard left to +1 hard right — the stimulus a stereo quantity can be measured against (ADR-0215).

One waveform at two gains, L = (1 - p) / (1 + |p|) and R = (1 + p) / (1 + |p|), so the per-channel RMS ratio is algebraically p and the channels are perfectly correlated: balance reads p and spread reads 0, both as exact properties of the construction rather than as fitted numbers. Neither gain exceeds 1, so the peak stays inside the generator family’s ±0.9 headroom.

Broadband on purpose: the source is seeded noise rather than a chord, because a pan applied to everything has to read as a pan in every band, and a sum of three sines below 350 Hz leaves the treble band empty.