Skip to content

feat: adjustable filter slopes (12/24/48 dB/oct)#33

Merged
ealtun21 merged 5 commits into
masterfrom
feat/filter-slopes
Jul 1, 2026
Merged

feat: adjustable filter slopes (12/24/48 dB/oct)#33
ealtun21 merged 5 commits into
masterfrom
feat/filter-slopes

Conversation

@ealtun21

@ealtun21 ealtun21 commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Adjustable filter slopes (12/24/48 dB/oct)

Shelf + high/low-pass bands gain a selectable slope (roadmap "Adjustable filter slopes"). Peaking/Notch/BandPass/AllPass stay single-biquad and ignore it.

DSP

ApoFilter keeps its head biquad + an extra: Vec<BiquadFilter> cascade (empty at 12 dB/oct, so the common path is byte-identical to before). 24/48 dB/oct cascade Butterworth sections using the exact per-section pole-Q tables — the −3 dB point stays exactly at Fc, and shelves split their gain across sections so the pass-band gain is unchanged. New .slope_db_oct() builder + ApoFilter::set_slope.

Reach

  • IPC: BandState.slope_db_oct + Command::SetBandSlope + BandType::uses_slope() + next_slope_db_oct().
  • daemon: AudioCommand::SetBandSlope, handler, snapshot, Profile toml persistence.
  • Windows APO: FilterSnapshot.slope_db_oct.
  • CLI band-slope <index> <12|24|48> + slope in status; GUI per-band Slope dropdown (gated to shelf/HP/LP); TUI S key cycles slope + Type column shows it.

Tests

12 dB bit-exact vs the single biquad (regression); LP/HP rejection ≈ −12/−24/−48 dB one octave past Fc; −3 dB at Fc for all orders; shelf reaches full gain; slope ignored for peaking. Native profile round-trips the slope through TOML; APO .txt has no portable slope token (documented — native-profile only).

Verification (all three surfaces)

  • Linux: make check (fmt + clippy -D warnings + test --all) EXIT=0. Live daemon smoke on real PipeWire: loaded a 3-band APO, band-slope 1 24 → shelf shows "24 dB/oct", band-slope 2 48 → "48 dB/oct", peaking band shows no slope (gated).
  • macOS (M2): cargo test --all + cargo clippy --all-targets clean.
  • Windows VM: full workspace tests green (dsp 123, daemon 38, ipc 28, preset 31, gui/tui …); resonance-apo FFI harness passes single-threaded (22/22, as designed).

12 dB/oct is the default, so existing presets/profiles are unchanged.

ealtun21 added 5 commits July 1, 2026 06:44
Shelves + HP/LP bands gain a selectable slope. 12 dB/oct is the original
single biquad (bit-exact regression); 24/48 dB/oct cascade Butterworth
sections using the exact per-section pole-Q tables, keeping the -3 dB point
at Fc and splitting shelf gain across sections. Peaking/Notch/BandPass/
AllPass are single-biquad and ignore the slope.

- ApoFilter keeps its head biquad + an 'extra' section cascade (empty at
  12 dB/oct, so the common path is byte-identical). New builder .slope_db_oct
  + ApoFilter::set_slope.
- Wired through IPC (BandState.slope_db_oct + Command::SetBandSlope), the
  daemon (AudioCommand::SetBandSlope, handler, snapshot, Profile toml
  persistence) and the Windows APO FilterSnapshot.
- Tests: 12 dB bit-exact vs single biquad; LP/HP rejection ~12/24/48 dB one
  octave past Fc; -3 dB at Fc for all orders; shelf reaches full gain; slope
  ignored for peaking.
add BandType::uses_slope() (true for shelves + HP/LP) and
next_slope_db_oct() (12->24->48->12) so the front-ends gate and
cycle the per-band filter slope consistently.
add `resonance band-slope <index> <12|24|48>` -> SetBandSlope
(1-based index, value validated). status now prints the slope for
shelf/HP/LP bands (e.g. `24 dB/oct`); single-biquad types omit it.
add a 12/24/48 db/oct slope dropdown in the bands table next to the
type badge. shown only for shelf/hp/lp bands (single-biquad types get
a dim placeholder); sends SetBandSlope on change. new Slope column
collapses one width tier before the Type combo.
add `S` to cycle the selected band's filter slope 12->24->48 (shelf/
hp/lp only; single-biquad types get a status hint). the Type column
now shows the slope for those bands (e.g. `LS 24`); help overlay +
footer document the key.
@ealtun21 ealtun21 merged commit 0dbb4ca into master Jul 1, 2026
@ealtun21 ealtun21 deleted the feat/filter-slopes branch July 2, 2026 03:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant