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