-// Allpass filter declaration\r
-//\r
-// Written by Jezar at Dreampoint, June 2000\r
-// http://www.dreampoint.co.uk\r
-// This code is public domain\r
-\r
-#ifndef _allpass_\r
-#define _allpass_\r
-#include "denormals.h"\r
-\r
-class allpass\r
-{\r
-public:\r
- allpass();\r
- void setbuffer(float *buf, int size);\r
- inline float process(float inp);\r
- void mute();\r
- void setfeedback(float val);\r
- float getfeedback();\r
-// private:\r
- float feedback;\r
- float *buffer;\r
- int bufsize;\r
- int bufidx;\r
-};\r
-\r
-\r
-// Big to inline - but crucial for speed\r
-\r
-inline float allpass::process(float input)\r
-{\r
- float output;\r
- float bufout;\r
- \r
- bufout = buffer[bufidx];\r
- undenormalise(bufout);\r
- \r
- output = -input + bufout;\r
- buffer[bufidx] = input + (bufout*feedback);\r
-\r
- if(++bufidx>=bufsize) bufidx = 0;\r
-\r
- return output;\r
-}\r
-\r
-#endif//_allpass\r
-\r
-//ends\r
-\r
-\r
-\r
-\r
-\r