Skip to content

Add ConvolutionFilter and High/Low DSP filter types - #319

Merged
maximmaxim345 merged 5 commits into
mainfrom
add-convolution-dsp
Jul 23, 2026
Merged

maximmaxim345 merged 5 commits into
mainfrom
add-convolution-dsp

Conversation

@OzGav

@OzGav OzGav commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

This PR adds two new filter types following the existing filter models

The convolution (impulse response) filter carries an ir_id referencing a server-stored impulse response file and a gain output trim in dB, validated -60 to 60 the same as GainFilter. The server resolves ir_id to a file at playback time; this model only carries the reference and the trim.

The high-pass / low-pass filter carries a mode toggle (high_pass or low_pass), a cutoff frequency in Hz, and a slope in dB/octave, validated to 20–20000 Hz with slope restricted to 12, 24, or 48. A single type covers both directions via the mode field. Resonance/Q is intentionally omitted that's what the Parametric EQ is for; the server derives per-stage Butterworth Q from the slope and cascades biquads to realise the steeper rolloffs. This model only carries the cutoff, direction, and slope.

Adds a convolution (impulse response) filter, following the existing
filter models. It carries an ir_id referencing a server-stored impulse
response file and a gain output trim in dB, validated -60 to 60 the same
as GainFilter. The server resolves ir_id to a file at playback time; this
model only carries the reference and the trim.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AUR7Pf5Kusno8MSfT2Fgod
@OzGav OzGav added the enhancement Enhancement of an existing feature/functionality label Jul 20, 2026
Adds a high-pass / low-pass filter with a mode toggle, cutoff frequency,
and selectable 12/24/48 dB/octave slope. Validation enforces a 20-20000 Hz
cutoff and the discrete slope set. Registered on DSPFilterType and the
DSPFilter union, with construction, validation, and round-trip tests.
@OzGav OzGav changed the title Add ConvolutionFilter DSP filter type Add ConvolutionFilter and High/Low DSP filter types Jul 21, 2026
Comment thread music_assistant_models/dsp.py Resolved
Comment thread music_assistant_models/dsp.py Resolved
Only 12, 24 and 48 dB/octave are allowed, so model them as a
HighLowPassSlope IntEnum instead of a plain int. The wire format is
unchanged (still a bare int), and the exact type check in validate()
now also rejects floats, which mashumaro would otherwise serialize
back out as floats.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01K2FbbLYP9Ex32Z7gsEZpWc

@maximmaxim345 maximmaxim345 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!
Thanks @OzGav !

@maximmaxim345
maximmaxim345 merged commit e2b41fa into main Jul 23, 2026
3 checks passed
@maximmaxim345
maximmaxim345 deleted the add-convolution-dsp branch July 23, 2026 20:54
github-actions Bot pushed a commit to music-assistant/server that referenced this pull request Jul 23, 2026
Update music-assistant-models to version
[1.1.169](https://github.com/music-assistant/models/releases/tag/1.1.169)


- Add setup flow primitives (by @marcelveldt in
[#324](music-assistant/models#324))

## 🚀 Features and enhancements

- Add ConvolutionFilter and High/Low DSP filter types (by @OzGav in
[#319](music-assistant/models#319))


## 🙇 Contributors

@marcelveldt, @OzGav and @claude

Co-authored-by: marcelveldt <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Enhancement of an existing feature/functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants