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