temp-cortex limiter dump
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
|
||||
#include "limiter_base.hpp"
|
||||
#include "CircularBuffer.h"
|
||||
|
||||
class FastLimiter : public LimiterBase
|
||||
{
|
||||
protected:
|
||||
// Lookahead buffer for clean limiting
|
||||
CircularBuffer<float, uint8_t>* delayBufferLeft;
|
||||
CircularBuffer<float, uint8_t>* delayBufferRight;
|
||||
|
||||
// Lookahead parameters
|
||||
float lookaheadMs;
|
||||
uint8_t lookaheadSamples;
|
||||
|
||||
// Envelope following
|
||||
float envelope;
|
||||
float peakHold;
|
||||
uint8_t peakHoldCounter;
|
||||
uint8_t peakHoldSamples;
|
||||
|
||||
// Internal gain smoothing
|
||||
float currentGain;
|
||||
|
||||
public:
|
||||
FastLimiter(float sampleRate, float lookaheadMs = 5.0f);
|
||||
~FastLimiter();
|
||||
|
||||
void setPeakHold(float peakHoldMs);
|
||||
void process(float input[2], float thresholdDb = -3.0f, float ceilingDb = -0.1f) override;
|
||||
|
||||
private:
|
||||
float analyzeLevel(float left, float right);
|
||||
};
|
||||
Reference in New Issue
Block a user