JUCE  v6.1.6 (6.0.8-1114)
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::dsp::Chorus< SampleType > Class Template Reference

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>

Collaboration diagram for juce::dsp::Chorus< SampleType >:

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::Lineardelay
 
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::LinearoscVolume
 
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
 

Detailed Description

template<typename SampleType>
class juce::dsp::Chorus< SampleType >

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}

Constructor & Destructor Documentation

◆ Chorus()

template<typename SampleType >
juce::dsp::Chorus< SampleType >::Chorus ( )

Constructor.

Member Function Documentation

◆ prepare()

template<typename SampleType >
void juce::dsp::Chorus< SampleType >::prepare ( const ProcessSpec spec)

Initialises the processor.

◆ process()

◆ reset()

template<typename SampleType >
void juce::dsp::Chorus< SampleType >::reset ( )

Resets the internal state variables of the processor.

◆ setCentreDelay()

template<typename SampleType >
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.

◆ setDepth()

template<typename SampleType >
void juce::dsp::Chorus< SampleType >::setDepth ( SampleType  newDepth)

Sets the volume of the LFO modulating the chorus delay line (between 0 and 1).

◆ setFeedback()

template<typename SampleType >
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.

◆ setMix()

template<typename SampleType >
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).

◆ setRate()

template<typename SampleType >
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.

◆ update()

template<typename SampleType >
void juce::dsp::Chorus< SampleType >::update ( )
private

Member Data Documentation

◆ bufferDelayTimes

template<typename SampleType >
AudioBuffer<SampleType> juce::dsp::Chorus< SampleType >::bufferDelayTimes
private

◆ centreDelay

template<typename SampleType >
SampleType juce::dsp::Chorus< SampleType >::centreDelay = 7.0
private

◆ delay

template<typename SampleType >
DelayLine<SampleType, DelayLineInterpolationTypes::Linear> juce::dsp::Chorus< SampleType >::delay
private

◆ depth

template<typename SampleType >
SampleType juce::dsp::Chorus< SampleType >::depth = 0.25
private

◆ dryWet

template<typename SampleType >
DryWetMixer<SampleType> juce::dsp::Chorus< SampleType >::dryWet
private

◆ feedback

template<typename SampleType >
SampleType juce::dsp::Chorus< SampleType >::feedback = 0.0
private

◆ feedbackVolume

template<typename SampleType >
std::vector<SmoothedValue<SampleType, ValueSmoothingTypes::Linear> > juce::dsp::Chorus< SampleType >::feedbackVolume { 2 }
private

◆ lastOutput

template<typename SampleType >
std::vector<SampleType> juce::dsp::Chorus< SampleType >::lastOutput { 2 }
private

◆ maxCentreDelayMs

template<typename SampleType >
constexpr SampleType juce::dsp::Chorus< SampleType >::maxCentreDelayMs = 100.0
staticprivate

◆ maxDepth

template<typename SampleType >
constexpr SampleType juce::dsp::Chorus< SampleType >::maxDepth = 1.0
staticconstexprprivate

◆ maximumDelayModulation

template<typename SampleType >
constexpr SampleType juce::dsp::Chorus< SampleType >::maximumDelayModulation = 20.0
staticprivate

◆ mix

template<typename SampleType >
SampleType juce::dsp::Chorus< SampleType >::mix = 0.5
private

◆ osc

template<typename SampleType >
Oscillator<SampleType> juce::dsp::Chorus< SampleType >::osc
private

◆ oscVolume

template<typename SampleType >
SmoothedValue<SampleType, ValueSmoothingTypes::Linear> juce::dsp::Chorus< SampleType >::oscVolume
private

◆ oscVolumeMultiplier

template<typename SampleType >
constexpr SampleType juce::dsp::Chorus< SampleType >::oscVolumeMultiplier = 0.5
staticprivate

◆ rate

template<typename SampleType >
SampleType juce::dsp::Chorus< SampleType >::rate = 1.0
private

◆ sampleRate

template<typename SampleType >
double juce::dsp::Chorus< SampleType >::sampleRate = 44100.0
private

The documentation for this class was generated from the following file: