Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Reverb.h 3.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. ZynAddSubFX - a software synthesizer
  3. Reverb.h - Reverberation effect
  4. Copyright (C) 2002-2009 Nasca Octavian Paul
  5. Author: Nasca Octavian Paul
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of version 2 of the GNU General Public License
  8. as published by the Free Software Foundation.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License (version 2 or later) for more details.
  13. You should have received a copy of the GNU General Public License (version 2)
  14. along with this program; if not, write to the Free Software Foundation,
  15. Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  16. */
  17. #ifndef REVERB_H
  18. #define REVERB_H
  19. #include "Effect.h"
  20. #define REV_COMBS 8
  21. #define REV_APS 4
  22. /**Creates Reverberation Effects*/
  23. class Reverb:public Effect
  24. {
  25. public:
  26. Reverb(bool insertion_, float *efxoutl_, float *efxoutr_, unsigned int srate, int bufsize);
  27. ~Reverb();
  28. void out(const Stereo<float *> &smp);
  29. void cleanup(void);
  30. void setpreset(unsigned char npreset);
  31. void changepar(int npar, unsigned char value);
  32. unsigned char getpar(int npar) const;
  33. private:
  34. //Parametrii
  35. unsigned char Pvolume;
  36. unsigned char Ptime; //duration
  37. unsigned char Pidelay; //initial delay
  38. unsigned char Pidelayfb; //initial feedback
  39. unsigned char Plpf;
  40. unsigned char Phpf;
  41. unsigned char Plohidamp; //Low/HighFrequency Damping
  42. unsigned char Ptype; //reverb type
  43. unsigned char Proomsize; //room size
  44. unsigned char Pbandwidth; //bandwidth
  45. //parameter control
  46. void setvolume(unsigned char _Pvolume);
  47. void settime(unsigned char _Ptime);
  48. void setlohidamp(unsigned char _Plohidamp);
  49. void setidelay(unsigned char _Pidelay);
  50. void setidelayfb(unsigned char _Pidelayfb);
  51. void sethpf(unsigned char _Phpf);
  52. void setlpf(unsigned char _Plpf);
  53. void settype(unsigned char _Ptype);
  54. void setroomsize(unsigned char _Proomsize);
  55. void setbandwidth(unsigned char _Pbandwidth);
  56. void processmono(int ch, float *output, float *inputbuf);
  57. //Parameters
  58. int lohidamptype; //0=disable, 1=highdamp (lowpass), 2=lowdamp (highpass)
  59. int idelaylen;
  60. int idelayk;
  61. float lohifb;
  62. float idelayfb;
  63. float roomsize;
  64. float rs; //rs is used to "normalise" the volume according to the roomsize
  65. int comblen[REV_COMBS * 2];
  66. int aplen[REV_APS * 2];
  67. class Unison * bandwidth;
  68. //Internal Variables
  69. float *comb[REV_COMBS * 2];
  70. int combk[REV_COMBS * 2];
  71. float combfb[REV_COMBS * 2]; //feedback-ul fiecarui filtru "comb"
  72. float lpcomb[REV_COMBS * 2]; //pentru Filtrul LowPass
  73. float *ap[REV_APS * 2];
  74. int apk[REV_APS * 2];
  75. float *idelay;
  76. class AnalogFilter * lpf, *hpf; //filters
  77. };
  78. #endif