|
DSPark 1.8.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.8.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.8.0 CI jobs.
Current release: v1.8.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.8.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, 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, Clipper, TapeMachine, TubePreamp, TransformerModel, wdf::* |
| Time, pitch, and spatial processing | Delay, AlgorithmicReverb, Reverb, PitchShifter, TimeStretch, PitchCorrector, GranularProcessor |
| Spectral processing | FFTReal, Convolver, ZeroLatencyConvolver, SpectralProcessor, SpectralFreeze, SpectralDenoiser |
| Analysis and metering | SpectrumAnalyzer, LoudnessMeter, AudioIntervalAnalyzer, LoudnessNormalizer, PitchDetector, OnsetDetector, BeatTracker, LoopFinder, DelayEstimator |
| Synthesis and music | Oscillator, WavetableOscillator, Sampler, 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.8.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.8.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. Build it with DSParkLab\build.bat (Visual Studio 2019 or later, any edition).
StereoGenerator also supports real-time stereo processing, preserving the original mid through processed-copy delta add-back. It defaults to 1x; higher oversampling factors remain explicit options.AudioIntervalAnalyzer measures exact sample intervals from blocks without retaining PCM, with explicit validity and independent/continuous loudness context. See the interval contract.TubePreamp integrates the nonlinear circuit within each internal sample at 2x and above, retaining the 2x default and configurable 1x operation. The documented tone sweeps include +36 dB drive; stage changes use a primed crossfade without callback allocations.BeatTracker, a polyphonic multi-zone Sampler, Studio time/pitch processing, and conversion-specific Resampler filters with explicit latency and finite-source range conversion.AlgorithmicReverb rebuilt as a true-stereo 32-line FDN (16 in Eco) with a binaural early field and frequency-dependent decay control.Oversampling decimator, with SIMD paths and benchmark conditions documented in their headers.SpectralDenoiser, gapless MP3 round trips, and glided parameter changes across the effects.choice()/stepped() parameters, UI-thread restart requests, chunked oversize blocks, and an installed CMake package that ships the plugin layer with dspark_add_plugin().Read the release notes, full changelog, and 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.