summaryrefslogtreecommitdiff
path: root/synth/parser.cpp
diff options
context:
space:
mode:
authorFlorian Jung <flo@thinkpad.(none)>2011-01-12 12:06:35 +0100
committerFlorian Jung <flo@thinkpad.(none)>2011-01-12 12:06:35 +0100
commit105932305adf830ec8116827761a8a8c8aff4523 (patch)
tree6449fe3fc06bf438d10539c59c3de6cac2d3ec6c /synth/parser.cpp
parent528902f28af1bb430ba7c7f1bf4ebbc54fb7aaf6 (diff)
Non-releasing Envelopes now work
Diffstat (limited to 'synth/parser.cpp')
-rw-r--r--synth/parser.cpp19
1 files changed, 18 insertions, 1 deletions
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<term_t> >::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<n_osc;i++)
+ if ((osc[i].output!=0) && (env[i].release<0))
+ neverending_tone=true;
+
+ if (neverending_tone)
+ throw string("you have an oscillator which\n"
+ " may output something but has a never-ending envelope.\n"
+ " this would result in a tone that will never end.");
+
+
+
program_t result;