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