summaryrefslogtreecommitdiff
path: root/note_compiler/parser.cpp
diff options
context:
space:
mode:
authorFlorian Jung <flo@thinkpad.(none)>2011-01-10 17:04:54 +0100
committerFlorian Jung <flo@thinkpad.(none)>2011-01-10 17:04:54 +0100
commiteb81cf5820770c54d33facaf09f7f79a17e272ed (patch)
treea87028cc6235d980e52a04e47ebadbc26320d4fa /note_compiler/parser.cpp
parentdf97e0ebb7f6591c50f3a588cb2a74901d38ac4a (diff)
Implemented handler for soft-pedal
Controller 67 aka soft-pedal now can reduce the note's volume by half TODO: - let the user set the percentage for the volume, either per controller (per channel) or per CLI (global)
Diffstat (limited to 'note_compiler/parser.cpp')
-rw-r--r--note_compiler/parser.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/note_compiler/parser.cpp b/note_compiler/parser.cpp
index c89ddd9..7fb3fa0 100644
--- a/note_compiler/parser.cpp
+++ b/note_compiler/parser.cpp
@@ -24,7 +24,6 @@ void init_oscs(int n_osc, oscillator_t *osc)
osc[i].output=0;
osc[i].output_const=true;
- osc[i].output_no_pfactor=false;
osc[i].waveform=0;
osc[i].waveform_const=true;
osc[i].factor=ONE;
@@ -370,13 +369,9 @@ program_t parse(string fn)
osc[ind].fm_strength_const[ind2]=false;
break;
case OUTPUT:
- 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;
+ if (state!=4) // not vel.-influence
+ osc[ind].output_const=false;
+ break;
case WAVEFORM:
osc[ind].waveform_const=false; break;
case FACTOR:
@@ -481,7 +476,7 @@ program_t parse(string fn)
for (int i=0;i<n_osc;i++)
- if ( (osc[i].output_no_pfactor==false) && !((osc[i].output==0) && (osc[i].output_const=true)) )
+ if ( !((osc[i].output==0) && (osc[i].output_const=true)) )
osc[i].output_const=false;
//end optimizations and checks