|
DSPark 1.6.1
Header-only audio DSP framework in pure C++20 — zero dependencies
|
#include <Panner.h>

Public Types | |
| enum class | Algorithm { EqualPower , Binaural , MidPan , SidePan , Haas , Spectral } |
| Available panning algorithms. More... | |
Public Member Functions | |
| ~Panner ()=default | |
| void | prepare (const AudioSpec &spec) |
| Initializes internal delays, filters, and smoothers. | |
| void | setAlgorithm (Algorithm algo) noexcept |
| Sets the active panning algorithm safely from any thread. | |
| void | setPan (T position) noexcept |
| Sets the target pan position (automatable, smoothed). | |
| void | processBlock (AudioBufferView< T > buffer) noexcept |
| Processes an audio block in-place. Real-time safe. | |
| void | reset () noexcept |
| Clears delay lines and filter states to prevent ghost echoes. | |
| void | setBinauralMaxITD (float ms) noexcept |
| void | setHaasMaxDelay (float ms) noexcept |
| void | setSpectralFrequency (float hz) noexcept |
| void | setSpectralMaxGain (float dB) noexcept |
| void | setSmoothingTime (float ms) noexcept |
| Sets the pan smoothing time. Thread-safe; applied at the top of the next processBlock() (previously it only took effect on the next prepare(), silently). | |
| std::vector< uint8_t > | getState () const |
| Serializes the parameter state (setup/UI threads; allocates). | |
| bool | setState (const uint8_t *data, size_t size) |
| Restores parameters from a blob (tolerant; rejects foreign ids). | |
Protected Member Functions | |
| void | applyEqualPower (AudioBufferView< T > buffer, float) noexcept |
| void | applyCombinedBinaural (AudioBufferView< T > buffer, float panTarget) noexcept |
| void | applyMidPan (AudioBufferView< T > buffer, float) noexcept |
| void | applySidePan (AudioBufferView< T > buffer, float) noexcept |
| void | applyHaas (AudioBufferView< T > buffer, float panTarget) noexcept |
| void | applySpectral (AudioBufferView< T > buffer, float panTarget) noexcept |
| void | updateSpectralFilters (T targetPan) noexcept |
Protected Attributes | |
| double | sampleRate_ = 48000.0 |
| std::atomic< Algorithm > | algorithm_ { Algorithm::EqualPower } |
| std::atomic< T > | pan_ { T(0) } |
| Delay< T > | delayL_ |
| Delay< T > | delayR_ |
| Smoothers::LinearSmoother | panSmoother_ |
| Biquad< T, 1 > | spectralL_ |
| Biquad< T, 1 > | spectralR_ |
| std::atomic< float > | smoothingTime_ { 50.0f } |
| std::atomic< bool > | smoothingDirty_ { false } |
| Pan smoother re-config pending. | |
| std::atomic< float > | binauralMaxITD_ { 0.66f } |
| std::atomic< float > | haasMaxDelay_ { 30.0f } |
| std::atomic< float > | spectralFreq_ { 4000.0f } |
| std::atomic< float > | spectralMaxGain_ { 6.0f } |
|
strong |
Available panning algorithms.
|
default |
|
inlineprotectednoexcept |
|
inlineprotectednoexcept |
|
inlineprotectednoexcept |
|
inlineprotectednoexcept |
|
inlineprotectednoexcept |
|
inlineprotectednoexcept |
|
inline |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Sets the active panning algorithm safely from any thread.
| algo | The algorithm enum to use. Out-of-range values are clamped. |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Sets the pan smoothing time. Thread-safe; applied at the top of the next processBlock() (previously it only took effect on the next prepare(), silently).
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inlineprotectednoexcept |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |