Spacing

Struct Spacing 

Source
pub struct Spacing<T: Float> {
Show 13 fields pub sample_rate: T, pub sources: Vec<Position<T>>, pub receivers: Vec<Position<T>>, pub paths: Vec<(usize, usize, Path<T>)>, pub delays: Vec<Delay<T, InterpolatorLinear<T>>>, pub room_size: T, pub damping: T, pub diff: T, pub bass: T, pub decay: T, pub cross: T, pub bass_filters: Vec<Biquad<T>>, pub cross_mixer: Option<Hadamard<T>>,
}
Expand description

Main Spacing effect struct

Fields§

§sample_rate: T§sources: Vec<Position<T>>§receivers: Vec<Position<T>>§paths: Vec<(usize, usize, Path<T>)>§delays: Vec<Delay<T, InterpolatorLinear<T>>>§room_size: T§damping: T§diff: T§bass: T§decay: T§cross: T§bass_filters: Vec<Biquad<T>>§cross_mixer: Option<Hadamard<T>>

Implementations§

Source§

impl<T: Float + FromPrimitive> Spacing<T>

Source

pub fn new(sample_rate: T) -> Self

Create a new Spacing effect with a given sample rate

Source

pub fn set_room_size(&mut self, size: T)

Set room size (scales all distances)

Source

pub fn set_damping(&mut self, damping: T)

Set damping (0 = no damping, 1 = max damping)

Source

pub fn set_diff(&mut self, diff: T)

Set diffusion amount

Source

pub fn set_bass(&mut self, bass: T)

Set bass boost/cut (dB)

Source

pub fn set_decay(&mut self, decay: T)

Set decay (0 = no decay, 1 = max decay)

Source

pub fn set_cross(&mut self, cross: T)

Set cross-mix (0 = none, 1 = max)

Source

pub fn add_source(&mut self, pos: Position<T>) -> usize

Add a source position

Source

pub fn add_receiver(&mut self, pos: Position<T>) -> usize

Add a receiver position

Source

pub fn add_path( &mut self, source_idx: usize, receiver_idx: usize, gain: T, extra_distance: T, )

Add a path (direct or reflection) between a source and receiver

Source

pub fn clear_paths(&mut self)

Clear all paths and delays

Source

pub fn process(&mut self, inputs: &[&[T]], outputs: &mut [Vec<T>])

Process a buffer for all receivers (multi-source, multi-output)

Auto Trait Implementations§

§

impl<T> Freeze for Spacing<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Spacing<T>
where T: RefUnwindSafe,

§

impl<T> Send for Spacing<T>
where T: Send,

§

impl<T> Sync for Spacing<T>
where T: Sync,

§

impl<T> Unpin for Spacing<T>
where T: Unpin,

§

impl<T> UnwindSafe for Spacing<T>
where T: 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.