pub struct PannerBlock<S: Sample> {
pub position: Parameter<S>,
pub azimuth: Parameter<S>,
pub elevation: Parameter<S>,
/* private fields */
}Expand description
A spatial panning block supporting stereo, surround, and ambisonic formats.
§Stereo Mode
Position ranges from -100 (full left) to +100 (full right). Uses constant-power pan law for smooth transitions.
§Surround Mode
Uses Vector Base Amplitude Panning (VBAP) with azimuth and elevation. Supports 5.1 and 7.1 speaker layouts.
§Ambisonic Mode
Encodes mono input to SN3D normalized, ACN ordered B-format. Supports 1st through 3rd order (4, 9, or 16 channels).
Fields§
§position: Parameter<S>Pan position: -100 (left) to +100 (right). Used in stereo mode.
azimuth: Parameter<S>Source azimuth in degrees (-180 to +180). Used in surround/ambisonic modes. 0 = front, 90 = left, -90 = right, 180/-180 = rear.
elevation: Parameter<S>Source elevation in degrees (-90 to +90). Used in surround/ambisonic modes. 0 = horizon, 90 = above, -90 = below.
Implementations§
Source§impl<S: Sample> PannerBlock<S>
impl<S: Sample> PannerBlock<S>
Sourcepub fn new(position: f64) -> Self
pub fn new(position: f64) -> Self
Create a new stereo panner with the given position (-100 to +100).
Sourcepub fn new_stereo(position: f64) -> Self
pub fn new_stereo(position: f64) -> Self
Create a new stereo panner with the given position (-100 to +100).
Sourcepub fn new_surround(layout: ChannelLayout) -> Self
pub fn new_surround(layout: ChannelLayout) -> Self
Create a surround panner for the given layout.
Supports Surround51 and Surround71 layouts.
Uses VBAP (Vector Base Amplitude Panning) algorithm.
Sourcepub fn new_ambisonic(order: usize) -> Self
pub fn new_ambisonic(order: usize) -> Self
Create an ambisonic encoder for the given order (1-3).
- Order 1: First-order ambisonics (4 channels: W, Y, Z, X)
- Order 2: Second-order ambisonics (9 channels)
- Order 3: Third-order ambisonics (16 channels)
Uses SN3D normalization and ACN channel ordering.