aboutsummaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
authormick grierson <mickgrierson@gmail.com>2017-10-06 11:01:59 +0100
committermick grierson <mickgrierson@gmail.com>2017-10-06 11:01:59 +0100
commit3a5431836b7c8ad98459f3d6ff50e5bac1d2c297 (patch)
treea4ea8aa8c68b9b08095bcb4fc3926d8bed9bc810 /main.cpp
parent6c3d65be199ec74753e61ec026284fd3ebc71faa (diff)
2017
Diffstat (limited to 'main.cpp')
-rwxr-xr-xmain.cpp86
1 files changed, 7 insertions, 79 deletions
diff --git a/main.cpp b/main.cpp
index 9bd1025..eae6b10 100755
--- a/main.cpp
+++ b/main.cpp
@@ -1,88 +1,16 @@
-//#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"
-maxiOsc myOsc;
-maxiEnvelope myEnv;
-int counter;
-
-void setup() {
+//This shows how the fundamental building block of digital audio - the sine wave.
+//
+maxiOsc mySine;//One oscillator - can be called anything. Can be any of the available waveforms.
+void setup() {//some inits
+ //nothing to go here this time
}
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[0]=mySine.sinewave(440);
output[1]=output[0];
}
+