diff options
Diffstat (limited to 'main.cpp')
| -rwxr-xr-x | main.cpp | 100 |
1 files changed, 49 insertions, 51 deletions
@@ -1,90 +1,88 @@ -#include "maximilian.h" - -maxiOsc myOsc; -maxiEnvelope myEnv; -int counter; -double vals[12]={1,0.1,0.5,0.0,1.5,0.0,0.1,1,1.0,0.15,1.0,0.1}; -std::vector<double> rampsA(vals, vals+12); - - -void setup() {//some inits - - myEnv.note(true); - -} - -void play(double *output) {//this is where the magic happens. Very slow magic. - - counter++; - - if (counter ==0 || counter % 330400==0) { - myEnv.note(true); - } - - - double out = myEnv.ramps(rampsA); - - output[0]=myOsc.sinewave(440)*out; - - output[1]=output[0]; -} - - //#include "maximilian.h" // //maxiOsc myOsc; //maxiEnvelope myEnv; //int counter; +//double vals[12]={1,0.1,0.5,0.0,1.5,0.0,0.1,1,1.0,0.15,1.0,0.1}; +//std::vector<double> rampsA(vals, vals+12); +// +// +//void setup() {//some inits +// +// myEnv.trigger(true); // -//void setup() { -// cout << myEnv.trigger << endl; //} // -//void play(double *output) { +//void play(double *output) {//this is where the magic happens. Very slow magic. // +// counter++; // -// if (counter ==0 || counter % 88201==0) { -// myEnv.note(true); +// if (counter ==0 || counter % 330400==0) { +// myEnv.trigger(true); // } // -// if (counter % 44100==0) { -// myEnv.note(false); -// } // -// counter++; +// double out = myEnv.ramps(rampsA); // -// double out = myEnv.adsr(); -// // output[0]=myOsc.sinewave(440)*out; -// +// // output[1]=output[0]; -// //} + //#include "maximilian.h" // //maxiOsc myOsc; //maxiEnvelope myEnv; -//int counter; +//int counter=0; // //void setup() { -// cout << myEnv.trigger << endl; //} // //void play(double *output) { // // -// if (counter ==0 || counter % 88200==0) { -// myEnv.note(true); +// if (counter ==0 || counter % 17640==0) { +// myEnv.trigger(true); // } // +// if (counter % 8821==0) { +// myEnv.trigger(false); +// } // // counter++; // -// double out = myEnv.ar(1,1); -// +// double out = myEnv.adsr(0.1,0.2,0.1,3); +// // output[0]=myOsc.sinewave(440)*out; // // output[1]=output[0]; // //} + +#include "maximilian.h" + +maxiOsc myOsc; +maxiEnvelope myEnv; +int counter; + +void setup() { +} + +void play(double *output) { + + + if (counter ==0 || counter % 8820==0) { + myEnv.trigger(true); + } + + + counter++; + + double out = myEnv.ar(0.01,1); + + output[0]=myOsc.sinewave(440)*out; + + output[1]=output[0]; + +} |
