add auto zoombar/status color, fix 3 batchrender boobies, rotate plugin tweaks, add...
[goodguy/cinelerra.git] / cinelerra-5.1 / plugins / freeverb / Components / allpass.hpp
1 // Allpass filter declaration\r
2 //\r
3 // Written by Jezar at Dreampoint, June 2000\r
4 // http://www.dreampoint.co.uk\r
5 // This code is public domain\r
6 \r
7 #ifndef _allpass_\r
8 #define _allpass_\r
9 #include "denormals.h"\r
10 \r
11 class allpass\r
12 {\r
13 public:\r
14                                         allpass();\r
15                         void    setbuffer(float *buf, int size);\r
16         inline  float   process(float inp);\r
17                         void    mute();\r
18                         void    setfeedback(float val);\r
19                         float   getfeedback();\r
20 // private:\r
21         float   feedback;\r
22         float   *buffer;\r
23         int             bufsize;\r
24         int             bufidx;\r
25 };\r
26 \r
27 \r
28 // Big to inline - but crucial for speed\r
29 \r
30 inline float allpass::process(float input)\r
31 {\r
32         float output;\r
33         float bufout;\r
34         \r
35         bufout = buffer[bufidx];\r
36         undenormalise(bufout);\r
37         \r
38         output = -input + bufout;\r
39         buffer[bufidx] = input + (bufout*feedback);\r
40 \r
41         if(++bufidx>=bufsize) bufidx = 0;\r
42 \r
43         return output;\r
44 }\r
45 \r
46 #endif//_allpass\r
47 \r
48 //ends\r
49 \r
50 \r
51 \r
52 \r
53 \r