CC Filter
One-pole low-pass filter whose cutoff is steered by an incoming MIDI CC (default CC74, the standard "brightness" controller).
Source: examples/truce-example-cc-filter/.
#What it demonstrates
- Audio effect that consumes MIDI (
midi_input = trueintruce.toml; on AU this registers the component as anaumfMusicEffect so hosts actually route MIDI to it) - Handling
EventBody::ControlChangeevents inprocess()to steer DSP state - Declarative host MIDI mapping via
midi_cc = 74on a#[param(...)]attribute - Logarithmic parameter range (
range = "log(20, 20000)") with exponential smoothing (smooth = "exp(10)") - f64 DSP state (per-channel one-pole
z1) cast to f32 only at the output boundary
#Parameters
| Name | Range | Unit | Description |
|---|---|---|---|
| Cutoff | 20 to 20000 (log) | Hz | Cutoff used before any CC arrives; incoming CC overrides it |
| CC | 0 to 127 | -- | CC number that steers the cutoff |