Struct PannerBlock

Source
pub struct PannerBlock<S>
where 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> PannerBlock<S>
where S: Sample,

Source

pub fn new(position: f64) -> PannerBlock<S>

Create a new stereo panner with the given position (-100 to +100).

Source

pub fn new_stereo(position: f64) -> PannerBlock<S>

Create a new stereo panner with the given position (-100 to +100).

Source

pub fn centered() -> PannerBlock<S>

Create a centered stereo panner.

Source

pub fn new_surround(layout: ChannelLayout) -> PannerBlock<S>

Create a surround panner for the given layout.

Supports Surround51 and Surround71 layouts. Uses VBAP (Vector Base Amplitude Panning) algorithm.

Source

pub fn new_ambisonic(order: usize) -> PannerBlock<S>

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.

Trait Implementations§

Source§

impl<S> Block<S> for PannerBlock<S>
where S: Sample,

Source§

fn process( &mut self, inputs: &[&[S]], outputs: &mut [&mut [S]], modulation_values: &[S], _context: &DspContext, )

Process audio through this block. Read more
Source§

fn input_count(&self) -> usize

Returns the number of input ports this block accepts.
Source§

fn output_count(&self) -> usize

Returns the number of output ports this block produces.
Source§

fn modulation_outputs(&self) -> &[ModulationOutput]

Returns the modulation outputs this block provides. Read more
Source§

fn channel_config(&self) -> ChannelConfig

Returns how this block handles multi-channel audio. Read more
Source§

fn set_smoothing(&mut self, sample_rate: f64, ramp_time_ms: f64)

Configure smoothing time for parameter changes. Read more
Source§

impl<S> From<PannerBlock<S>> for BlockType<S>
where S: Sample,

Source§

fn from(block: PannerBlock<S>) -> BlockType<S>

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<S> Freeze for PannerBlock<S>
where S: Freeze,

§

impl<S> RefUnwindSafe for PannerBlock<S>
where S: RefUnwindSafe,

§

impl<S> Send for PannerBlock<S>

§

impl<S> Sync for PannerBlock<S>

§

impl<S> Unpin for PannerBlock<S>
where S: Unpin,

§

impl<S> UnwindSafe for PannerBlock<S>
where S: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.