|
DSPark 1.9.0
Header-only C++20 DSP for real-time and offline audio
|
DSPark is a header-only C++20 audio DSP library for developers building real-time and offline audio software. It provides effects, filters, synthesis and spectral building blocks, analysis and musical tools, native file I/O, and an optional VST3/CLAP/Audio Unit v2 plugin layer.
The framework modules have no third-party dependencies and require no separately compiled DSPark library. Optimized paths may use compiler-provided SIMD intrinsics behind platform guards. The plugin adapters and the Windows-only DSParkLab application are separate from the umbrella header and carry their own platform integration requirements.
The v1.9.0 CI matrix covers Windows, Linux, macOS, WebAssembly, and an embedded profile. The framework headers also target iOS and Android, although those two platforms do not have dedicated v1.9.0 CI jobs.
Current release: v1.9.0 | API reference | Cookbook | Examples | Plugin guide
-O2 or /O2); header-only code is compiled with the flags of the consuming target.Vendor the repository at third_party/DSPark, add that directory to your include path, and include the umbrella header:
For a direct compiler invocation:
For CMake, the interface target supplies the include path and C++20 requirement:
A CMake installation is consumed with find_package(dspark CONFIG REQUIRED) and the same dspark::dspark target. Every route (subdirectory, FetchContent, installed package) also provides the plugin layer and the dspark_add_plugin() bundle helper described in docs/plugins.md.
Or fetch the v1.9.0 release tag:
A typical block processor is constructed and configured with prepare(AudioSpec) before its audio-stream owner calls processBlock().
In an audio host, create an AudioBufferView<float> over the host-owned channel pointers instead of allocating an AudioBuffer in the callback. See the real-time-style channel-strip example and the offline WAV example for complete programs.
| Area | Representative APIs |
|---|---|
| Filters and equalization | Biquad, BiquadCascade, NormalizedLadder, FilterDesign, FirBank, KeyEqualizer, LaneCascade, GraphicBank, CabinetModel, StateVariableFilter, LadderFilter, FilterEngine, Equalizer, CrossoverFilter |
| Dynamics and level control | Compressor, Limiter, NoiseGate, Expander, DynamicEQ, MultibandCompressor, DeEsser |
| Offline dynamics, clipping, stereo and analysis | OfflineLeveler, OfflineBeatCompressor, OfflinePeakCompressor, OfflinePunch, OfflineSoftClipper, OfflineHardClipper, OfflineStereoGenerator, OfflineStereoBalance, OfflineEnergyAnalyzer, OfflineTransientAnalyzer, OfflineTempoAnalyzer (worker API) |
| Nonlinear and analog modeling | Saturation, MultibandSaturation, LoFi, Clipper, TapeMachine, TubePreamp, TransformerModel, CharacterStage, wdf::* |
| Time, pitch, and spatial processing | Delay, BucketBrigade, TapeTransport, AlgorithmicReverb, Reverb, TailShaper, PitchShifter, TimeStretch, PitchCorrector, GranularProcessor |
| Spectral processing | FFTReal, Convolver, ZeroLatencyConvolver, SpectralProcessor, SpectralFilter, DetailFilter, DetailAnalysis, SpectralEnvelope, AuditoryBands, SpectralFreeze, SpectralDenoiser, TonalBalance, ResonanceSuppressor, SpectralDynamicEQ |
| Analysis and metering | SpectrumAnalyzer, LoudnessMeter, AudioIntervalAnalyzer, LoudnessNormalizer, PitchDetector, OnsetDetector, BeatTracker, DownbeatEstimator, LoopFinder, DelayEstimator |
| Synthesis and music | Synthesizer (analog, FM and wavetable engines, samples, filters, envelopes, LFOs, modulation matrix), Oscillator, WavetableOscillator, WavetableBank, Sampler, Lfo, ADSREnvelope, ChordDetector, KeyDetector, harmony::* |
| Infrastructure | AudioBuffer, ProcessorChain, Resampler, Oversampling, Dither, SpscQueue, versioned state blobs |
| File I/O | WAV and MP3 read/write, Standard MIDI File read/write, native FLAC decode |
| Plugin development | Native VST3 and CLAP adapters, macOS Audio Unit v2, instruments, sidechains, automation, state, and optional WebView editors |
The API reference is the exhaustive class and method inventory. The cookbook covers production workflows including mastering, restoration, tempo detection, time stretching, loop finding, and pitch correction.
WAV and MP3 support includes reading and writing. MidiFile reads Standard MIDI File formats 0, 1, and 2 and writes formats 0 and 1. FlacFile is a decode-only native FLAC implementation; its write operations return false. Define DSPARK_NO_FILE_IO before including DSPark.h to omit all file-I/O headers for targets without filesystem support.
Real-time safety is a per-method contract, not a blanket property of every operation:
prepare(), state restoration, and setup-only configuration may allocate and must not run concurrently with processing.The complete ownership and publication rules are in the threading model.
| Target | v1.9.0 validation |
|---|---|
| Windows | MSVC x64 and ARM64: test and conformance suites |
| Linux | GCC x64/ARM64 and Clang x64: test and conformance suites |
| macOS | Clang ARM64: test and conformance suites |
| WebAssembly | Emscripten conformance in scalar and SIMD128 configurations |
| Embedded profile | GCC compile gate with file I/O, exceptions, and RTTI disabled |
| iOS and Android | Portable framework headers; not separate targets in the v1.9.0 CI matrix |
CI also checks installed-header self-sufficiency with GCC and Clang, warning-free builds, sanitizers, concurrent publication paths, examples, native plugin smoke hosts and validators, and generated documentation. The official EBU loudness-vector job is best effort because the licensed test material is downloaded separately; the job reports a skip when the vectors are unavailable.
Measured processor and analyzer results, including settings and limitations, are published in the quality metrics table.
DSPark supplies native adapters for VST3 and CLAP on desktop platforms and Audio Unit v2 on macOS. The required VST3 C API and CLAP headers are included in the repository; the CMake helper builds the platform-specific module or bundle layout.
The shared plugin contract covers parameters, automation, state, latency, tail reporting, bypass, mono/stereo layouts, sidechains, transport, MIDI instruments, offline-rendering modes, and factory presets. Custom editors can be written in HTML/CSS/JavaScript and embedded with the platform WebView layer. On Linux, a custom editor requires WebKitGTK at runtime; the host's generic parameter UI remains the fallback when a WebView is unavailable.
Start with the plugin guide and the plugin examples.
DSParkLab/ is a Windows-only Win32/Direct3D 11 application for interactive processor testing. Its bundled Dear ImGui and miniaudio sources are confined to the application and are not dependencies of the DSPark framework. For the selected effect it draws the spectrum under the effect's response or its live gain curves (with what a spectral processor detects), the gain reduction over time, the output meters and a test tone with its THD+N, and lays the controls out as knobs on tabs. Space plays and pauses, B switches between the processed and the dry signal, E puts the selected effect in or out of the chain and R resets its controls. Started as DSParkLab.exe Compressor, it opens with that effect shown; it draws at the resolution of the monitor it is on. Build it with DSParkLab\build.bat (Visual Studio 2019 or later, any edition).
TonalBalance, an adaptive equalizer driven by a model of hearing; ResonanceSuppressor; SpectralDynamicEQ; MultibandSaturation; and LoFi.DownbeatEstimator, which finds the first beat of each bar and the metre.FilterDesign and BiquadCascade (analog-matched filters of any order and slope), KeyEqualizer (a sidechain equalizer for the dynamics), DetailFilter and DetailAnalysis (a spectral engine with a detail control), BucketBrigade, TapeTransport, CabinetModel, CharacterStage, TailShaper, NormalizedLadder and more.v1.9.0 is source compatible with v1.8.1. Some defaults and latencies change: see the v1.9.0 migration guide, the release notes and the full changelog.
Synthesizer: a polyphonic synthesizer with analog (three band-limited oscillators, PWM, hard sync), four-operator FM and morphing wavetable engines. Every engine can also play samples, so a recorded note goes through the synthesizer's ladder or state-variable filter, envelopes, LFOs, modulation matrix and unison. Events are sample-accurate, renders are identical for any block size, and 2x/4x oversampling is optional.MinBlepTable (saw and pulse aliasing at -143 dB or lower), Oscillator pulse-width modulation with a double-precision phase, WavetableBank mipmapped tables for WavetableOscillator (about -165 dB), and the new Lfo.Read the release notes and the full changelog. Upgrading from v1.7.0 is covered by the v1.8.0 migration guide.
From a repository checkout:
Contributions are welcome. Read CONTRIBUTING.md for the development workflow and conventions. Please open an issue to discuss a proposed change before submitting a pull request. Bug reports should include the platform, compiler version, and a minimal reproduction.
DSPark is available under the [MIT License](LICENSE).
Created and maintained by Cristian Moresi. Contact: dev@cristianmoresi.com.