From fb9bd37352d03dc7726ae3bae83f4d539924e8a8 Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Tue, 28 Apr 2020 08:11:26 +0200 Subject: [PATCH] Fix for bank select MSB. --- MicroDexed.ino | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/MicroDexed.ino b/MicroDexed.ino index bb6935f..3dffaf1 100644 --- a/MicroDexed.ino +++ b/MicroDexed.ino @@ -585,11 +585,12 @@ void handleControlChange(byte inChannel, byte inCtrl, byte inValue) #endif switch (inCtrl) { - case 0: - if (inValue < MAX_BANKS - 1) - { - configuration.performance.bank[instance_id] = inValue; - } + case 0: // BankSelect MSB +#ifdef DEBUG + Serial.println(F("BANK-SELECT MSB CC")); +#endif + configuration.performance.bank[instance_id] = constrain((inValue << 7)&configuration.performance.bank[instance_id], 0, MAX_BANKS - 1); + load_sd_voice(configuration.performance.bank[instance_id], configuration.performance.voice[instance_id], instance_id); break; case 1: #ifdef DEBUG @@ -637,7 +638,7 @@ void handleControlChange(byte inChannel, byte inCtrl, byte inValue) break; case 32: // BankSelect LSB #ifdef DEBUG - Serial.println(F("BANK-SELECT CC")); + Serial.println(F("BANK-SELECT LSB CC")); #endif configuration.performance.bank[instance_id] = constrain(inValue, 0, MAX_BANKS - 1); load_sd_voice(configuration.performance.bank[instance_id], configuration.performance.voice[instance_id], instance_id); @@ -963,7 +964,7 @@ void handleSystemExclusive(byte * sysex, uint len) LCDML.OTHER_updateFunc(); LCDML.loop_menu(); - + /* // manipulate UI names and numbers strncpy(voice_name[instance_id], (char *)&sysex[151], sizeof(voice_name[instance_id]) - 1);