BlepStereo

Struct BlepStereo 

Source
pub struct BlepStereo<B: Blep> {
    pub mono_filter: B::SampleDelta,
    pub blep: B,
}
Expand description

A wrapper Blep implementation that redirects extra channels to a stereo Blep as a monophonic channel.

Requires a downstream Blep implementation that provides at least 2 audio channels.

BlepStereo channel      Blep impl channel
    0 -----------------------> 0
    1 -----------------------> 1
 >= 2 ---- * mono_filter ----> 0
                         \---> 1

Fields§

§mono_filter: B::SampleDelta

A monophonic filter value in the range [0.0, 1.0] (floats) or [0, int::max_value()] (integers).

§blep: B

A downstream Blep implementation.

Implementations§

Source§

impl<B: Blep> BlepStereo<B>

Source

pub fn build(mono_filter: B::SampleDelta) -> impl FnOnce(B) -> Self

Source

pub fn new(mono_filter: B::SampleDelta, blep: B) -> Self

Trait Implementations§

Source§

impl<B> Blep for BlepStereo<B>

Source§

type SampleDelta = <B as Blep>::SampleDelta

A type for sample ∆ amplitudes (pulse height).
Source§

fn ensure_frame_time( &mut self, sample_rate: u32, ts_rate: f64, frame_ts: FTs, margin_ts: FTs, )

This method allows the Blep implementation to reserve enough memory for the audio frame with an additional margin and to set up a sample time rate and other internals. Read more
Source§

fn end_frame(&mut self, timestamp: FTs) -> usize

Finalizes audio frame. Read more
Source§

fn add_step(&mut self, channel: usize, timestamp: FTs, delta: B::SampleDelta)

This method is being used to add square-wave pulse steps within a boundary of a single frame. Read more
Source§

impl<B: Blep> Deref for BlepStereo<B>

Source§

type Target = B

The resulting type after dereferencing.
Source§

fn deref(&self) -> &B

Dereferences the value.
Source§

impl<B: Blep> DerefMut for BlepStereo<B>

Source§

fn deref_mut(&mut self) -> &mut B

Mutably dereferences the value.

Auto Trait Implementations§

§

impl<B> Freeze for BlepStereo<B>
where <B as Blep>::SampleDelta: Freeze, B: Freeze,

§

impl<B> RefUnwindSafe for BlepStereo<B>

§

impl<B> Send for BlepStereo<B>
where <B as Blep>::SampleDelta: Send, B: Send,

§

impl<B> Sync for BlepStereo<B>
where <B as Blep>::SampleDelta: Sync, B: Sync,

§

impl<B> Unpin for BlepStereo<B>
where <B as Blep>::SampleDelta: Unpin, B: Unpin,

§

impl<B> UnwindSafe for BlepStereo<B>

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<S, T> IntoSample<S> for T
where S: FromSample<T>,

Source§

fn into_sample(self) -> S

Convert to S a sample type from self.
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.