41template <
typename SampleType>
53 void setRate (SampleType newRateHz);
72 void setMix (SampleType newMix);
83 template <
typename ProcessContext>
84 void process (
const ProcessContext& context)
noexcept
86 const auto& inputBlock = context.getInputBlock();
87 auto& outputBlock = context.getOutputBlock();
88 const auto numChannels = outputBlock.getNumChannels();
89 const auto numSamples = outputBlock.getNumSamples();
91 jassert (inputBlock.getNumChannels() == numChannels);
93 jassert (inputBlock.getNumSamples() == numSamples);
95 if (context.isBypassed)
97 outputBlock.copyFrom (inputBlock);
101 int numSamplesDown = 0;
104 for (
size_t i = 0;
i < numSamples; ++
i)
115 if (numSamplesDown > 0)
121 osc.process (contextFreq);
127 for (
int i = 0;
i < numSamplesDown; ++
i)
129 auto lfo =
jlimit (
static_cast<SampleType
> (0.0),
130 static_cast<SampleType
> (1.0),
133 freqSamples[
i] =
mapToLog10 (lfo,
static_cast<SampleType
> (20.0),
137 auto currentFrequency =
filters[0]->getCutoffFrequency();
138 dryWet.pushDrySamples (inputBlock);
140 for (
size_t channel = 0; channel < numChannels; ++channel)
145 auto* inputSamples = inputBlock .getChannelPointer (channel);
146 auto* outputSamples = outputBlock.getChannelPointer (channel);
148 for (
size_t i = 0;
i < numSamples; ++
i)
150 auto input = inputSamples[
i];
153 if (
i == 0 && counter != 0)
155 filters[
n]->setCutoffFrequency (currentFrequency);
160 filters[
n]->setCutoffFrequency (freqSamples[
k]);
166 output =
filters[
n]->processSample ((
int) channel, output);
168 outputSamples[
i] = output;
178 dryWet.mixWetSamples (outputBlock);
190 std::vector<SmoothedValue<SampleType, ValueSmoothingTypes::Linear>>
feedbackVolume { 2 };
Definition juce_AudioSampleBuffer.h:34
Definition juce_OwnedArray.h:51
Definition juce_SmoothedValue.h:227
Definition juce_AudioBlock.h:70
AudioBlock getSubBlock(size_t newOffset, size_t newLength) const noexcept
Definition juce_AudioBlock.h:371
Definition juce_DryWetMixer.h:54
Definition juce_Oscillator.h:38
void reset()
Definition juce_Phaser.cpp:120
DryWetMixer< SampleType > dryWet
Definition juce_Phaser.h:191
static constexpr int numStages
Definition juce_Phaser.h:202
void prepare(const ProcessSpec &spec)
Definition juce_Phaser.cpp:94
static constexpr int maxUpdateCounter
Definition juce_Phaser.h:198
std::vector< SampleType > lastOutput
Definition juce_Phaser.h:192
double sampleRate
Definition juce_Phaser.h:195
AudioBuffer< SampleType > bufferFrequency
Definition juce_Phaser.h:193
SampleType depth
Definition juce_Phaser.h:200
SmoothedValue< SampleType, ValueSmoothingTypes::Linear > oscVolume
Definition juce_Phaser.h:189
SampleType feedback
Definition juce_Phaser.h:200
void process(const ProcessContext &context) noexcept
Definition juce_Phaser.h:84
void setCentreFrequency(SampleType newCentreHz)
Definition juce_Phaser.cpp:66
SampleType mix
Definition juce_Phaser.h:200
Oscillator< SampleType > osc
Definition juce_Phaser.h:187
void setFeedback(SampleType newFeedback)
Definition juce_Phaser.cpp:75
std::vector< SmoothedValue< SampleType, ValueSmoothingTypes::Linear > > feedbackVolume
Definition juce_Phaser.h:190
Phaser()
Definition juce_Phaser.cpp:33
void setRate(SampleType newRateHz)
Definition juce_Phaser.cpp:48
SampleType centreFrequency
Definition juce_Phaser.h:201
int updateCounter
Definition juce_Phaser.h:197
void setMix(SampleType newMix)
Definition juce_Phaser.cpp:84
void setDepth(SampleType newDepth)
Definition juce_Phaser.cpp:57
SampleType rate
Definition juce_Phaser.h:200
OwnedArray< FirstOrderTPTFilter< SampleType > > filters
Definition juce_Phaser.h:188
SampleType normCentreFrequency
Definition juce_Phaser.h:194
register unsigned k
Definition inflate.c:946
register unsigned i
Definition inflate.c:1575
Definition juce_AudioBlock.h:29
Definition carla_juce.cpp:31
Type mapToLog10(Type value0To1, Type logRangeMin, Type logRangeMax)
Definition juce_MathsFunctions.h:144
constexpr Type jmin(Type a, Type b)
Definition juce_MathsFunctions.h:106
Type jlimit(Type lowerLimit, Type upperLimit, Type valueToConstrain) noexcept
Definition juce_MathsFunctions.h:262
Definition juce_ProcessContext.h:88
Definition juce_ProcessContext.h:38
int n
Definition crypt.c:458
typedef int(UZ_EXP MsgFn)()