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.

96 lines
2.6KB

  1. /*
  2. ZynAddSubFX - a software synthesizer
  3. Echo.h - Echo Effect
  4. Copyright (C) 2002-2005 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 ECHO_H
  12. #define ECHO_H
  13. #include "Effect.h"
  14. #include "../Misc/Stereo.h"
  15. /**Echo Effect*/
  16. class Echo:public Effect
  17. {
  18. public:
  19. Echo(EffectParams pars);
  20. ~Echo();
  21. void out(const Stereo<float *> &input);
  22. void setpreset(unsigned char npreset);
  23. /**
  24. * Sets the value of the chosen variable
  25. *
  26. * The possible parameters are:
  27. * -# Volume
  28. * -# Panning
  29. * -# Delay
  30. * -# L/R Delay
  31. * -# L/R Crossover
  32. * -# Feedback
  33. * -# Dampening
  34. * @param npar number of chosen parameter
  35. * @param value the new value
  36. */
  37. void changepar(int npar, unsigned char value);
  38. /**
  39. * Gets the specified parameter
  40. *
  41. * The possible parameters are
  42. * -# Volume
  43. * -# Panning
  44. * -# Delay
  45. * -# L/R Delay
  46. * -# L/R Crossover
  47. * -# Feedback
  48. * -# Dampening
  49. * @param npar number of chosen parameter
  50. * @return value of parameter
  51. */
  52. unsigned char getpar(int npar) const;
  53. int getnumparams(void);
  54. void cleanup(void);
  55. private:
  56. //Parameters
  57. unsigned char Pvolume; /**<#1 Volume or Dry/Wetness*/
  58. unsigned char Pdelay; /**<#3 Delay of the Echo*/
  59. unsigned char Plrdelay; /**<#4 L/R delay difference*/
  60. unsigned char Pfb; /**<#6Feedback*/
  61. unsigned char Phidamp; /**<#7Dampening of the Echo*/
  62. void setvolume(unsigned char _Pvolume);
  63. void setdelay(unsigned char _Pdelay);
  64. void setlrdelay(unsigned char _Plrdelay);
  65. void setfb(unsigned char _Pfb);
  66. void sethidamp(unsigned char _Phidamp);
  67. //Real Parameters
  68. float fb, hidamp;
  69. //Left/Right delay lengths
  70. Stereo<int> delayTime;
  71. float lrdelay;
  72. float avgDelay;
  73. void initdelays(void);
  74. //2 channel ring buffer
  75. Stereo<float *> delay;
  76. Stereo<float> old;
  77. //position of reading/writing from delaysample
  78. Stereo<int> pos;
  79. //step size for delay buffer
  80. Stereo<int> delta;
  81. Stereo<int> ndelta;
  82. };
  83. #endif