A simple chorus DSP widget that modulates the delay of a delay line in order to create sweeping notches in the magnitude frequency response. More...
#include <juce_Chorus.h>
Public Member Functions | |
Chorus () | |
Constructor. More... | |
void | prepare (const ProcessSpec &spec) |
Initialises the processor. More... | |
template<typename ProcessContext > | |
void | process (const ProcessContext &context) noexcept |
Processes the input and output samples supplied in the processing context. More... | |
void | reset () |
Resets the internal state variables of the processor. More... | |
void | setCentreDelay (SampleType newDelayMs) |
Sets the centre delay in milliseconds of the chorus delay line modulation. More... | |
void | setDepth (SampleType newDepth) |
Sets the volume of the LFO modulating the chorus delay line (between 0 and 1). More... | |
void | setFeedback (SampleType newFeedback) |
Sets the feedback volume (between -1 and 1) of the chorus delay line. More... | |
void | setMix (SampleType newMix) |
Sets the amount of dry and wet signal in the output of the chorus (between 0 for full dry and 1 for full wet). More... | |
void | setRate (SampleType newRateHz) |
Sets the rate (in Hz) of the LFO modulating the chorus delay line. More... | |
Private Member Functions | |
void | update () |
Private Attributes | |
AudioBuffer< SampleType > | bufferDelayTimes |
SampleType | centreDelay = 7.0 |
DelayLine< SampleType, DelayLineInterpolationTypes::Linear > | delay |
SampleType | depth = 0.25 |
DryWetMixer< SampleType > | dryWet |
SampleType | feedback = 0.0 |
std::vector< SmoothedValue< SampleType, ValueSmoothingTypes::Linear > > | feedbackVolume { 2 } |
std::vector< SampleType > | lastOutput { 2 } |
SampleType | mix = 0.5 |
Oscillator< SampleType > | osc |
SmoothedValue< SampleType, ValueSmoothingTypes::Linear > | oscVolume |
SampleType | rate = 1.0 |
double | sampleRate = 44100.0 |
Static Private Attributes | |
static constexpr SampleType | maxCentreDelayMs = 100.0 |
static constexpr SampleType | maxDepth = 1.0 |
static constexpr SampleType | maximumDelayModulation = 20.0 |
static constexpr SampleType | oscVolumeMultiplier = 0.5 |
A simple chorus DSP widget that modulates the delay of a delay line in order to create sweeping notches in the magnitude frequency response.
This audio effect can be controlled via the speed and depth of the LFO controlling the frequency response, a mix control, a feedback control, and the centre delay of the modulation.
Note: To get classic chorus sounds try to use a centre delay time around 7-8 ms with a low feedback volume and a low depth. This effect can also be used as a flanger with a lower centre delay time and a lot of feedback, and as a vibrato effect if the mix value is 1.
@tags{DSP}
juce::dsp::Chorus< SampleType >::Chorus | ( | ) |
Constructor.
void juce::dsp::Chorus< SampleType >::prepare | ( | const ProcessSpec & | spec | ) |
Initialises the processor.
|
inlinenoexcept |
Processes the input and output samples supplied in the processing context.
References juce::dsp::Chorus< SampleType >::bufferDelayTimes, juce::dsp::Chorus< SampleType >::centreDelay, juce::dsp::Chorus< SampleType >::delay, juce::dsp::Chorus< SampleType >::dryWet, juce::dsp::Chorus< SampleType >::feedbackVolume, juce::dsp::AudioBlock< SampleType >::getSubBlock(), juce::AudioBuffer< Type >::getWritePointer(), juce::gl::input, jassert, juce::jmax(), juce::dsp::Chorus< SampleType >::lastOutput, juce::dsp::Chorus< SampleType >::maximumDelayModulation, juce::dsp::Chorus< SampleType >::osc, juce::dsp::Chorus< SampleType >::oscVolume, juce::gl::output, and juce::dsp::Chorus< SampleType >::sampleRate.
void juce::dsp::Chorus< SampleType >::reset | ( | ) |
Resets the internal state variables of the processor.
void juce::dsp::Chorus< SampleType >::setCentreDelay | ( | SampleType | newDelayMs | ) |
Sets the centre delay in milliseconds of the chorus delay line modulation.
This delay must be between 1 and 100 ms.
void juce::dsp::Chorus< SampleType >::setDepth | ( | SampleType | newDepth | ) |
Sets the volume of the LFO modulating the chorus delay line (between 0 and 1).
void juce::dsp::Chorus< SampleType >::setFeedback | ( | SampleType | newFeedback | ) |
Sets the feedback volume (between -1 and 1) of the chorus delay line.
Negative values can be used to get specific chorus sounds.
void juce::dsp::Chorus< SampleType >::setMix | ( | SampleType | newMix | ) |
Sets the amount of dry and wet signal in the output of the chorus (between 0 for full dry and 1 for full wet).
void juce::dsp::Chorus< SampleType >::setRate | ( | SampleType | newRateHz | ) |
Sets the rate (in Hz) of the LFO modulating the chorus delay line.
This rate must be lower than 100 Hz.
|
private |
|
private |
Referenced by juce::dsp::Chorus< SampleType >::process().
|
private |
Referenced by juce::dsp::Chorus< SampleType >::process().
|
private |
Referenced by juce::dsp::Chorus< SampleType >::process().
|
private |
|
private |
Referenced by juce::dsp::Chorus< SampleType >::process().
|
private |
|
private |
Referenced by juce::dsp::Chorus< SampleType >::process().
|
private |
Referenced by juce::dsp::Chorus< SampleType >::process().
|
staticprivate |
|
staticconstexprprivate |
|
staticprivate |
Referenced by juce::dsp::Chorus< SampleType >::process().
|
private |
|
private |
Referenced by juce::dsp::Chorus< SampleType >::process().
|
private |
Referenced by juce::dsp::Chorus< SampleType >::process().
|
staticprivate |
|
private |
|
private |
Referenced by juce::dsp::Chorus< SampleType >::process().