Added checking for midi channel when midi learning is activated.

dev
Holger Wirtz 2 years ago
parent a6b4e56048
commit acc4740ff8
  1. 31
      MicroDexed.ino

@ -908,16 +908,23 @@ 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) && inChannel == configuration.drums.drum_midi_channel)
LCDML.OTHER_jumpToFunc(UI_func_drum_midi_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))
if (inNumber < configuration.dexed[selected_instance_id].lowest_note)
configuration.dexed[selected_instance_id].lowest_note = inNumber;
LCDML.OTHER_jumpToFunc(UI_func_highest_note);
else {
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) {
if (inChannel == configuration.dexed[selected_instance_id].midi_channel) {
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)) {
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
@ -1006,9 +1013,9 @@ void handleNoteOn(byte inChannel, byte inNumber, byte inVelocity) {
}
#endif
//
// E-Piano
//
//
// E-Piano
//
#if defined(USE_EPIANO)
if (configuration.epiano.midi_channel == MIDI_CHANNEL_OMNI || configuration.epiano.midi_channel == inChannel) {
if (inNumber >= configuration.epiano.lowest_note && inNumber <= configuration.epiano.highest_note) {

Loading…
Cancel
Save