aboutsummaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main.cpp')
-rwxr-xr-xmain.cpp92
1 files changed, 79 insertions, 13 deletions
diff --git a/main.cpp b/main.cpp
index d7ca862..9bd1025 100755
--- a/main.cpp
+++ b/main.cpp
@@ -1,22 +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.trigger(true);
+//
+//}
+//
+//void play(double *output) {//this is where the magic happens. Very slow magic.
+//
+// counter++;
+//
+// if (counter ==0 || counter % 330400==0) {
+// myEnv.trigger(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=0;
+//
+//void setup() {
+//}
+//
+//void play(double *output) {
+//
+//
+// if (counter ==0 || counter % 17640==0) {
+// myEnv.trigger(true);
+// }
+//
+// if (counter % 8821==0) {
+// myEnv.trigger(false);
+// }
+//
+// counter++;
+//
+// double out = myEnv.adsr(0.1,0.2,0.1,3);
+//
+// output[0]=myOsc.sinewave(440)*out;
+//
+// output[1]=output[0];
+//
+//}
+
#include "maximilian.h"
-maxiSample beats; //We give our sample a name. It's called beats this time. We could have loads of them, but they have to have different names.
+maxiOsc myOsc;
+maxiEnvelope myEnv;
+int counter;
-void setup() {//some inits
-
- beats.load("/Users/michaelgrierson/Documents/workspace/Maximilian/beat2.wav");//load in your samples. Provide the full path to a wav file.
- printf("Summary:\n%s", beats.getSummary());//get info on samples if you like.
- cout << beats.getLength();
-
+void setup() {
}
-void play(double *output) {//this is where the magic happens. Very slow magic.
+void play(double *output) {
+
- //output[0]=beats.play();//just play the file. Looping is default for all play functions.
- output[0]=beats.play(0.68);//play the file with a speed setting. 1. is normal speed.
- //output[0]=beats.play(0.5,0,44100);//linear interpolationplay with a frequency input, start point and end point. Useful for syncing.
- //output[0]=beats.play4(0.5,0,44100);//cubic interpolation play with a frequency input, start point and end point. Useful for syncing.
+ 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];
+
}
-