diff --git a/MicroDexed.ino b/MicroDexed.ino index 5f01837..a23cbfb 100644 --- a/MicroDexed.ino +++ b/MicroDexed.ino @@ -824,8 +824,29 @@ void handleSystemExclusive(byte * sysex, uint len) } #ifdef DEBUG - Serial.print(F("SysEx data length: ")); - Serial.println(len); + Serial.print(F("SysEx data length: [")); + Serial.print(len); + Serial.println(F("]")); + + Serial.println(F("SysEx data:")); + for (uint16_t i = 0; i < len; i++) + { + Serial.print(F("[0x")); + uint8_t s = sysex[i]; + if (s < 16) + Serial.print(F("0")); + Serial.print(s, HEX); + Serial.print(F("|")); + if (s < 100) + Serial.print(F("0")); + if (s < 10) + Serial.print(F("0")); + Serial.print(s, DEC); + Serial.print(F("]")); + if ((i + 1) % 16 == 0) + Serial.println(); + } + Serial.println(); #endif // Check for SYSEX end byte @@ -837,20 +858,6 @@ void handleSystemExclusive(byte * sysex, uint len) return; } -#ifdef DEBUG - Serial.print(F("INSTANCE ")); - Serial.print(instance_id, DEC); - Serial.print(F(": SYSEX-Data[")); - Serial.print(len, DEC); - Serial.print(F("]")); - for (uint8_t i = 0; i < len; i++) - { - Serial.print(F(" ")); - Serial.print(sysex[i], DEC); - } - Serial.println(); -#endif - if (sysex[1] != 0x43) // check for Yamaha sysex { #ifdef DEBUG @@ -1092,7 +1099,7 @@ void handleSystemExclusive(byte * sysex, uint len) // show voice name strncpy(g_voice_name[instance_id], (char*)&sysex[151], VOICE_NAME_LEN - 1); - + if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_voice_select)) { LCDML.OTHER_updateFunc(); diff --git a/UI.hpp b/UI.hpp index df2a6ac..917b3e6 100644 --- a/UI.hpp +++ b/UI.hpp @@ -3204,7 +3204,7 @@ void UI_func_eeprom_reset(uint8_t param) lcd.setCursor(0, 1); lcd.print("Done."); - delay(500); + delay(MESSAGE_WAIT_TIME); _softRestart(); } } @@ -3226,7 +3226,7 @@ void UI_func_eeprom_reset(uint8_t param) { lcd.setCursor(0, 1); lcd.print("Canceled "); - delay(500); + delay(MESSAGE_WAIT_TIME); encoderDir[ENC_R].reset(); } @@ -3532,7 +3532,7 @@ void UI_func_load_performance(uint8_t param) lcd.print("Done. "); } - delay(500); + delay(MESSAGE_WAIT_TIME); LCDML.FUNC_goBackToMenu(); } @@ -3548,9 +3548,8 @@ void UI_func_load_performance(uint8_t param) { if (mode < 0xff) { - lcd.setCursor(0, 1); - lcd.print("Canceled "); - delay(500); + lcd.show(1, 0, 16, "Canceled."); + delay(MESSAGE_WAIT_TIME); } else eeprom_update_performance(); @@ -3624,13 +3623,20 @@ void UI_func_save_performance(uint8_t param) sprintf(tmp, "/%s/%s%d.syx", PERFORMANCE_CONFIG_PATH, PERFORMANCE_CONFIG_NAME, configuration.sys.performance_number); SD.remove(tmp); } - save_sd_performance(configuration.performance.fx_number); - lcd.setCursor(0, 1); - lcd.print("Done. "); - delay(500); + save_sd_performance(configuration.sys.performance_number); + lcd.show(1, 0, 16, "Done."); + delay(MESSAGE_WAIT_TIME); + LCDML.FUNC_goBackToMenu(); } + else if (overwrite == true && yesno == false) + { + char tmp[17]; - LCDML.FUNC_goBackToMenu(); + mode = 0; + lcd.setCursor(0, 1); + sprintf(tmp, "[%2d] ", configuration.sys.performance_number); + lcd.print(tmp); + } } } @@ -3663,9 +3669,8 @@ void UI_func_save_performance(uint8_t param) { if (mode < 0xff) { - lcd.setCursor(0, 1); - lcd.print("Canceled "); - delay(500); + lcd.show(1, 0, 16, "Canceled."); + delay(MESSAGE_WAIT_TIME); } EEPROM.update(EEPROM_START_ADDRESS + offsetof(sys_s, performance_number), configuration.sys.performance_number); @@ -3693,7 +3698,7 @@ void UI_func_load_voiceconfig(uint8_t param) encoderDir[ENC_R].reset(); lcd.setCursor(0, 0); - lcd.print(F("Load Voice Cfg")); + lcd.print(F("Load VoiceCfg SD")); #if NUMDEXED > 1 mode = 0; lcd.setCursor(0, 1); @@ -3733,7 +3738,7 @@ void UI_func_load_voiceconfig(uint8_t param) else lcd.print("Done. "); - delay(500); + delay(MESSAGE_WAIT_TIME); LCDML.FUNC_goBackToMenu(); } @@ -3758,9 +3763,8 @@ void UI_func_load_voiceconfig(uint8_t param) { if (mode < 0xff) { - lcd.setCursor(0, 1); - lcd.print("Canceled "); - delay(500); + lcd.show(1, 0, 16, "Canceled."); + delay(MESSAGE_WAIT_TIME); } else eeprom_update_dexed(instance_id); @@ -3798,7 +3802,7 @@ void UI_func_save_voiceconfig(uint8_t param) encoderDir[ENC_R].reset(); lcd.setCursor(0, 0); - lcd.print(F("Save Config SD")); + lcd.print(F("Save VoiceCfg SD")); #if NUMDEXED > 1 mode = 0; lcd.setCursor(0, 1); @@ -3859,12 +3863,19 @@ void UI_func_save_voiceconfig(uint8_t param) SD.remove(tmp); } save_sd_voiceconfig(configuration.performance.voiceconfig_number[instance_id], instance_id); - lcd.setCursor(0, 1); - lcd.print("Done. "); - delay(500); + lcd.show(1, 0, 16, "Done."); + delay(MESSAGE_WAIT_TIME); + LCDML.FUNC_goBackToMenu(); } + else if (overwrite == true && yesno == false) + { + char tmp[17]; - LCDML.FUNC_goBackToMenu(); + mode = 1; + lcd.setCursor(0, 1); + sprintf(tmp, "[%2d] ", configuration.performance.voiceconfig_number[instance_id]); + lcd.print(tmp); + } } } @@ -3903,9 +3914,8 @@ void UI_func_save_voiceconfig(uint8_t param) { if (mode < 0xff) { - lcd.setCursor(0, 1); - lcd.print("Canceled "); - delay(500); + lcd.show(1, 0, 16, "Canceled."); + delay(MESSAGE_WAIT_TIME); } #if NUM_DEXED > 1 @@ -3934,7 +3944,7 @@ void UI_func_load_fx(uint8_t param) lcd.setCursor(0, 0); lcd.print(F("Load FX SD")); lcd.setCursor(0, 1); - sprintf(tmp, "[%d]", configuration.performance.fx_number); + sprintf(tmp, "[%2d]", configuration.performance.fx_number); lcd.print(tmp); } @@ -3960,7 +3970,7 @@ void UI_func_load_fx(uint8_t param) else lcd.print("Done. "); - delay(500); + delay(MESSAGE_WAIT_TIME); LCDML.FUNC_goBackToMenu(); } @@ -3976,9 +3986,8 @@ void UI_func_load_fx(uint8_t param) { if (mode < 0xff) { - lcd.setCursor(0, 1); - lcd.print("Canceled "); - delay(500); + lcd.show(1, 0, 16, "Canceled."); + delay(MESSAGE_WAIT_TIME); } else eeprom_update_fx(); @@ -4007,7 +4016,7 @@ void UI_func_save_fx(uint8_t param) lcd.setCursor(0, 0); lcd.print(F("Save FX")); lcd.setCursor(0, 1); - sprintf(tmp, "[%d]", configuration.performance.fx_number); + sprintf(tmp, "[%2d]", configuration.performance.fx_number); lcd.print(tmp); sprintf(tmp, "/%s/%s%d.syx", FX_CONFIG_PATH, FX_CONFIG_NAME, configuration.performance.fx_number); @@ -4055,12 +4064,20 @@ void UI_func_save_fx(uint8_t param) SD.remove(tmp); } save_sd_fx(configuration.performance.fx_number); - lcd.setCursor(0, 1); - lcd.print("Done. "); - delay(500); + + lcd.show(1, 0, 16, "Done."); + LCDML.FUNC_goBackToMenu(); + delay(MESSAGE_WAIT_TIME); } + else if (overwrite == true && yesno == false) + { + char tmp[17]; - LCDML.FUNC_goBackToMenu(); + mode = 0; + lcd.setCursor(0, 1); + sprintf(tmp, "[%2d] ", configuration.performance.fx_number); + lcd.print(tmp); + } } } @@ -4093,9 +4110,8 @@ void UI_func_save_fx(uint8_t param) { if (mode < 0xff) { - lcd.setCursor(0, 1); - lcd.print("Canceled "); - delay(500); + lcd.show(1, 0, 16, "Canceled."); + delay(MESSAGE_WAIT_TIME); } EEPROM.update(EEPROM_START_ADDRESS + offsetof(performance_s, fx_number), configuration.performance.fx_number); @@ -4220,7 +4236,7 @@ void UI_func_save_voice(uint8_t param) #endif lcd.show(1, 0, 16, "Done."); - delay(500); + delay(MESSAGE_WAIT_TIME); mode = 0xff; } @@ -4235,7 +4251,7 @@ void UI_func_save_voice(uint8_t param) if (mode < 0xff) { lcd.show(1, 0, 16, "Canceled."); - delay(500); + delay(MESSAGE_WAIT_TIME); } else { diff --git a/UI_1_FX.h b/UI_1_FX.h index 635c7fc..696fab6 100644 --- a/UI_1_FX.h +++ b/UI_1_FX.h @@ -106,8 +106,8 @@ LCDML_add(77, LCDML_0_3, 2, "Voice Config", NULL); LCDML_add(78, LCDML_0_3_2, 1, "Load Voice Cfg", UI_func_load_voiceconfig); LCDML_add(79, LCDML_0_3_2, 2, "Save Voice Cfg", UI_func_save_voiceconfig); LCDML_add(80, LCDML_0_3, 3, "Effects", NULL); -LCDML_add(81, LCDML_0_3_3, 1, "Load Effects Cfg", UI_func_load_fx); -LCDML_add(82, LCDML_0_3_3, 2, "Save Effects Cfg", UI_func_save_fx); +LCDML_add(81, LCDML_0_3_3, 1, "Load Effects", UI_func_load_fx); +LCDML_add(82, LCDML_0_3_3, 2, "Save Effects", UI_func_save_fx); LCDML_add(83, LCDML_0_3, 5, "MIDI", NULL); LCDML_add(84, LCDML_0_3_5, 1, "MIDI Recv Bank", UI_func_sysex_receive_bank); LCDML_add(85, LCDML_0_3_5, 2, "MIDI Send Bank", UI_func_sysex_send_bank); diff --git a/UI_2_FX.h b/UI_2_FX.h index fa8ac6c..e47f269 100644 --- a/UI_2_FX.h +++ b/UI_2_FX.h @@ -166,8 +166,8 @@ LCDML_add(137, LCDML_0_4, 2, "Voice Config", NULL); LCDML_add(138, LCDML_0_4_2, 1, "Load Voice Cfg", UI_func_load_voiceconfig); LCDML_add(139, LCDML_0_4_2, 2, "Save Voice Cfg", UI_func_save_voiceconfig); LCDML_add(140, LCDML_0_4, 3, "FX", NULL); -LCDML_add(141, LCDML_0_4_3, 1, "Load Effects Cfg", UI_func_load_fx); -LCDML_add(142, LCDML_0_4_3, 2, "Save Effects Cfg", UI_func_save_fx); +LCDML_add(141, LCDML_0_4_3, 1, "Load Effects", UI_func_load_fx); +LCDML_add(142, LCDML_0_4_3, 2, "Save Effects", UI_func_save_fx); LCDML_add(143, LCDML_0_4, 5, "MIDI", NULL); LCDML_add(144, LCDML_0_4_5, 1, "MIDI Recv Bank", UI_func_sysex_receive_bank); LCDML_add(145, LCDML_0_4_5, 2, "MIDI Send Bank", UI_func_sysex_send_bank); diff --git a/config.h b/config.h index 2138b2a..a954b30 100644 --- a/config.h +++ b/config.h @@ -40,8 +40,10 @@ // $ vkeybd --addr 20:0 // $ arecord -f cd -Dhw:1,0 /tmp/.wav // +// Tools for testing MIDI: https://github.com/gbevin/SendMIDI +// https://github.com/gbevin/ReceiveMIDI -#define VERSION "0.9.9" +#define VERSION "0.9.9a" //************************************************************************************************* //* DEVICE SETTINGS @@ -175,6 +177,7 @@ #define VOICE_SELECTION_MS 60000 #define BACK_FROM_VOLUME_MS 2000 +#define MESSAGE_WAIT_TIME 1000 //************************************************************************************************* //* HARDWARE SETTINGS