summaryrefslogtreecommitdiff
path: root/synth/programs.cpp
diff options
context:
space:
mode:
authorFlorian Jung <flo@thinkpad.(none)>2011-02-04 16:29:08 +0100
committerFlorian Jung <flo@thinkpad.(none)>2011-02-04 16:29:08 +0100
commit080ddd252d94b9304db3858bc3b7f79cf2f89f33 (patch)
tree994f2b85138dc1f944481abc4d1e505cecf04bb8 /synth/programs.cpp
parent6ea25018546ebc099845158de7fef29c1c4fb28d (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/programs.cpp')
-rw-r--r--synth/programs.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/synth/programs.cpp b/synth/programs.cpp
index 23da924..5dae4ed 100644
--- a/synth/programs.cpp
+++ b/synth/programs.cpp
@@ -1,6 +1,7 @@
#include <string>
#include <cstring>
#include <dlfcn.h>
+#include <cmath>
#include "programs.h"
#include "globals.h"
@@ -157,7 +158,7 @@ void program_t::set_param(const parameter_t &p, fixed_t v) //ACHTUNG:
case KSR: osc_settings[p.osc].ksr=float(v)/ONE; break;
case KSL: osc_settings[p.osc].ksl=float(v)/ONE; break;
- case FACTOR: osc_settings[p.osc].factor=v; break;
+ case FACTOR: osc_settings[p.osc].factor=pow(2.0, (double)v/12.0/ONE)*ONE; break;
case MODULATION: osc_settings[p.osc].fm_strength[p.index]=v; break;
case OUTPUT: osc_settings[p.osc].output=v; break;
case TREMOLO: osc_settings[p.osc].tremolo_depth=v; break;