The filter of a voice (Audio.filter) or a bus (AudioBus.filter). Its fields are live: cutoff and resonance glide over 10 ms, and a kind change crossfades over 20 ms while any cutoff_to carries on. They read nil once the filter or its owner is gone.
The response; a change crossfades over 20 ms with no state reset.
cutoff
number?
read/write
Cutoff (or centre) frequency in Hz as heard, at any pitch, clamped to 20..min(20000, 0.45 x the sample rate).
resonance
number?
read/write
0 is a flat passband; 1 is about +26 dB at the cutoff and never self-oscillates. Clamped to 0..1.
Methods 1
AudioFilter:cutoff_to
method
AudioFilter:cutoff_to(hz: number,seconds: number)
Ramp the cutoff to hz in equal ratios over seconds of played sound, sample-exact; assigning cutoff cancels the ramp, and a seconds of 0 or less is an assignment.
Example
-- Open from 200 Hz to 4000 Hz over 3 seconds, rising the same number-- of octaves every second.
filter:cutoff_to(4000, 3)