summaryrefslogtreecommitdiff
path: root/synth/programs.cpp
diff options
context:
space:
mode:
authorFlorian Jung <flo@thinkpad.(none)>2011-01-15 15:27:38 +0100
committerFlorian Jung <flo@thinkpad.(none)>2011-01-15 15:27:38 +0100
commit550497e9b09894a79c1c9888901bbbf4949a614b (patch)
tree22a1b1f5eac70051eb8336312569ad07c512cc82 /synth/programs.cpp
parent9e3998bbaddf4eb6df8544497e42231137824998 (diff)
Added rudimentary support for freq-envelopes
todo: pfactor'ed amount todo: support for compiled notes plus some tiny bugfixes: - in Envelope (get_sustain now returns orig_sustain) - parser now uses isnum instead of isfloat where appropriate
Diffstat (limited to 'synth/programs.cpp')
-rw-r--r--synth/programs.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/synth/programs.cpp b/synth/programs.cpp
index b896a06..cfbd9a1 100644
--- a/synth/programs.cpp
+++ b/synth/programs.cpp
@@ -174,6 +174,13 @@ void program_t::set_param(const parameter_t &p, fixed_t v) //ACHTUNG:
case FILTER_TREM_LFO: filter_settings.trem_lfo=v; break;
case SYNC_FACTOR: sync_factor=v; break;
+
+ case FREQ_ATTACK: osc_settings[p.osc].freq_env.attack=v*samp_rate >>SCALE; break;
+ case FREQ_DECAY: osc_settings[p.osc].freq_env.decay=v*samp_rate >>SCALE; break;
+ case FREQ_SUSTAIN: osc_settings[p.osc].freq_env.sustain=v; break;
+ case FREQ_RELEASE: osc_settings[p.osc].freq_env.release=v*samp_rate >>SCALE; break;
+ case FREQ_HOLD: osc_settings[p.osc].freq_env.hold=(v!=0); break;
+ case FREQ_ENV_AMOUNT: osc_settings[p.osc].freq_env_amount=double(v)/ONE; break;
default: throw string("trying to set an unknown parameter");
}