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.

98 lines
3.3KB

  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 Prdelay; //delay between ER/Reverbs
  40. unsigned char Perbalance; //EarlyReflections/Reverb Balance
  41. unsigned char Plpf;
  42. unsigned char Phpf;
  43. unsigned char Plohidamp; //Low/HighFrequency Damping
  44. unsigned char Ptype; //reverb type
  45. unsigned char Proomsize; //room size
  46. unsigned char Pbandwidth; //bandwidth
  47. //parameter control
  48. void setvolume(unsigned char _Pvolume);
  49. void settime(unsigned char _Ptime);
  50. void setlohidamp(unsigned char _Plohidamp);
  51. void setidelay(unsigned char _Pidelay);
  52. void setidelayfb(unsigned char _Pidelayfb);
  53. void sethpf(unsigned char _Phpf);
  54. void setlpf(unsigned char _Plpf);
  55. void settype(unsigned char _Ptype);
  56. void setroomsize(unsigned char _Proomsize);
  57. void setbandwidth(unsigned char _Pbandwidth);
  58. void processmono(int ch, float *output, float *inputbuf);
  59. float erbalance;
  60. //Parameters
  61. int lohidamptype; //0=disable, 1=highdamp (lowpass), 2=lowdamp (highpass)
  62. int idelaylen, rdelaylen;
  63. int idelayk;
  64. float lohifb;
  65. float idelayfb;
  66. float roomsize;
  67. float rs; //rs is used to "normalise" the volume according to the roomsize
  68. int comblen[REV_COMBS * 2];
  69. int aplen[REV_APS * 2];
  70. class Unison * bandwidth;
  71. //Internal Variables
  72. float *comb[REV_COMBS * 2];
  73. int combk[REV_COMBS * 2];
  74. float combfb[REV_COMBS * 2]; //feedback-ul fiecarui filtru "comb"
  75. float lpcomb[REV_COMBS * 2]; //pentru Filtrul LowPass
  76. float *ap[REV_APS * 2];
  77. int apk[REV_APS * 2];
  78. float *idelay;
  79. class AnalogFilter * lpf, *hpf; //filters
  80. };
  81. #endif