summaryrefslogtreecommitdiff
path: root/note_compiler
diff options
context:
space:
mode:
Diffstat (limited to 'note_compiler')
-rw-r--r--note_compiler/parser.cpp28
-rw-r--r--note_compiler/programs.h1
2 files changed, 25 insertions, 4 deletions
diff --git a/note_compiler/parser.cpp b/note_compiler/parser.cpp
index b15b981..c89ddd9 100644
--- a/note_compiler/parser.cpp
+++ b/note_compiler/parser.cpp
@@ -23,7 +23,8 @@ void init_oscs(int n_osc, oscillator_t *osc)
}
osc[i].output=0;
- osc[i].output_const=false; //TODO FINDMICH war true
+ osc[i].output_const=true;
+ osc[i].output_no_pfactor=false;
osc[i].waveform=0;
osc[i].waveform_const=true;
osc[i].factor=ONE;
@@ -369,7 +370,13 @@ program_t parse(string fn)
osc[ind].fm_strength_const[ind2]=false;
break;
case OUTPUT:
- osc[ind].output_const=false; break;
+ if (state==4) // vel.-influence
+ {
+ if (isfloat(strval)) //is it a plain number, not a formula?
+ osc[ind].output_no_pfactor=true;
+ }
+ else
+ osc[ind].output_const=false; break;
case WAVEFORM:
osc[ind].waveform_const=false; break;
case FACTOR:
@@ -438,7 +445,7 @@ program_t parse(string fn)
}
- //some optimizations
+ //some optimizations and checks
for (int i=0;i<n_osc;i++)
if ((env[i].attack==0) && (env[i].sustain==1.0)
@@ -464,7 +471,20 @@ program_t parse(string fn)
sync_factor_const=true;
}
- //end optimizations
+ if ((sync_factor==0) && (sync_factor_const==true))
+ for (int i=0;i<n_osc;i++)
+ {
+ osc[i].sync=false;
+ osc[i].sync_const=true;
+ }
+
+
+
+ for (int i=0;i<n_osc;i++)
+ if ( (osc[i].output_no_pfactor==false) && !((osc[i].output==0) && (osc[i].output_const=true)) )
+ osc[i].output_const=false;
+
+ //end optimizations and checks
result.n_osc=n_osc;
result.osc=osc;
diff --git a/note_compiler/programs.h b/note_compiler/programs.h
index d7acd61..9025ba1 100644
--- a/note_compiler/programs.h
+++ b/note_compiler/programs.h
@@ -47,6 +47,7 @@ struct oscillator_t
bool *fm_strength_const;
fixed_t output;
bool output_const;
+ bool output_no_pfactor;
int waveform;
bool waveform_const;
fixed_t factor;