From 1128f1c8ae5c7e8746cfed0b9ec4141368d840ce Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Tue, 12 Nov 2019 09:34:41 +0100 Subject: [PATCH] Fixing filter controlling. --- MicroDexed.ino | 4 ++-- UI.hpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/MicroDexed.ino b/MicroDexed.ino index 867aec6..46d4aa2 100644 --- a/MicroDexed.ino +++ b/MicroDexed.ino @@ -679,12 +679,12 @@ void handleControlChange(byte inChannel, byte inCtrl, byte inValue) case 103: // CC 103: filter resonance configuration.dexed[instance_id].filter_resonance = map(inValue, 0, 0x7f, FILTER_RESONANCE_MIN, FILTER_RESONANCE_MAX); //MicroDexed[instance_id]->fx.Reso = (100 - configuration.dexed[instance_id].filter_resonance) / 100.0; - soften_filter_res[instance_id].update(soften_filter_res[instance_id].value() + (FILTER_RESONANCE_MAX - FILTER_RESONANCE_MIN) / FILTER_RESONANCE_ENC_STEPS, SOFTEN_VALUE_CHANGE_STEPS); + soften_filter_res[instance_id].update(soften_filter_res[instance_id].value() + configuration.dexed[instance_id].filter_resonance, SOFTEN_VALUE_CHANGE_STEPS); break; case 104: // CC 104: filter cutoff configuration.dexed[instance_id].filter_cutoff = map(inValue, 0, 0x7f, FILTER_CUTOFF_MIN, FILTER_CUTOFF_MAX); //MicroDexed[instance_id]->fx.Cutoff = (100 - configuration.dexed[instance_id].filter_cutoff) / 100.0; - soften_filter_cut[instance_id].update(soften_filter_cut[instance_id].value() + (FILTER_CUTOFF_MAX - FILTER_CUTOFF_MIN) / FILTER_CUTOFF_ENC_STEPS, SOFTEN_VALUE_CHANGE_STEPS); + soften_filter_cut[instance_id].update(soften_filter_cut[instance_id].value() + configuration.dexed[instance_id].filter_cutoff, SOFTEN_VALUE_CHANGE_STEPS); break; case 105: // CC 105: delay time configuration.delay_time = map(inValue, 0, 0x7f, DELAY_TIME_MIN, DELAY_TIME_MAX); diff --git a/UI.hpp b/UI.hpp index 1e604ba..d1a7763 100644 --- a/UI.hpp +++ b/UI.hpp @@ -1464,7 +1464,7 @@ void UI_func_filter_cutoff(uint8_t param) Serial.println(configuration.dexed[instance_id].filter_cutoff / 100.0, 3); //MicroDexed[instance_id]->fx.Cutoff = (100 - configuration.dexed[instance_id].filter_cutoff) / 100.0; - soften_filter_cut[instance_id].update(soften_filter_cut[instance_id].value() + (FILTER_CUTOFF_MAX - FILTER_CUTOFF_MIN) / FILTER_CUTOFF_ENC_STEPS, SOFTEN_VALUE_CHANGE_STEPS); + soften_filter_cut[instance_id].update(soften_filter_cut[instance_id].value() + configuration.dexed[instance_id].filter_cutoff, SOFTEN_VALUE_CHANGE_STEPS); } if (LCDML.FUNC_close()) // ****** STABLE END ********* @@ -1513,7 +1513,7 @@ void UI_func_filter_resonance(uint8_t param) lcd_display_int(configuration.dexed[instance_id].filter_resonance, 3, true, true, false); //MicroDexed[instance_id]->fx.Reso = (100 - configuration.dexed[instance_id].filter_resonance) / 100.0; - soften_filter_res[instance_id].update(soften_filter_res[instance_id].value() + (FILTER_RESONANCE_MAX - FILTER_RESONANCE_MIN) / FILTER_RESONANCE_ENC_STEPS, SOFTEN_VALUE_CHANGE_STEPS); + soften_filter_res[instance_id].update(soften_filter_res[instance_id].value() + configuration.dexed[instance_id].filter_resonance--, SOFTEN_VALUE_CHANGE_STEPS); } if (LCDML.FUNC_close()) // ****** STABLE END *********