From c10687ba22b46d5ca4d286b012f69330cb76a0b6 Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Thu, 14 Apr 2022 18:36:04 +0200 Subject: [PATCH] Fix for displaying the right bank when changing the voice >32 or <1. --- UI.hpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/UI.hpp b/UI.hpp index 6f4bd0c..daa6956 100644 --- a/UI.hpp +++ b/UI.hpp @@ -7795,12 +7795,12 @@ void UI_func_voice_select(uint8_t param) case MENU_VOICE_SOUND: memset(g_voice_name[selected_instance_id], 0, VOICE_NAME_LEN); voice_tmp = configuration.dexed[selected_instance_id].voice - ENCODER[ENC_R].speed(); - if (voice_tmp < 0 && configuration.dexed[selected_instance_id].voice - 1 >= 0) + if (voice_tmp < 0 && configuration.dexed[selected_instance_id].bank - 1 >= 0) { - configuration.dexed[selected_instance_id].voice--; - configuration.dexed[selected_instance_id].voice = constrain(configuration.dexed[selected_instance_id].voice, 0, MAX_BANKS - 1); + configuration.dexed[selected_instance_id].bank--; + configuration.dexed[selected_instance_id].bank = constrain(configuration.dexed[selected_instance_id].bank, 0, MAX_BANKS - 1); } - else if (voice_tmp < 0 && configuration.dexed[selected_instance_id].voice - 1 <= 0) + else if (voice_tmp < 0 && configuration.dexed[selected_instance_id].bank - 1 <= 0) { voice_tmp = 0; } @@ -7847,13 +7847,13 @@ void UI_func_voice_select(uint8_t param) case MENU_VOICE_SOUND: memset(g_voice_name[selected_instance_id], 0, VOICE_NAME_LEN); voice_tmp = configuration.dexed[selected_instance_id].voice + ENCODER[ENC_R].speed(); - if (voice_tmp >= MAX_VOICES && configuration.dexed[selected_instance_id].voice + 1 < MAX_BANKS) + if (voice_tmp >= MAX_VOICES && configuration.dexed[selected_instance_id].bank + 1 < MAX_BANKS) { voice_tmp %= MAX_VOICES; - configuration.dexed[selected_instance_id].voice++; - configuration.dexed[selected_instance_id].voice = constrain(configuration.dexed[selected_instance_id].voice, 0, MAX_BANKS - 1); + configuration.dexed[selected_instance_id].bank++; + configuration.dexed[selected_instance_id].bank = constrain(configuration.dexed[selected_instance_id].bank, 0, MAX_BANKS - 1); } - else if (voice_tmp >= MAX_VOICES && configuration.dexed[selected_instance_id].voice + 1 >= MAX_BANKS) + else if (voice_tmp >= MAX_VOICES && configuration.dexed[selected_instance_id].bank + 1 >= MAX_BANKS) { voice_tmp = MAX_VOICES - 1; }