1 // Comb filter class declaration
\r
3 // Written by Jezar at Dreampoint, June 2000
\r
4 // http://www.dreampoint.co.uk
\r
5 // This code is public domain
\r
10 #include "denormals.h"
\r
16 void setbuffer(float *buf, int size);
\r
17 inline float process(float inp);
\r
19 void setdamp(float val);
\r
21 void setfeedback(float val);
\r
22 float getfeedback();
\r
34 // Big to inline - but crucial for speed
\r
36 inline float comb::process(float input)
\r
40 output = buffer[bufidx];
\r
41 undenormalise(output);
\r
43 filterstore = (output*damp2) + (filterstore*damp1);
\r
44 undenormalise(filterstore);
\r
46 buffer[bufidx] = input + (filterstore*feedback);
\r
48 if(++bufidx>=bufsize) bufidx = 0;
\r