From e0b77b9814d80cb5ed7dd7d11c9568f342286d60 Mon Sep 17 00:00:00 2001 From: Mick Grierson Date: Sun, 9 Oct 2011 22:44:17 +0100 Subject: added monosynth example to main.cpp --- maximilian.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'maximilian.cpp') diff --git a/maximilian.cpp b/maximilian.cpp index ac2ccba..b02b575 100644 --- a/maximilian.cpp +++ b/maximilian.cpp @@ -177,6 +177,8 @@ double maxiOsc::triangle(double frequency, double phase) { //I like this. double maxiEnvelope::line(int numberofsegments,double segments[1000]) { + if (isPlaying==1) { + period=2./(segments[valindex+1]*0.004); nextval=segments[valindex+2]; currentval=segments[valindex]; @@ -191,11 +193,18 @@ double maxiEnvelope::line(int numberofsegments,double segments[1000]) { startval=currentval; } output=amplitude; - return(output); + + } + else { + output=0; + + } + return(output); } //and this void maxiEnvelope::trigger(int index, double amp) { + isPlaying=1; valindex=index; amplitude=amp; -- cgit v1.3