ToneStack.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /*
  2. ToneStack.h
  3. Copyright 2006-7
  4. David Yeh <dtyeh@ccrma.stanford.edu>
  5. Tim Goetze <tim@quitte.de> (cosmetics)
  6. Tone Stack emulation.
  7. */
  8. /*
  9. This program is free software; you can redistribute it and/or
  10. modify it under the terms of the GNU General Public License
  11. as published by the Free Software Foundation; either version 2
  12. of the License, or (at your option) any later version.
  13. This program is distributed in the hope that it will be useful,
  14. but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. GNU General Public License for more details.
  17. You should have received a copy of the GNU General Public License
  18. along with this program; if not, write to the Free Software
  19. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  20. 02111-1307, USA or point your web browser to http://www.gnu.org.
  21. */
  22. #ifndef _TONESTACK_H_
  23. #define _TONESTACK_H_
  24. #include "dsp/util.h"
  25. #include "dsp/windows.h"
  26. #include "dsp/ToneStack.h"
  27. class ToneStack
  28. : public Plugin
  29. {
  30. private:
  31. DSP::ToneStack tonestack;
  32. template <sample_func_t F>
  33. void one_cycle (int frames);
  34. public:
  35. static PortInfo port_info [];
  36. void init()
  37. {
  38. tonestack.init (fs);
  39. }
  40. void activate();
  41. void run (int n)
  42. {
  43. one_cycle<store_func> (n);
  44. }
  45. void run_adding (int n)
  46. {
  47. one_cycle<adding_func> (n);
  48. }
  49. };
  50. /* /////////////////////////////////////////////////////////////////////// */
  51. class ToneStackLT
  52. : public Plugin
  53. {
  54. private:
  55. DSP::ToneStackLT tonestack;
  56. template <sample_func_t F>
  57. void one_cycle (int frames);
  58. public:
  59. static PortInfo port_info [];
  60. void init()
  61. {
  62. tonestack.init (fs);
  63. }
  64. void activate()
  65. { tonestack.activate (ports + 1); }
  66. void run (int n)
  67. {
  68. one_cycle<store_func> (n);
  69. }
  70. void run_adding (int n)
  71. {
  72. one_cycle<adding_func> (n);
  73. }
  74. };
  75. #endif /* _TONESTACK_H_ */