DSPark 1.6.1
Header-only audio DSP framework in pure C++20 — zero dependencies
Loading...
Searching...
No Matches
DSPark.h
Go to the documentation of this file.
1// DSPark - Professional Audio DSP Framework
2// Copyright (c) 2026 Cristian Moresi - MIT License
3
4#pragma once
5
642// === Core ===================================================================
643
644#include "Core/SimdOps.h"
645#include "Core/DspMath.h"
646#include "Core/AudioSpec.h"
647#include "Core/AudioBuffer.h"
648#include "Core/AnalogConstants.h"
650#include "Core/SpinLock.h"
651#include "Core/SpscQueue.h"
652#include "Core/Biquad.h"
653#include "Core/DryWetMixer.h"
654#include "Core/Smoothers.h"
655#include "Core/AnalogRandom.h"
656#include "Core/Oscillator.h"
657#include "Core/Oversampling.h"
658#include "Core/FFT.h"
659#include "Core/WindowFunctions.h"
660#include "Core/MinBlepTable.h"
661#include "Core/FIRFilter.h"
662#include "Core/Convolver.h"
664#include "Core/WDF.h"
666#include "Core/StateBlob.h"
667#include "Core/Hysteresis.h"
668#include "Core/Resampler.h"
670#include "Core/Dither.h"
671#include "Core/SmoothedValue.h"
672#include "Core/ProcessorTraits.h"
673#include "Core/ProcessorChain.h"
674#include "Core/DenormalGuard.h"
675#include "Core/Interpolation.h"
676#include "Core/Phasor.h"
677#include "Core/SampleAndHold.h"
678#include "Core/RingBuffer.h"
679#include "Core/WaveshapeTable.h"
681#include "Core/Hilbert.h"
682#include "Core/LadderFilter.h"
685
686// === Effects ================================================================
687
688#include "Effects/MidSide.h"
689#include "Effects/Saturation.h"
690#include "Effects/Delay.h"
691#include "Effects/Filters.h"
692#include "Effects/Panner.h"
693#include "Effects/Gain.h"
694#include "Effects/DCBlocker.h"
695#include "Effects/Crossfade.h"
696#include "Effects/StereoWidth.h"
697#include "Effects/Compressor.h"
698#include "Effects/Limiter.h"
699#include "Effects/NoiseGate.h"
700#include "Effects/Equalizer.h"
701#include "Effects/Reverb.h"
702#include "Effects/Chorus.h"
703#include "Effects/Phaser.h"
706#include "Effects/Tremolo.h"
707#include "Effects/Vibrato.h"
710#include "Effects/DeEsser.h"
711#include "Effects/AutoGain.h"
713#include "Effects/Expander.h"
715#include "Effects/DynamicEQ.h"
717#include "Effects/Clipper.h"
718#include "Effects/PitchShifter.h"
719#include "Effects/TapeMachine.h"
720#include "Effects/TubePreamp.h"
724
725// === Analysis ===============================================================
726
730#include "Analysis/Goertzel.h"
736
737// === I/O ====================================================================
738// File I/O uses <fstream>/<filesystem>, which do not exist on bare-metal
739// embedded targets. Define DSPARK_NO_FILE_IO to exclude this module - the
740// whole DSP core compiles and runs without it.
741
742#ifndef DSPARK_NO_FILE_IO
743#include "IO/AudioFile.h"
744#include "IO/WavFile.h"
745#include "IO/Mp3File.h"
746#endif
747
748// === Music ==================================================================
749
751#include "Music/ChordDetector.h"
World-class 16-line FDN reverb with Jot absorption and Hadamard mixing.
Reference constants from analog-hardware research and measurement.
Analog-style random modulation: white/pink/brown drift generators.
Owning audio buffer and non-owning view for real-time DSP processing.
Abstract interface for reading and writing audio files.
Describes the audio processing environment (sample rate, block size, channels).
Automatic gain compensation for honest A/B comparison.
Biquad filter with Transposed Direct Form II, Audio EQ Cookbook coefficients, and thread-safe updates...
Real-time chord detection: Goertzel chroma + template matching.
High-performance Chorus / Flanger effect with LFO-modulated delay lines.
Multi-mode clipping processor with oversampling, multi-stage architecture, and time-aware slew limiti...
Modular dynamic range compressor with analog-modeled ballistics and Hilbert detection.
FFT-based partitioned convolution for long impulse responses.
Crossfade between two audio signals with selectable curve and artifact-free parameter smoothing.
Linkwitz-Riley crossover filter for multi-band audio processing.
Removes DC offset from audio signals with configurable filter order.
Frequency-selective dynamic processor for sibilance reduction.
Professional delay line with Hermite interpolation, analog feedback saturation, and stereo processing...
RAII scope guard that disables denormal (subnormal) float arithmetic.
TPDF dither and quantisation to a target bit depth.
Real-time safe dry/wet mixer with parameter smoothing and mix laws.
Core mathematical utilities for digital signal processing.
Dynamic parametric equalizer with per-band level detection and true VCA ballistics.
Peak/RMS envelope follower with asymmetric attack/release.
ADSR envelope generator for synthesis and dynamics.
Multi-band parametric equalizer with Minimum and Linear Phase modes.
Downward expander with configurable ratio, hysteresis, and sidechain.
Fast Fourier Transform (Cooley-Tukey radix-2) with SIMD acceleration.
FIR (Finite Impulse Response) filter with windowed-sinc coefficient design.
Multi-mode cascaded biquad filter engine with real-time parameter smoothing.
Frequency shifting (not pitch shifting) using Hilbert transform.
Smoothed gain processor with fade, mute, and click-free phase inversion.
Goertzel algorithm for efficient single-frequency detection.
Real-time granular engine: clouds, freeze, per-grain pitch/spread.
Comprehensive musical harmony calculations - scales, chords, MIDI, theory.
FIR Hilbert transformer producing sample-aligned analytic signals.
Jiles-Atherton magnetic hysteresis with an implicit NR solver.
Fractional-position interpolation for delay lines, tables and buffers.
Moog-style 4-pole resonant ladder filter (TPT, zero-delay feedback).
Envelope follower for real-time peak and RMS level metering.
Brickwall lookahead limiter with optional ISP (true-peak) detection and adaptive release for masterin...
Thread-safe EBU R128 / ITU-R BS.1770 loudness meter.
Mid/Side stereo encoding and decoding for real-time audio.
Shared minimum-phase band-limited step (minBLEP) residual table.
Block-rate modulation routing: sources to parameter setters.
Pure C++20 MPEG-1 Layer III (MP3) codec - decoder and encoder.
Multi-band compressor using CrossoverFilter + per-band Compressor.
Noise gate with hysteresis, hold time, and duck mode.
Audio noise generator conforming to the AudioProcessor contract.
Causal SuperFlux onset detector with a Boeck-2012 adaptive peak picker.
Band-limited oscillator: PolyBLEP waveforms plus table-minBLEP hard sync.
Power-of-two oversampling with polyphase half-band FIR filters.
High-performance stereo panning toolkit with multiple algorithms.
Stereo phase correlation meter with goniometer feed.
Classic analog-modeled phaser effect using LFO-modulated allpass filter stages.
Phase accumulator producing a [0, 1) ramp for oscillators and LFOs.
Real-time monophonic pitch detection using the YIN algorithm.
Musical pitch tracker: PitchDetector + the logic that makes it usable.
Phase-vocoder pitch shifter with identity phase locking.
Compile-time processor chain for composing DSP effects.
C++20 concepts defining the strictly real-time DSP processor contract.
High-quality sample rate converter for audio signals.
Convolution reverb with one-line IR loading and progressive API.
Circular buffer with interpolated reads for audio delay lines.
Ring modulation - multiplies the signal by an oscillator carrier.
Sample-and-hold processor for stepped modulation and bit-crushing.
Professional multi-algorithm saturation processor with analog simulation.
SIMD-accelerated buffer operations for real-time audio processing.
Click-free parameter smoother with selectable curves.
Spectral gating denoiser with a learnable noise profile.
Zero-allocation streaming STFT framework for spectral processing.
Real-time FFT-based spectrum analyser for audio visualisation.
Lightweight spin lock for real-time audio thread synchronisation.
Lock-free single-producer, single-consumer (SPSC) bounded queue.
Versioned key-value state serialization for processor presets.
Topology-Preserving Transform (TPT) State Variable Filter.
Stereo width control via Mid/Side processing with phase-aligned bass mono.
Physical tape machine: JA hysteresis, EQ standards, losses, transport.
Audio transformer: core hysteresis on the flux, LF bloom, HF bell.
Transient shaping via dual-envelope analysis (VCA Logarithmic Model).
Amplitude modulation (tremolo) with configurable LFO and analog-style shaping.
Shared ITU-R BS.1770 true-peak (inter-sample peak) detector.
Tube preamp: Koren 12AX7 stages, WDF tone circuit, supply sag.
Pitch modulation via LFO-driven variable delay.
Wave Digital Filters: physical circuit modelling building blocks.
High-performance, pure C++ WAV file reader/writer.
Table-based waveshaping with Hermite interpolation for high-end audio.
Bandlimited wavetable oscillator with mipmap anti-aliasing.
Standard window functions for spectral analysis and FIR filter design.
Zero-latency non-uniform partitioned convolution (Gardner scheme).