30template <
typename SampleType>
36 dryWet.setMixingRule (DryWetMixingRule::linear);
39template <
typename SampleType>
48template <
typename SampleType>
57template <
typename SampleType>
62 centreDelay =
jlimit (
static_cast<SampleType
> (1.0), maxCentreDelayMs,
newDelayMs);
65template <
typename SampleType>
74template <
typename SampleType>
84template <
typename SampleType>
90 sampleRate =
spec.sampleRate;
93 * sampleRate / 1000.0);
97 dryWet.prepare (
spec);
98 feedbackVolume.resize (
spec.numChannels);
99 lastOutput.resize (
spec.numChannels);
102 bufferDelayTimes.setSize (1, (
int)
spec.maximumBlockSize,
false,
false,
true);
108template <
typename SampleType>
111 std::fill (lastOutput.begin(), lastOutput.end(),
static_cast<SampleType
> (0));
117 oscVolume.reset (sampleRate, 0.05);
119 for (
auto&
vol : feedbackVolume)
120 vol.reset (sampleRate, 0.05);
123template <
typename SampleType>
126 osc.setFrequency (rate);
127 oscVolume.setTargetValue (depth * oscVolumeMultiplier);
128 dryWet.setWetMixProportion (mix);
130 for (
auto&
vol : feedbackVolume)
131 vol.setTargetValue (feedback);
A simple chorus DSP widget that modulates the delay of a delay line in order to create sweeping notch...
void setFeedback(SampleType newFeedback)
Sets the feedback volume (between -1 and 1) of the chorus delay line.
void setDepth(SampleType newDepth)
Sets the volume of the LFO modulating the chorus delay line (between 0 and 1).
void prepare(const ProcessSpec &spec)
Initialises the processor.
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 f...
void reset()
Resets the internal state variables of the processor.
void setRate(SampleType newRateHz)
Sets the rate (in Hz) of the LFO modulating the chorus delay line.
void setCentreDelay(SampleType newDelayMs)
Sets the centre delay in milliseconds of the chorus delay line modulation.
A delay line processor featuring several algorithms for the fractional delay calculation,...
void prepare(const ProcessSpec &spec)
Initialises the processor.
Type jlimit(Type lowerLimit, Type upperLimit, Type valueToConstrain) noexcept
Constrains a value to keep it within a given range.
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...
bool isPositiveAndNotGreaterThan(Type1 valueToTest, Type2 upperLimit) noexcept
Returns true if a value is at least zero, and also less than or equal to a specified upper limit.
bool isPositiveAndBelow(Type1 valueToTest, Type2 upperLimit) noexcept
Returns true if a value is at least zero, and also below a specified upper limit.
This structure is passed into a DSP algorithm's prepare() method, and contains information about vari...