From e40fc849149dd97c248866a4a1d026dda5e57b62 Mon Sep 17 00:00:00 2001 From: Robert Jonsson Date: Mon, 7 Mar 2011 19:01:11 +0000 Subject: clean3 --- attic/muse2-oom/muse2/plugins/freeverb/comb.h | 66 +++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 attic/muse2-oom/muse2/plugins/freeverb/comb.h (limited to 'attic/muse2-oom/muse2/plugins/freeverb/comb.h') diff --git a/attic/muse2-oom/muse2/plugins/freeverb/comb.h b/attic/muse2-oom/muse2/plugins/freeverb/comb.h new file mode 100644 index 00000000..d2e0f871 --- /dev/null +++ b/attic/muse2-oom/muse2/plugins/freeverb/comb.h @@ -0,0 +1,66 @@ +// Comb filter class declaration +// +// Written by Jezar at Dreampoint, June 2000 +// http://www.dreampoint.co.uk +// This code is public domain + +#ifndef _comb_ +#define _comb_ + +#include "denormals.h" + + +//--------------------------------------------------------- +// comb +//--------------------------------------------------------- + +class comb + { + float feedback; + float filterstore; + float damp1; + float damp2; + float *buffer; + int bufsize; + int bufidx; + +public: + comb() { + filterstore = 0; + bufidx = 0; + } + void setbuffer(float *buf, int size) { + buffer = buf; + bufsize = size; + } + float process(float input) { + float output = buffer[bufidx]; + undenormalise(output); + filterstore = (output*damp2) + (filterstore*damp1); + undenormalise(filterstore); + buffer[bufidx] = input + (filterstore*feedback); + if (++bufidx >= bufsize) + bufidx = 0; +// bufidx = ++bufidx % bufsize; + return output; + } + void mute() { + for (int i=0; i