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.

87 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. static rtosc::Ports ports;
  28. private:
  29. //Parametrii
  30. unsigned char Pvolume;
  31. unsigned char Ptime; //duration
  32. unsigned char Pidelay; //initial delay
  33. unsigned char Pidelayfb; //initial feedback
  34. unsigned char Plpf;
  35. unsigned char Phpf;
  36. unsigned char Plohidamp; //Low/HighFrequency Damping
  37. unsigned char Ptype; //reverb type
  38. unsigned char Proomsize; //room size
  39. unsigned char Pbandwidth; //bandwidth
  40. //parameter control
  41. void setvolume(unsigned char _Pvolume);
  42. void settime(unsigned char _Ptime);
  43. void setlohidamp(unsigned char _Plohidamp);
  44. void setidelay(unsigned char _Pidelay);
  45. void setidelayfb(unsigned char _Pidelayfb);
  46. void sethpf(unsigned char _Phpf);
  47. void setlpf(unsigned char _Plpf);
  48. void settype(unsigned char _Ptype);
  49. void setroomsize(unsigned char _Proomsize);
  50. void setbandwidth(unsigned char _Pbandwidth);
  51. void processmono(int ch, float *output, float *inputbuf);
  52. //Parameters
  53. int lohidamptype; //0=disable, 1=highdamp (lowpass), 2=lowdamp (highpass)
  54. int idelaylen;
  55. int idelayk;
  56. float lohifb;
  57. float idelayfb;
  58. float roomsize;
  59. float rs; //rs is used to "normalise" the volume according to the roomsize
  60. int comblen[REV_COMBS * 2];
  61. int aplen[REV_APS * 2];
  62. class Unison * bandwidth;
  63. //Internal Variables
  64. float *comb[REV_COMBS * 2];
  65. int combk[REV_COMBS * 2];
  66. float combfb[REV_COMBS * 2]; //feedback-ul fiecarui filtru "comb"
  67. float lpcomb[REV_COMBS * 2]; //pentru Filtrul LowPass
  68. float *ap[REV_APS * 2];
  69. int apk[REV_APS * 2];
  70. float *idelay;
  71. class AnalogFilter * lpf, *hpf; //filters
  72. };
  73. #endif