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.

86 lines
2.7KB

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