|
|
@ -4295,20 +4295,80 @@ void UI_func_drum_reverb_send(uint8_t param) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool _get_midi_note(uint8_t note) { |
|
|
|
void UI_func_drum_midi_note(uint8_t param) { |
|
|
|
for (uint8_t i = DRUMS_MIDI_NOTE_MIN; i <= DRUMS_MIDI_NOTE_MAX; i++) { |
|
|
|
static bool display_name; |
|
|
|
if (drum_config[activesample].midinote == i) |
|
|
|
char tmp_val[4]; |
|
|
|
return (true); |
|
|
|
char tmp_name[9]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (LCDML.FUNC_setup()) // ****** SETUP *********
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
midi_learn_mode = true; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
memset(tmp_name, ' ', 8); |
|
|
|
|
|
|
|
strncpy(tmp_name, drum_config[active_sample].name, strlen(drum_config[active_sample].name)); |
|
|
|
|
|
|
|
tmp_name[8] = '\0'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
display.setCursor(0, 0); |
|
|
|
|
|
|
|
display.print(F("MIDI Note")); |
|
|
|
|
|
|
|
display.setCursor(1, 1); |
|
|
|
|
|
|
|
display.print(tmp_name); |
|
|
|
|
|
|
|
display.setCursor(LCD_cols - 4, 1); |
|
|
|
|
|
|
|
getNoteName(tmp_val, configuration.drums.midinote[active_sample]); |
|
|
|
|
|
|
|
display.print(tmp_val); |
|
|
|
|
|
|
|
_check_display_name(display_name, 3); |
|
|
|
} |
|
|
|
} |
|
|
|
return (false); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void _UI_func_drum_midi_note_display(bool mode) { |
|
|
|
if (LCDML.FUNC_loop()) // ****** LOOP *********
|
|
|
|
; |
|
|
|
{ |
|
|
|
} |
|
|
|
if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) { |
|
|
|
|
|
|
|
if (LCDML.BT_checkDown()) { |
|
|
|
|
|
|
|
if (display_name == true) { |
|
|
|
|
|
|
|
if (active_sample < NUM_DRUMSET_CONFIG - 2) { |
|
|
|
|
|
|
|
active_sample++; |
|
|
|
|
|
|
|
display.setCursor(LCD_cols - 4, 1); |
|
|
|
|
|
|
|
getNoteName(tmp_val, configuration.drums.midinote[active_sample]); |
|
|
|
|
|
|
|
display.print(tmp_val); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
configuration.drums.midinote[active_sample] = constrain(configuration.drums.midinote[active_sample] + ENCODER[ENC_L].speed(), DRUMS_MIDI_NOTE_MIN, DRUMS_MIDI_NOTE_MAX); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else if (LCDML.BT_checkUp()) { |
|
|
|
|
|
|
|
if (display_name == true) { |
|
|
|
|
|
|
|
if (active_sample > 0) { |
|
|
|
|
|
|
|
active_sample--; |
|
|
|
|
|
|
|
display.setCursor(LCD_cols - 4, 1); |
|
|
|
|
|
|
|
getNoteName(tmp_val, configuration.drums.midinote[active_sample]); |
|
|
|
|
|
|
|
display.print(tmp_val); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
configuration.drums.midinote[active_sample] = constrain(configuration.drums.midinote[active_sample] - ENCODER[ENC_L].speed(), DRUMS_MIDI_NOTE_MIN, DRUMS_MIDI_NOTE_MAX); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else if (LCDML.BT_checkEnter()) { |
|
|
|
|
|
|
|
display_name = !display_name; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void UI_func_drum_midi_note(uint8_t param) { |
|
|
|
getNoteName(tmp_val, configuration.drums.midinote[active_sample]); |
|
|
|
; |
|
|
|
#ifdef DEBUG |
|
|
|
|
|
|
|
Serial.printf("Drum midinote for active_sample=%d [%s]=%d (%s)\n", active_sample, drum_config[active_sample].name, configuration.drums.midinote[active_sample], tmp_val); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
memset(tmp_name, ' ', 8); |
|
|
|
|
|
|
|
strncpy(tmp_name, drum_config[active_sample].name, strlen(drum_config[active_sample].name)); |
|
|
|
|
|
|
|
tmp_name[8] = '\0'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
display.setCursor(1, 1); |
|
|
|
|
|
|
|
display.print(tmp_name); |
|
|
|
|
|
|
|
display.setCursor(LCD_cols - 4, 1); |
|
|
|
|
|
|
|
display.print(tmp_val); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_check_display_name(display_name, 3); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (LCDML.FUNC_close()) // ****** STABLE END *********
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
encoderDir[ENC_L].reset(); |
|
|
|
|
|
|
|
midi_learn_mode = false; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void UI_func_save_performance(uint8_t param) { |
|
|
|
void UI_func_save_performance(uint8_t param) { |
|
|
|