feat(fx): add effect rack and effect units
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
#pragma once
|
||||
|
||||
#include "../FXProcessor.h"
|
||||
|
||||
namespace serum
|
||||
{
|
||||
|
||||
// ===========================================================================
|
||||
// Reverb — Freeverb-style Schroeder reverb (8 combs + 4 allpasses per channel)
|
||||
// with predelay. p[0]=size, p[1]=damping, p[2]=width, p[3]=predelay.
|
||||
// ===========================================================================
|
||||
class ReverbUnit : 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::array<std::vector<float>, 8> combL, combR;
|
||||
std::array<int, 8> combPosL {}, combPosR {};
|
||||
std::array<float, 8> combFiltL {}, combFiltR {};
|
||||
|
||||
std::array<std::vector<float>, 4> apL, apR;
|
||||
std::array<int, 4> apPosL {}, apPosR {};
|
||||
|
||||
std::vector<float> preL, preR;
|
||||
int prePos = 0;
|
||||
};
|
||||
|
||||
} // namespace serum
|
||||
Reference in New Issue
Block a user