From a6b4e56048332ce32e24896508ba8602d95d7fc1 Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Wed, 5 Oct 2022 18:16:29 +0200 Subject: [PATCH] Small fixes for latest addition. --- MicroDexed.ino | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/MicroDexed.ino b/MicroDexed.ino index 0bec77f..48fd033 100644 --- a/MicroDexed.ino +++ b/MicroDexed.ino @@ -908,12 +908,16 @@ void handleNoteOn(byte inChannel, byte inNumber, byte inVelocity) { // check for MIDI learn mode if (midi_learn_var != NULL) { *midi_learn_var = inNumber; - if (LCDML.FUNC_getID() != LCDML.OTHER_getIDFromFunction(UI_func_drum_midi_note)) + if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_drum_midi_note)) LCDML.OTHER_jumpToFunc(UI_func_drum_midi_note); - else if (LCDML.FUNC_getID() != LCDML.OTHER_getIDFromFunction(UI_func_lowest_note)) + else if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_lowest_note)) { + if (inNumber > configuration.dexed[selected_instance_id].highest_note) + configuration.dexed[selected_instance_id].highest_note = inNumber; LCDML.OTHER_jumpToFunc(UI_func_lowest_note); - else if (LCDML.FUNC_getID() != LCDML.OTHER_getIDFromFunction(UI_func_highest_note)) - LCDML.OTHER_jumpToFunc(UI_func_highest_note); + } else if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_highest_note)) + if (inNumber < configuration.dexed[selected_instance_id].lowest_note) + configuration.dexed[selected_instance_id].lowest_note = inNumber; + LCDML.OTHER_jumpToFunc(UI_func_highest_note); } // Check for MicroDexed