pub fn process_hal_chamberlin_svf(
    input: f32,
    freq: f32,
    res: f32,
    israte: f32,
    band: &mut f32,
    low: &mut f32
) -> (f32, f32)
Expand description

Process a HAL Chamberlin filter with two delays/state variables that is 12dB. The filter does internal oversampling with very simple decimation to rise the stability for cutoff frequency up to 16kHz.

  • input - Input sample.
  • freq - Frequency in Hz. Please keep it inside 0.0 to 16000.0 Hz! otherwise the filter becomes unstable.
  • res - Resonance from 0.0 to 0.99. Resonance of 1.0 is not recommended, as the filter will then oscillate itself out of control.
  • israte - 1.0 divided by the sampling rate (eg. 1.0 / 44100.0).
  • band - First state variable, containing the band pass result after processing.
  • low - Second state variable, containing the low pass result after processing.

Returned are the results of the high and notch filter.

    use synfx_dsp::*;

    let samples  = vec![0.0; 44100];
    let mut band = 0.0;
    let mut low  = 0.0;
    let mut freq = 1000.0;

    for s in samples.iter() {
        let (high, notch) =
            process_hal_chamberlin_svf(
                *s, freq, 0.5, 1.0 / 44100.0, &mut band, &mut low);
        // ... do something with the result here.
    }