diff options
| author | Mick Grierson <mickgrierson@strangebook.lan> | 2011-10-10 00:34:25 +0100 |
|---|---|---|
| committer | Mick Grierson <mickgrierson@strangebook.lan> | 2011-10-10 00:34:25 +0100 |
| commit | f031cab18f10cb7778187418cf617e4a27804eb7 (patch) | |
| tree | 36639394dee6edec4a6f70b2d250e1ec16e00c69 /main.cpp | |
| parent | 2ba7a5056011da98c04fe33b5ee4b74d3a35da8c (diff) | |
added polysynth example and fixed ticking error
Diffstat (limited to 'main.cpp')
| -rwxr-xr-x | main.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
@@ -1,6 +1,6 @@ #include "maximilian.h" -//This shows how to use maximilian to build a polyphonic synth. Works but something weirds going on with the ticks. Hmm.. +//This shows how to use maximilian to build a polyphonic synth. //These are the synthesiser bits maxiOsc VCO1[6],VCO2[6],LFO1[6],LFO2[6]; @@ -9,7 +9,7 @@ maxiEnvelope ADSR[6]; //These are the control values for the envelope -double adsrEnv[8]={1,5,0.125,50,0.125,125,0,100}; +double adsrEnv[8]={1,5,0.125,100,0.125,200,0,1000}; //This is a bunch of control signals so that we can hear something @@ -39,19 +39,13 @@ void play(double *output) { } ADSR[voice].trigger(0, adsrEnv[0]);//trigger the envelope from the start - pitch[voice]=voice; + pitch[voice]=voice+1; voice++; - - cout << "tick\n";//ticking twice for some reason - cout << voice;//ticking twice for some reason - cout << "\n";//ticking twice for some reason - - - lastCount=currentCount;//set the last count to the current count + lastCount=0; } - + //and this is where we build the synth for (int i=0; i<6; i++) { |
