From 105932305adf830ec8116827761a8a8c8aff4523 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Wed, 12 Jan 2011 12:06:35 +0100 Subject: Non-releasing Envelopes now work --- synth/envelope.cpp | 5 +++-- synth/parser.cpp | 19 ++++++++++++++++++- synth/programs.h | 2 +- 3 files changed, 22 insertions(+), 4 deletions(-) (limited to 'synth') diff --git a/synth/envelope.cpp b/synth/envelope.cpp index 5678fd3..2f06a4e 100644 --- a/synth/envelope.cpp +++ b/synth/envelope.cpp @@ -1,7 +1,5 @@ #include "envelope.h" -#include - Envelope::Envelope(env_settings_t s, int frames) { level=0; @@ -14,6 +12,9 @@ Envelope::Envelope(env_settings_t s, int frames) set_ratefactor(1.0); has_release_phase=(s.release>=0); + + if (has_release_phase) + s.hold=false; set_attack(s.attack); set_decay(s.decay); diff --git a/synth/parser.cpp b/synth/parser.cpp index 5da2175..10accac 100644 --- a/synth/parser.cpp +++ b/synth/parser.cpp @@ -594,7 +594,24 @@ program_t parse(string fn) } } - + + bool neverending_tone=false; + + for (map< parameter_t, list >::iterator it=formula.begin(); it!=formula.end(); it++) + if ((it->first.par==OUTPUT) && (env[it->first.osc].release<0)) + neverending_tone=true; + + for (int i=0;i