35template <
typename SampleType>
65 template <
typename ProcessContext>
66 void process (
const ProcessContext& context)
noexcept
68 const auto& inputBlock = context.getInputBlock();
69 auto& outputBlock = context.getOutputBlock();
70 const auto numChannels = outputBlock.getNumChannels();
71 const auto numSamples = outputBlock.getNumSamples();
73 jassert (inputBlock.getNumChannels() == numChannels);
74 jassert (inputBlock.getNumSamples() == numSamples);
76 if (context.isBypassed)
78 outputBlock.copyFrom (inputBlock);
82 for (
size_t channel = 0; channel < numChannels; ++channel)
84 auto* inputSamples = inputBlock .getChannelPointer (channel);
85 auto* outputSamples = outputBlock.getChannelPointer (channel);
87 for (
size_t i = 0; i < numSamples; ++i)
88 outputSamples[i] =
processSample ((
int) channel, inputSamples[i]);
93 SampleType
processSample (
int channel, SampleType inputValue);
100 SampleType threshold, thresholdInverse, ratioInverse;
103 double sampleRate = 44100.0;
104 SampleType thresholddB = 0.0, ratio = 1.0, attackTime = 1.0, releaseTime = 100.0;
void setThreshold(SampleType newThreshold)
SampleType processSample(int channel, SampleType inputValue)
void process(const ProcessContext &context) noexcept
void prepare(const ProcessSpec &spec)
void setAttack(SampleType newAttack)
void setRelease(SampleType newRelease)
void setRatio(SampleType newRatio)