Added DaisySP

This commit is contained in:
2026-04-24 14:46:05 +02:00
parent 82190216c3
commit dd63b3aed4
96 changed files with 10613 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
#include "dsp.h"
#include "limiter.h"
#define SLOPE(out, in, positive, negative) \
{ \
float error = (in)-out; \
out += (error > 0 ? positive : negative) * error; \
}
namespace daisysp
{
void Limiter::Init()
{
peak_ = 0.5f;
}
void Limiter::ProcessBlock(float *in, size_t size, float pre_gain)
{
while(size--)
{
float pre = *in * pre_gain;
float peak = fabsf(pre);
SLOPE(peak_, peak, 0.05f, 0.00002f);
float gain = (peak_ <= 1.0f ? 1.0f : 1.0f / peak_);
*in++ = SoftLimit(pre * gain * 0.7f);
}
}
} //namespace daisysp