From f031cab18f10cb7778187418cf617e4a27804eb7 Mon Sep 17 00:00:00 2001 From: Mick Grierson Date: Mon, 10 Oct 2011 00:34:25 +0100 Subject: added polysynth example and fixed ticking error --- main.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp index 7348246..00763cd 100755 --- a/main.cpp +++ b/main.cpp @@ -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++) { -- cgit v1.3