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.

68 lines
1.9KB

  1. /* SpiralSound
  2. * Copyleft (C) 2000 David Griffiths <dave@pawfal.org>
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17. */
  18. // Stereo module, different delay times for left and right, due to reverb
  19. // functionality.
  20. #include <math.h>
  21. #include "../../../SpiralInfo.h"
  22. #ifndef DELAY
  23. #define DELAY
  24. class Delay
  25. {
  26. public:
  27. Delay();
  28. ~Delay();
  29. void SetDelay(float s) {m_LeftDelay=s; m_RightDelay=s;}
  30. void SetRightDelay(float s) {m_RightDelay=s;}
  31. void SetLeftDelay(float s) {m_LeftDelay=s;}
  32. void SetNumChannels(int s) {m_Channels=s;}
  33. void SetFeedback(float s) {m_Feedback=s;}
  34. void SetBypass(bool s) {m_Bypass=s;}
  35. float GetDelay() {return GetLeftDelay();}
  36. float GetLeftDelay() {return m_LeftDelay;}
  37. float GetRightDelay() {return m_RightDelay;}
  38. float GetFeedback() {return m_Feedback;}
  39. float GetBypass() {return m_Bypass;}
  40. void GetOutput(Sample &data);
  41. void Randomise();
  42. private:
  43. Sample m_LeftBuffer;
  44. Sample m_RightBuffer;
  45. long m_LeftWrite;
  46. long m_RightWrite;
  47. float m_LeftDelay;
  48. float m_RightDelay;
  49. float m_Feedback;
  50. int m_Channels;
  51. bool m_Bypass;
  52. friend istream &operator>>(istream &s, Delay &o);
  53. friend ostream &operator<<(ostream &s, Delay &o);
  54. };
  55. istream &operator>>(istream &s, Delay &o);
  56. ostream &operator<<(ostream &s, Delay &o);
  57. #endif