An open API service indexing awesome lists of open source software.

https://github.com/kidoz/foo-dsp-speaker-range

foobar2000 DSP component that crops audio to a loudspeaker's reproducible range: Linkwitz-Riley 4th-order high-pass/low-pass with Vicanek matched (decramped) biquads.
https://github.com/kidoz/foo-dsp-speaker-range

audio audio-filter audio-processing biquad cpp23 crossover dsp foobar2000 foobar2000-component linkwitz-riley meson msvc windows

Last synced: 3 days ago
JSON representation

foobar2000 DSP component that crops audio to a loudspeaker's reproducible range: Linkwitz-Riley 4th-order high-pass/low-pass with Vicanek matched (decramped) biquads.

Awesome Lists containing this project

README

          

# foo_dsp_speaker_range

[![Language: C++23](https://img.shields.io/badge/language-C%2B%2B23-00599C.svg)](https://isocpp.org/)
[![Build system: Meson](https://img.shields.io/badge/build%20system-Meson-00ADD8.svg)](https://mesonbuild.com/)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
[![Version: 0.2.3](https://img.shields.io/badge/version-0.2.3-informational.svg)](meson.build)

`foo_dsp_speaker_range` is a foobar2000 DSP component for Windows x64. It adds `Speaker Range Crop`,
a configurable Linkwitz-Riley 4th-order high-pass/low-pass filter intended to limit playback to a
loudspeaker's reproducible range.

The filter sections use Vicanek matched (decramped) coefficients instead of bilinear-transform
designs, so the magnitude response stays close to the analog Linkwitz-Riley prototype near
Nyquist. In practice this means a 20 kHz low-pass stays active and tracks the intended response at
44.1 kHz, where bilinear/RBJ-style low-pass biquads cramp toward their forced null at Nyquist. The
DSP uses causal IIR filters with no lookahead and reports zero processing latency to foobar2000.
Reference: M. Vicanek, "Matched Second Order Digital Filters" (2016),
.

## About The Plugin

`Speaker Range Crop` is intended for playback systems where the loudspeaker has a known useful
frequency range. Instead of boosting missing bass or treble, it removes content outside that range:
sub-bass below the speaker's low cutoff and ultrasonic/high-treble content above the high cutoff.

The DSP exposes two independent filters:

| Setting | Range | Default | Notes |
| --- | ---: | ---: | --- |
| Low cutoff high-pass | 10 to 1000 Hz | 58 Hz | Removes content below the selected speaker range. |
| High cutoff low-pass | 1.0 to 24.0 kHz | 20.0 kHz | Removes content above the selected speaker range. |

Each side can be enabled or disabled independently. The default preset is `Wharfedale Super Denton`;
editing any cutoff value switches the preset selector to `Custom`.

For multichannel audio, channels marked as LFE by foobar2000 keep their low-frequency content: the
high-pass side is bypassed for LFE while the low-pass side still follows the selected settings.

Built-in presets:

| Preset | Low cutoff | High cutoff | Filters |
| --- | ---: | ---: | --- |
| Wharfedale Super Denton | 58 Hz | 20.0 kHz | High-pass and low-pass enabled |
| Wharfedale Denton 85 | 45 Hz | 20.0 kHz | High-pass and low-pass enabled |
| Full range / bypass | 10 Hz | 24.0 kHz | Both filters disabled |
| Small bookshelf (generic) | 80 Hz | 20.0 kHz | High-pass and low-pass enabled |
| Vintage radio (generic) | 150 Hz | 7.0 kHz | High-pass and low-pass enabled |
| Custom | User value | User value | User controlled |

After installation, the DSP appears in foobar2000 under:

```text
Preferences -> Playback -> DSP Manager -> Speaker Range Crop
```

## Prerequisites

- foobar2000 2.25+ x64.
- Visual Studio 2022 Build Tools with the MSVC v143 toolchain.
- Meson and Ninja.
- `clang-format` and `clang-tidy` for local quality checks.
- foobar2000 SDK 2024-12-03 or newer. The current wrap points at SDK 2025-03-07 from
.

## SDK Setup

The normal shortcut flow uses the Meson wrap metadata under `subprojects/`. Because the official SDK archive is
distributed as `.7z` and Meson 1.11 cannot unpack that archive format directly on this machine, `just setup`
prepares `subprojects/fb2k-sdk` with `7z` before configuring Meson with `-Dsdk_path=wrap`.

```powershell
just setup
```

For manual SDK placement instead, extract the SDK under `third_party/fb2k-sdk` and pass that path explicitly:

```powershell
New-Item -ItemType Directory -Force third_party | Out-Null
Invoke-WebRequest https://www.foobar2000.org/downloads/SDK-2025-03-07.7z -OutFile third_party/SDK-2025-03-07.7z
7z x third_party/SDK-2025-03-07.7z -othird_party/fb2k-sdk -y
meson setup build --vsenv -Dsdk_path=third_party/fb2k-sdk
```

The SDK archive hash used by `subprojects/fb2k-sdk.wrap` is:

```text
ccda3c5840e66e0e28a7e4fe36407c4e78581aa30c40c362a188fcbaae799a3e
```

Meson wrap metadata and packagefiles are under `subprojects/`; the extracted SDK and downloaded archives under
`subprojects/fb2k-sdk` and `subprojects/packagecache` are local build artifacts and are ignored by git.

Unit tests use [Catch2](https://github.com/catchorg/Catch2) v3, fetched automatically from Meson WrapDB
(`subprojects/catch2.wrap`) on first configure; no manual setup is required beyond network access.

## Build

```powershell
just setup
just check
just package
```

After setup, the underlying Meson commands are:

```powershell
meson compile -C build
meson test -C build
meson compile -C build package
```

Explicit debug/release plugin builds (each configures its own build directory on first use):

```powershell
just build-debug # debug DLL in build/
just build-release # release DLL in build-release/
just release # release build + tests + foo_dsp_speaker_range.fb2k-component
```

Package the component:

```powershell
meson compile -C build package
```

This writes `foo_dsp_speaker_range.fb2k-component`, a ZIP archive containing `foo_dsp_speaker_range.dll`.

## Quality Tools

```powershell
meson compile -C build format-check
meson compile -C build clang-tidy
```

To apply formatting:

```powershell
meson compile -C build format
```

## Install

Open `foo_dsp_speaker_range.fb2k-component` with foobar2000, or install it through:

```text
Preferences -> Components -> Install...
```

Restart foobar2000 when prompted.

## Manual Acceptance Checks

- Component loads in foobar2000 2.25+ x64 without an incompatible-component warning.
- `Speaker Range Crop` appears under `Preferences -> Playback -> DSP Manager`.
- The DSP configuration dialog opens and values persist in the DSP chain.
- With the Wharfedale Super Denton preset, a 30 Hz tone is strongly attenuated while 1 kHz remains effectively
unchanged.
- Playback does not crash on seek, track change, sample-rate change, or output device change.