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.

100 lines
1.8KB

  1. // Reverb model declaration
  2. //
  3. // Written by Jezar at Dreampoint, June 2000
  4. // http://www.dreampoint.co.uk
  5. // This code is public domain
  6. // adapted for use in VCV Rack by Martin Lueders
  7. #ifndef _revmodel_
  8. #define _revmodel_
  9. #include <math.h>
  10. #include "comb.hpp"
  11. #include "allpass.hpp"
  12. #include "tuning.h"
  13. class revmodel
  14. {
  15. public:
  16. revmodel();
  17. void init(const float sampleRate);
  18. void mute();
  19. void process(const float input, float &outputL, float &outputR);
  20. void setroomsize(float value);
  21. float getroomsize();
  22. void setdamp(float value);
  23. float getdamp();
  24. void setwet(float value);
  25. float getwet();
  26. void setdry(float value);
  27. float getdry();
  28. void setwidth(float value);
  29. float getwidth();
  30. void setmode(float value);
  31. float getmode();
  32. private:
  33. void update();
  34. private:
  35. float gain;
  36. float roomsize,roomsize1;
  37. float damp,damp1, damp2;
  38. float feedback_allpass;
  39. float wet,wet1,wet2;
  40. float dry;
  41. float width;
  42. float mode;
  43. float conversion;
  44. float math_e = 2.71828;
  45. // The following are all declared inline
  46. // to remove the need for dynamic allocation
  47. // with its subsequent error-checking messiness
  48. // Comb filters
  49. comb combL[numcombs];
  50. comb combR[numcombs];
  51. // Allpass filters
  52. allpass allpassL[numallpasses];
  53. allpass allpassR[numallpasses];
  54. // Buffers for the combs
  55. float *bufcombL1;
  56. float *bufcombR1;
  57. float *bufcombL2;
  58. float *bufcombR2;
  59. float *bufcombL3;
  60. float *bufcombR3;
  61. float *bufcombL4;
  62. float *bufcombR4;
  63. float *bufcombL5;
  64. float *bufcombR5;
  65. float *bufcombL6;
  66. float *bufcombR6;
  67. float *bufcombL7;
  68. float *bufcombR7;
  69. float *bufcombL8;
  70. float *bufcombR8;
  71. // Buffers for the allpasses
  72. float *bufallpassL1;
  73. float *bufallpassR1;
  74. float *bufallpassL2;
  75. float *bufallpassR2;
  76. float *bufallpassL3;
  77. float *bufallpassR3;
  78. float *bufallpassL4;
  79. float *bufallpassR4;
  80. };
  81. #endif//_revmodel_
  82. //ends