diff options
author | Florian Jung <flo@thinkpad.(none)> | 2011-02-04 16:29:08 +0100 |
---|---|---|
committer | Florian Jung <flo@thinkpad.(none)> | 2011-02-04 16:29:08 +0100 |
commit | 080ddd252d94b9304db3858bc3b7f79cf2f89f33 (patch) | |
tree | 994f2b85138dc1f944481abc4d1e505cecf04bb8 /synth/parser.cpp | |
parent | 6ea25018546ebc099845158de7fef29c1c4fb28d (diff) |
factor[foo] now accepts semitones instead of a factor
However, internally, factor still behaves as usual.
Only all functions which can set/change .factor do the calculation
from semitones to the real factor.
Diffstat (limited to 'synth/parser.cpp')
-rw-r--r-- | synth/parser.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/synth/parser.cpp b/synth/parser.cpp index 174e0ee..1b8befb 100644 --- a/synth/parser.cpp +++ b/synth/parser.cpp @@ -1,5 +1,6 @@ #include <cstdlib> #include <fstream> +#include <cmath> #include "parser.h" #include "defines.h" @@ -413,7 +414,7 @@ program_t parse(string fn) } break; case FACTOR: - osc[ind].factor=val*ONE; + osc[ind].factor=pow(2.0,val/12.0) *ONE; break; case TREMOLO: osc[ind].tremolo_depth=int(val); |