Fix for displaying the right bank when changing the voice >32 or <1.

dev
Holger Wirtz 3 years ago
parent 179fb4bea6
commit c10687ba22
  1. 16
      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;
}

Loading…
Cancel
Save