LMMS
Loading...
Searching...
No Matches
juce::dsp::Chorus< SampleType > Class Template Reference

#include <juce_Chorus.h>

Public Member Functions

 Chorus ()
void setRate (SampleType newRateHz)
void setDepth (SampleType newDepth)
void setCentreDelay (SampleType newDelayMs)
void setFeedback (SampleType newFeedback)
void setMix (SampleType newMix)
void prepare (const ProcessSpec &spec)
void reset ()
template<typename ProcessContext>
void process (const ProcessContext &context) noexcept

Private Member Functions

void update ()

Private Attributes

Oscillator< SampleType > osc
DelayLine< SampleType, DelayLineInterpolationTypes::Lineardelay
SmoothedValue< SampleType, ValueSmoothingTypes::LinearoscVolume
std::vector< SmoothedValue< SampleType, ValueSmoothingTypes::Linear > > feedbackVolume { 2 }
DryWetMixer< SampleType > dryWet
std::vector< SampleType > lastOutput { 2 }
AudioBuffer< SampleType > bufferDelayTimes
double sampleRate = 44100.0
SampleType rate = 1.0
SampleType depth = 0.25
SampleType feedback = 0.0
SampleType mix = 0.5
SampleType centreDelay = 7.0

Static Private Attributes

static constexpr SampleType maxDepth = 1.0
static constexpr SampleType maxCentreDelayMs = 100.0
static constexpr SampleType oscVolumeMultiplier = 0.5
static constexpr SampleType maximumDelayModulation = 20.0

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>
Chorus::Chorus ( )

Constructor.

Member Function Documentation

◆ prepare()

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

Initialises the processor.

◆ process()

template<typename SampleType>
template<typename ProcessContext>
void juce::dsp::Chorus< SampleType >::process ( const ProcessContext & context)
inlinenoexcept

Processes the input and output samples supplied in the processing context.

◆ reset()

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

Resets the internal state variables of the processor.

◆ setCentreDelay()

template<typename SampleType>
void Chorus::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 Chorus::setDepth ( SampleType newDepth)

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

◆ setFeedback()

template<typename SampleType>
void Chorus::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 Chorus::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 Chorus::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 Chorus::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>
SampleType juce::dsp::Chorus< SampleType >::maxCentreDelayMs = 100.0
staticprivate

◆ maxDepth

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

◆ maximumDelayModulation

template<typename SampleType>
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>
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 files: