|
DSPark 1.6.1
Header-only audio DSP framework in pure C++20 — zero dependencies
|
Convolution reverb with one-line IR loading and progressive API. More...
#include "../Core/Convolver.h"#include "../Core/DryWetMixer.h"#include "../Core/RingBuffer.h"#include "../Core/AudioSpec.h"#include "../Core/AudioBuffer.h"#include "../Core/DspMath.h"#include "../Core/Resampler.h"#include "../Core/StateBlob.h"#include "../IO/WavFile.h"#include <algorithm>#include <atomic>#include <cmath>#include <cstddef>#include <cstdint>#include <memory>#include <vector>

Go to the source code of this file.
Classes | |
| class | dspark::Reverb< T > |
| Convolution reverb with IR loading, dry/wet, and pre-delay. More... | |
| struct | dspark::Reverb< T >::ConvolverBank |
Namespaces | |
| namespace | dspark |
| Main namespace for the DSPark framework. | |
Convolution reverb with one-line IR loading and progressive API.
Wraps the Convolver engine into a complete reverb effect with dry/wet mix, pre-delay, and automatic IR management. Supports loading impulse responses from WAV files or from raw sample data. The dry path is delay-compensated against the convolution engine's latency, so dry and wet stay sample-aligned at any mix setting (getLatency() reports the shared latency to the host).
IR shaping (setDecayScale / setStretch) reshapes the loaded impulse response without touching the stored original, so the controls are always relative to the file as loaded:
Three levels of API complexity:
reverb.loadIR("hall.wav"); reverb.setMix(0.3f);Threading: prepare() belongs to the setup thread (allocates; never call it concurrently with processing). processBlock() and reset() belong to the audio thread. loadIR(), setDecayScale(), setStretch() and setState() rebuild the convolver bank (they allocate) on the calling GUI/setup thread and publish it atomically: safe while audio runs, one writer at a time. setMix()/setPreDelay() are lock-free atomic publications, safe from any thread. Non-finite setter arguments are ignored. Loading an IR changes getLatency(): hosts must be notified.
File loading (loadIR from a path) is excluded when DSPARK_NO_FILE_IO is defined; the raw-data overload keeps working on embedded targets.
Dependencies: Convolver.h, DryWetMixer.h, RingBuffer.h, AudioSpec.h, AudioBuffer.h, DspMath.h, Resampler.h, StateBlob.h, WavFile.h (only without DSPARK_NO_FILE_IO).
Definition in file Reverb.h.