Function synfx_dsp::process_stilson_moog
source · [−]pub fn process_stilson_moog(
input: f32,
freq: f32,
res: f32,
israte: f32,
b0: &mut f32,
b1: &mut f32,
b2: &mut f32,
b3: &mut f32,
delay: &mut [f32; 4]
) -> f32
Expand description
This function implements a simple Stilson/Moog low pass filter with 24dB. It provides only a low pass output.
input
- Input sample.freq
- Frequency in 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 (1.0 / 44100.0
).b0
tob3
- Internal values used for filtering.delay
- A buffer holding other delayed samples.
use synfx_dsp::*;
let samples = vec![0.0; 44100];
let mut b0 = 0.0;
let mut b1 = 0.0;
let mut b2 = 0.0;
let mut b3 = 0.0;
let mut delay = [0.0; 4];
let mut freq = 1000.0;
for s in samples.iter() {
let low =
process_stilson_moog(
*s, freq, 0.5, 1.0 / 44100.0,
&mut b0, &mut b1, &mut b2, &mut b3,
&mut delay);
// ... do something with the result here.
}