|
DSPark 1.6.1
Header-only audio DSP framework in pure C++20 — zero dependencies
|
Multi-voice chorus/flanger with true stereo spread and smooth parameter handling. More...
#include <Chorus.h>

Public Member Functions | |
| ~Chorus ()=default | |
| void | prepare (const AudioSpec &spec) |
| Prepares the chorus for processing, allocating delay lines. | |
| void | processBlock (AudioBufferView< T > buffer) noexcept |
| Processes an audio block in-place. | |
| void | reset () noexcept |
| Resets delay lines and LFO phases. | |
| void | setRate (T hz) noexcept |
| Sets the LFO modulation rate. | |
| void | setDepthMs (T ms) noexcept |
| Sets the LFO modulation depth in milliseconds. | |
| void | setMix (T dryWet) noexcept |
| Sets the wet/dry mix ratio. | |
| void | setVoices (int count) noexcept |
| Sets the number of active voices per channel. | |
| void | setFeedback (T amount) noexcept |
| Sets the feedback gain. | |
| void | setCenterDelay (T ms) noexcept |
| Sets the base delay time. | |
| void | setStereoSpread (T amount) noexcept |
| Sets the stereo spread amount. | |
| void | setAutoDepth (bool enabled) noexcept |
| Couples depth to rate automatically to prevent pitch artifacts at high speeds. | |
| void | setModWaveform (typename Oscillator< T >::Waveform wf) noexcept |
| Sets the oscillator waveform for all voices. | |
| 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). | |
Static Public Attributes | |
| static constexpr int | kMaxVoices = 4 |
| static constexpr int | kMaxChannels = 16 |
Protected Member Functions | |
| void | updateLfoPhases () noexcept |
| Recalculates LFO phases for all channels and voices based on stereo spread. | |
Protected Attributes | |
| AudioSpec | spec_ {} |
| int | maxDelaySamples_ { 0 } |
| std::atomic< T > | rate_ { T(1) } |
| std::atomic< T > | depthMs_ { T(3.5) } |
| std::atomic< T > | mix_ { T(0.5) } |
| std::atomic< T > | feedback_ { T(0) } |
| std::atomic< T > | centerDelayMs_ { T(7) } |
| std::atomic< T > | stereoSpread_ { T(0.5) } |
| std::atomic< int > | numVoices_ { 2 } |
| std::atomic< bool > | autoDepth_ { false } |
| T | lastSpread_ { T(0.5) } |
| std::atomic< typename Oscillator< T >::Waveform > | lfoWaveform_ { Oscillator<T>::Waveform::Sine } |
| std::atomic< bool > | lfoPhaseDirty_ { false } |
| std::atomic< bool > | waveformDirty_ { false } |
| T | smoothedCenterSamples_ { T(0) } |
| T | smoothedDepthSamples_ { T(0) } |
| std::array< RingBuffer< T >, kMaxChannels > | delayLines_ {} |
| std::array< std::array< Oscillator< T >, kMaxVoices >, kMaxChannels > | lfos_ {} |
| std::array< T, kMaxChannels > | fbState_ {} |
| DryWetMixer< T > | mixer_ |
Multi-voice chorus/flanger with true stereo spread and smooth parameter handling.
| T | Sample type (float or double). |
|
default |
|
inline |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Sets the oscillator waveform for all voices.
| wf | The desired waveform type (wild enum values clamp). |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlineprotectednoexcept |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticconstexpr |
|
staticconstexpr |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |