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>
impl<T: Transcendental> MoogLadder<T>
Sourcepub fn new(section: RcPole<T>, cutoff: T, resonance: T, sample_rate: T) -> Self
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.
Sourcepub fn update_coeffs(&mut self)
pub fn update_coeffs(&mut self)
Recalculate internal coefficients after parameter changes.
Sourcepub fn process_sample(&mut self, input: T) -> T
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.
Sourcepub fn set_cutoff(&mut self, cutoff: T)
pub fn set_cutoff(&mut self, cutoff: T)
Set the cutoff frequency, clamped to [20, sample_rate / 2].
Sourcepub fn set_resonance(&mut self, resonance: T)
pub fn set_resonance(&mut self, resonance: T)
Set the resonance factor, clamped to [0, 1].
Sourcepub fn set_sample_rate(&mut self, sample_rate: T)
pub fn set_sample_rate(&mut self, sample_rate: T)
Set the sample rate and recalculate coefficients.
Source§impl<T: Transcendental> MoogLadder<T>
impl<T: Transcendental> MoogLadder<T>
Sourcepub fn process_4_voices(&mut self, inputs: ScalarVector4<T>) -> ScalarVector4<T>
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>
impl<T: Transcendental> Algorithm<T> for MoogLadder<T>
Source§fn process(
&mut self,
input: Option<&[T]>,
output: &mut [T],
) -> ProcessResult<()>
fn process( &mut self, input: Option<&[T]>, output: &mut [T], ) -> ProcessResult<()>
Source§fn metadata(&self) -> AlgorithmMetadata
fn metadata(&self) -> AlgorithmMetadata
Source§fn apply_command(&mut self, _value: T)
fn apply_command(&mut self, _value: T)
Source§impl<T: Clone + Transcendental> Clone for MoogLadder<T>
impl<T: Clone + Transcendental> Clone for MoogLadder<T>
Source§fn clone(&self) -> MoogLadder<T>
fn clone(&self) -> MoogLadder<T>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more