Hi! I’m making a GUI App that’s a simple guitar clean booster/amplifier and i would like to add a reverb to it.

I’ve found this algorithm:

int numlines = 8;

float t1 = 50.0; // d0 time

float g1 = 0.75; // d0 gain

float rev = -3*t1 / log10 (g1);

for (int n = 0; n < numlines; ++n)

{

float dt = t1 / pow (2, (float (n) / numlines));

float g = pow (10, -((3*dt) / rev));

printf (“d%d t=%.3f g=%.3f\n”, n, dt, g);

}

And my getNextAudioBlock () is:

```
void getNextAudioBlock (const AudioSourceChannelInfo& bufferToFill) override
{
const float* inBuffer = bufferToFill.buffer->getReadPointer(selChannel);
float* outBufferL = bufferToFill.buffer->getWritePointer(0);
float* outBufferR = bufferToFill.buffer->getWritePointer(1);
for (int sample = 0; sample < bufferToFill.buffer->getNumSamples(); ++sample)
{
float x = level;
outBufferL[sample] = inBuffer[sample] * ((x > 0) ? (1 - exp( -x )) : (-1 + exp( x ))) * colour;
outBufferR[sample] = inBuffer[sample] * ((x > 0) ? (1 - exp( -x )) : (-1 + exp( x ))) * colour;
}
}
```

So, how can I implement the algorithm?