38 const juce::String& blockId)
40 float _delayMs = getParam(params, blockId);
42 if (delayMs != _delayMs)
61 const size_t lengthWithoutPreDelay = (ir.getNumSamples() - numSamplesToAdd);
63 if (numSamplesToAdd > 0)
67 float * irPtr = ir.getChannelPointer(0);
68 memmove(irPtr + numSamplesToAdd, irPtr, lengthWithoutPreDelay *
sizeof(
float));
71 memset(irPtr, 0, numSamplesToAdd *
sizeof(
float));
88 ir.setSize(ir.getNumChannels(),
89 ir.getNumSamples() + getNumSamplesToAdd(),
100 return (
int)std::ceil(sampleRate * (delayMs / 1000.0));
float getParam(const juce::AudioProcessorValueTreeState ¶ms, const juce::String &blockId) const
Internal method used to get (and check) a parameter's value.
int getNumSamplesToAdd()
Returns expected number of samples after processing.
virtual void updateParams(const juce::AudioProcessorValueTreeState ¶ms, const juce::String &blockId) override
Updates parameters from processor parameter tree.
void prepareIR(juce::AudioSampleBuffer &ir)
Resizes given IR before processing.
PreDelay(juce::AudioProcessor *processor)
Constructs a PreDelay object associated with an AudioProcessor.
virtual AudioBlock exec(AudioBlock ir) override
Applies predelay to impulse response.