Skip to main content

MoogLadder

Struct MoogLadder 

Source
pub struct MoogLadder<T: Transcendental> {
    pub poles: [RcPole<T>; 4],
    /* private fields */
}
Expand description

Cascaded WDF filter made of identical sections.

The params fields are filter coefficients; state fields hold per-sample persistent state (e.g. feedback_prev).

Fields§

§poles: [RcPole<T>; 4]

Array of WDF sections connected in series.

Implementations§

Source§

impl<T: Transcendental> MoogLadder<T>

Source

pub fn new(section: RcPole<T>, cutoff: T, resonance: T, sample_rate: T) -> Self

Create a new cascaded filter from a prototype section and initial parameters.

Source

pub fn update_coeffs(&mut self)

Recalculate internal coefficients after parameter changes.

Source

pub fn process_sample(&mut self, input: T) -> T

Process one input sample and return the output sample.

The signal passes through each WDF section in sequence.

Source

pub fn cutoff(&self) -> T

Return the current cutoff frequency.

Source

pub fn set_cutoff(&mut self, cutoff: T)

Set the cutoff frequency, clamped to [20, sample_rate / 2].

Source

pub fn resonance(&self) -> T

Return the current resonance factor.

Source

pub fn set_resonance(&mut self, resonance: T)

Set the resonance factor, clamped to [0, 1].

Source

pub fn set_sample_rate(&mut self, sample_rate: T)

Set the sample rate and recalculate coefficients.

Source

pub fn reset(&mut self)

Reset all WDF section state and the feedback sample.

Source§

impl<T: Transcendental> MoogLadder<T>

Source

pub fn process_4_voices(&mut self, inputs: ScalarVector4<T>) -> ScalarVector4<T>

Process 4 independent voices via ScalarVector4.

Each lane of the input vector represents one voice; each lane of the output vector is the corresponding filtered sample. Reduces function-call overhead in polyphonic synthesis.

Trait Implementations§

Source§

impl<T: Transcendental> Algorithm<T> for MoogLadder<T>

Source§

fn init(&mut self, sample_rate: f32)

Initialise the algorithm with a sample rate. Read more
Source§

fn reset(&mut self)

Reset the algorithm to its initial state. Read more
Source§

fn process( &mut self, input: Option<&[T]>, output: &mut [T], ) -> ProcessResult<()>

Process one block of signal. Read more
Source§

fn metadata(&self) -> AlgorithmMetadata

Descriptive metadata (defaults to empty).
Source§

fn apply_command(&mut self, _value: T)

Receive a real-time command value from the control path. Read more
Source§

impl<T: Clone + Transcendental> Clone for MoogLadder<T>

Source§

fn clone(&self) -> MoogLadder<T>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug + Transcendental> Debug for MoogLadder<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Transcendental> WdfElement<T> for MoogLadder<T>

Source§

fn port_resistance(&self) -> T

Port resistance
Source§

fn process_incident(&mut self, a: T) -> T

Process incident wave, return reflected wave
Source§

fn update_state(&mut self)

Update internal state (called after wave computation)
Source§

fn voltage(&self) -> T

Current voltage across the element
Source§

fn current(&self) -> T

Current current through the element
Source§

fn reset(&mut self)

Reset to initial state

Auto Trait Implementations§

§

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

§

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

§

impl<T> Send for MoogLadder<T>

§

impl<T> Sync for MoogLadder<T>

§

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

§

impl<T> UnsafeUnpin for MoogLadder<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for MoogLadder<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> AsAny for T
where T: 'static,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert to &dyn std::any::Any
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert to &mut dyn std::any::Any
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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V