ambivalence/Source/DSP/SAPFStage.cpp
2026-08-15 15:36:28 +02:00

21 lines
No EOL
546 B
C++

#include "SAPFStage.h"
namespace FDNReverb {
void SAPFStage::prepare(const juce::dsp::ProcessSpec& spec, int delayTargetSamples) {
M = delayTargetSamples;
dl.prepare(spec);
dl.setMaximumDelayInSamples(M + 4);
dl.setDelay(static_cast<float>(M));
}
float SAPFStage::tick(float x) noexcept {
float d = dl.popSample(0);
float w = x + gain * d;
dl.pushSample(0, w);
return d - gain * w;
}
void SAPFStage::reset() noexcept { dl.reset(); }
} // namespace FDNReverb