feat(fx): add effect rack and effect units
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
#pragma once
|
||||
|
||||
#include "../FXProcessor.h"
|
||||
#include "Biquad.h"
|
||||
|
||||
namespace serum
|
||||
{
|
||||
|
||||
// ===========================================================================
|
||||
// Hyper — an OTT-style three-band upward/downward compressor. p[0]=intensity,
|
||||
// p[1]=low amount, p[2]=high amount, p[3]=output.
|
||||
// ===========================================================================
|
||||
class HyperUnit : 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:
|
||||
struct Band
|
||||
{
|
||||
float env = 0.0f;
|
||||
float gain = 1.0f;
|
||||
};
|
||||
|
||||
double sr = 44100.0;
|
||||
Biquad lpL, lpR, hpL, hpR;
|
||||
Band bL[3], bR[3];
|
||||
|
||||
float computeGain (Band& band, float absIn, float intensity) noexcept;
|
||||
};
|
||||
|
||||
} // namespace serum
|
||||
Reference in New Issue
Block a user