From eea43868a79ed8c71f519bee5d1611ebedd2e582 Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Mon, 18 Nov 2019 11:46:58 +0100 Subject: [PATCH] Fix for setting masterTune value. --- MicroDexed.ino | 2 +- dexed.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MicroDexed.ino b/MicroDexed.ino index 0160e07..13953fe 100644 --- a/MicroDexed.ino +++ b/MicroDexed.ino @@ -831,7 +831,7 @@ void handleSystemExclusive(byte * sysex, uint len) MicroDexed[instance_id]->controllers.breath.setTarget(MicroDexed[instance_id]->data[DEXED_GLOBAL_PARAMETER_OFFSET + DEXED_BREATHCTRL_ASSIGN]); MicroDexed[instance_id]->controllers.at.setRange(MicroDexed[instance_id]->data[DEXED_GLOBAL_PARAMETER_OFFSET + DEXED_AT_RANGE]); MicroDexed[instance_id]->controllers.at.setTarget(MicroDexed[instance_id]->data[DEXED_GLOBAL_PARAMETER_OFFSET + DEXED_AT_ASSIGN]); - MicroDexed[instance_id]->controllers.masterTune = (MicroDexed[instance_id]->data[DEXED_GLOBAL_PARAMETER_OFFSET + DEXED_MASTER_TUNE] * 0x4000 << 11) * (1.0 / 12); + MicroDexed[instance_id]->controllers.masterTune = (MicroDexed[instance_id]->data[DEXED_GLOBAL_PARAMETER_OFFSET + DEXED_MASTER_TUNE] / 10 * 0x4000 << 11) * (1.0 / 12); MicroDexed[instance_id]->controllers.refresh(); data_index = DEXED_GLOBAL_PARAMETER_OFFSET - 63 + sysex[4]; } diff --git a/dexed.cpp b/dexed.cpp index a10962c..670df5d 100644 --- a/dexed.cpp +++ b/dexed.cpp @@ -545,7 +545,7 @@ bool Dexed::loadGlobalParameters(uint8_t* new_data) controllers.breath.setTarget(new_data[DEXED_GLOBAL_PARAMETER_OFFSET + DEXED_BREATHCTRL_ASSIGN]); controllers.at.setRange(new_data[DEXED_GLOBAL_PARAMETER_OFFSET + DEXED_AT_RANGE]); controllers.at.setTarget(new_data[DEXED_GLOBAL_PARAMETER_OFFSET + DEXED_AT_ASSIGN]); - controllers.masterTune = (new_data[DEXED_GLOBAL_PARAMETER_OFFSET + DEXED_MASTER_TUNE] * 0x4000 << 11) * (1.0 / 12); + controllers.masterTune = (new_data[DEXED_GLOBAL_PARAMETER_OFFSET + DEXED_MASTER_TUNE] / 10 * 0x4000 << 11) * (1.0 / 12); controllers.refresh(); setOPs((*(p_data + DEXED_GLOBAL_PARAMETER_OFFSET + DEXED_OP1_ENABLE) << 5) |