Ok, I’ve found a very good start point in the plugin example…

Now i would like to add another effect, a reverb:

I’ve settled up all but the algorithm.

This is the code for ::applyDelay()

```
const int numSamples = buffer.getNumSamples();
const float delayLevel = *delayParam;
int delayPos = 0;
for (int channel = 0; channel < getTotalNumInputChannels(); ++channel)
{
FloatType* const channelData = buffer.getWritePointer (channel);
FloatType* const delayData = delayBuffer.getWritePointer (jmin (channel, delayBuffer.getNumChannels() - 1));
delayPos = delayPosition;
for (int i = 0; i < numSamples; ++i)
{
const FloatType in = channelData[i];
channelData[i] += delayData[delayPos];
delayData[delayPos] = (delayData[delayPos] + in) * delayLevel;
if (++delayPos >= delayBuffer.getNumSamples())
delayPos = 0;
}
}
delayPosition = delayPos;
```

But now i have a new template function named ::applyReverb()

I have this code for reverberation:

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);

}

The above with t1=50.0 and g1=0.75 yields:

d0 t=50.000 g=0.750

d1 t=45.850 g=0.768

d2 t=42.045 g=0.785

d3 t=38.555 g=0.801

d4 t=35.355 g=0.816

d5 t=32.421 g=0.830

d6 t=29.730 g=0.843

d7 t=27.263 g=0.855

How I can implement it in the ::applyReverb() template?