summaryrefslogtreecommitdiffstats
path: root/arts/modules/effects/freeverb/allpass.h
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2020-12-08 22:26:17 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2020-12-08 22:26:17 +0900
commitfce86b22a2367f1be1f9aae5e1ba3d18d1371b74 (patch)
tree707fe84fef0569a152e632ce1e16407f9d19a3d2 /arts/modules/effects/freeverb/allpass.h
parent41fa1afc2c571b909acd0312e4eebb4a0b21e3c2 (diff)
downloadtdemultimedia-fce86b22a2367f1be1f9aae5e1ba3d18d1371b74.tar.gz
tdemultimedia-fce86b22a2367f1be1f9aae5e1ba3d18d1371b74.zip
Renaming of files in preparation for code style tools.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'arts/modules/effects/freeverb/allpass.h')
-rw-r--r--arts/modules/effects/freeverb/allpass.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/arts/modules/effects/freeverb/allpass.h b/arts/modules/effects/freeverb/allpass.h
new file mode 100644
index 00000000..853c7d41
--- /dev/null
+++ b/arts/modules/effects/freeverb/allpass.h
@@ -0,0 +1,48 @@
+// 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"
+
+class allpass
+{
+public:
+ allpass();
+ void setbuffer(float *buf, int size);
+ inline float process(float inp);
+ void mute();
+ void setfeedback(float val);
+ float getfeedback();
+// private:
+ float feedback;
+ float *buffer;
+ int bufsize;
+ int bufidx;
+};
+
+
+// Big to inline - but crucial for speed
+
+inline float allpass::process(float input)
+{
+ float output;
+ float bufout;
+
+ bufout = buffer[bufidx];
+ undenormalise(bufout);
+
+ output = -input + bufout;
+ buffer[bufidx] = input + (bufout*feedback);
+
+ if(++bufidx>=bufsize) bufidx = 0;
+
+ return output;
+}
+
+#endif//_allpass
+
+//ends