Reverb.h (2860B)
1 /* 2 ZynAddSubFX - a software synthesizer 3 4 Reverb.h - Reverberation effect 5 Copyright (C) 2002-2009 Nasca Octavian Paul 6 Author: Nasca Octavian Paul 7 8 This program is free software; you can redistribute it and/or 9 modify it under the terms of the GNU General Public License 10 as published by the Free Software Foundation; either version 2 11 of the License, or (at your option) any later version. 12 */ 13 14 #ifndef REVERB_H 15 #define REVERB_H 16 17 #include "Effect.h" 18 19 #define REV_COMBS 8 20 #define REV_APS 4 21 22 namespace zyn { 23 24 /**Creates Reverberation Effects*/ 25 class Reverb final:public Effect 26 { 27 public: 28 Reverb(EffectParams pars); 29 ~Reverb(); 30 void out(const Stereo<float *> &smp); 31 void cleanup(void); 32 33 unsigned char getpresetpar(unsigned char npreset, unsigned int npar); 34 void setpreset(unsigned char npreset); 35 void changepar(int npar, unsigned char value); 36 unsigned char getpar(int npar) const; 37 38 static rtosc::Ports ports; 39 private: 40 //Parametrii 41 unsigned char Pvolume; 42 unsigned char Ptime; //duration 43 unsigned char Pidelay; //initial delay 44 unsigned char Pidelayfb; //initial feedback 45 unsigned char Plpf; 46 unsigned char Phpf; 47 unsigned char Plohidamp; //Low/HighFrequency Damping 48 unsigned char Ptype; //reverb type 49 unsigned char Proomsize; //room size 50 unsigned char Pbandwidth; //bandwidth 51 52 //parameter control 53 void setvolume(unsigned char _Pvolume); 54 void settime(unsigned char _Ptime); 55 void setlohidamp(unsigned char _Plohidamp); 56 void setidelay(unsigned char _Pidelay); 57 void setidelayfb(unsigned char _Pidelayfb); 58 void sethpf(unsigned char _Phpf); 59 void setlpf(unsigned char _Plpf); 60 void settype(unsigned char _Ptype); 61 void setroomsize(unsigned char _Proomsize); 62 void setbandwidth(unsigned char _Pbandwidth); 63 void processmono(int ch, float *output, float *inputbuf); 64 65 66 //Parameters 67 int lohidamptype; //0=disable, 1=highdamp (lowpass), 2=lowdamp (highpass) 68 int idelaylen; 69 int idelayk; 70 float lohifb; 71 float idelayfb; 72 float roomsize; 73 float rs; //rs is used to "normalise" the volume according to the roomsize 74 int comblen[REV_COMBS * 2]; 75 int aplen[REV_APS * 2]; 76 class Unison * bandwidth; 77 78 //Internal Variables 79 float *comb[REV_COMBS * 2]; 80 int combk[REV_COMBS * 2]; 81 float combfb[REV_COMBS * 2]; //feedback-ul fiecarui filtru "comb" 82 float lpcomb[REV_COMBS * 2]; //pentru Filtrul LowPass 83 float *ap[REV_APS * 2]; 84 int apk[REV_APS * 2]; 85 float *idelay; 86 class AnalogFilter * lpf, *hpf; //filters 87 }; 88 89 } 90 91 #endif