feat(fx): add effect rack and effect units

This commit is contained in:
2026-09-08 14:55:22 +02:00
parent 4021b9cdf7
commit 5a80534a2e
21 changed files with 1104 additions and 0 deletions
+33
View File
@@ -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