#pragma once #include "../FXProcessor.h" namespace serum { // =========================================================================== // Delay — stereo delay with feedback, damping and ping-pong. p[0]=time, // p[1]=feedback, p[2]=damping, p[3]=ping-pong/width. // =========================================================================== class DelayUnit : public FXUnit { public: void prepare (double sampleRate, int maxBlockSize) override; void reset() override; void process (float* l, float* r, int numSamples, const float p[4]) override; private: double sr = 44100.0; std::vector delayL, delayR; int writePos = 0; float dampL = 0.0f, dampR = 0.0f; }; } // namespace serum