Scape.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. Scape.h
  3. Copyright 2004-5 Tim Goetze <tim@quitte.de>
  4. http://quitte.de/dsp/
  5. */
  6. /*
  7. This program is free software; you can redistribute it and/or
  8. modify it under the terms of the GNU General Public License
  9. as published by the Free Software Foundation; either version 2
  10. of the License, or (at your option) any later version.
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. GNU General Public License for more details.
  15. You should have received a copy of the GNU General Public License
  16. along with this program; if not, write to the Free Software
  17. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  18. 02111-1307, USA or point your web browser to http://www.gnu.org.
  19. */
  20. #ifndef _SCAPE_H_
  21. #define _SCAPE_H_
  22. #include "dsp/Sine.h"
  23. #include "dsp/Roessler.h"
  24. #include "dsp/Lorenz.h"
  25. #include "dsp/Delay.h"
  26. #include "dsp/OnePole.h"
  27. #include "dsp/BiQuad.h"
  28. #include "dsp/RBJ.h"
  29. #include "dsp/SVF.h"
  30. typedef DSP::SVF<1> SVF;
  31. class Scape
  32. : public Plugin
  33. {
  34. public:
  35. sample_t time, fb;
  36. double period;
  37. DSP::Lorenz lfo[2];
  38. DSP::Delay delay;
  39. SVF svf[4];
  40. DSP::OnePoleHP hipass[4];
  41. template <sample_func_t>
  42. void one_cycle (int frames);
  43. public:
  44. static PortInfo port_info [];
  45. void init()
  46. {
  47. delay.init ((int) (2.01 * fs)); /* two seconds = 30 bpm + */
  48. for (int i = 0; i < 2; ++i)
  49. lfo[i].init(),
  50. lfo[i].set_rate (.00000001 * fs);
  51. }
  52. void activate();
  53. void run (int n)
  54. {
  55. one_cycle<store_func> (n);
  56. }
  57. void run_adding (int n)
  58. {
  59. one_cycle<adding_func> (n);
  60. }
  61. };
  62. #endif /* _SCAPE_H_ */