Skip to main content

pan_gains

Function pan_gains 

Source
pub fn pan_gains(pan: f64) -> (f64, f64)
Expand description

The left and right gains of a pan position pan (stored -1 to 1).

The law is sqrt(2) * sin(2 pi (1/8 -+ pan/8)), so the centre gives 1 on both channels. The engine uses a polynomial sine, so its gains differ from these by up to about 5e-3.