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.

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