diff --git a/MicroDexed.ino b/MicroDexed.ino index 23fea40..0de3a21 100644 --- a/MicroDexed.ino +++ b/MicroDexed.ino @@ -1345,6 +1345,7 @@ void check_configuration(void) configuration.dexed[instance_id].midi_channel = constrain(configuration.dexed[instance_id].midi_channel, MIDI_CHANNEL_MIN, MIDI_CHANNEL_MAX); configuration.performance.bank[instance_id] = constrain(configuration.performance.bank[instance_id], 0, MAX_BANKS - 1); configuration.performance.voice[instance_id] = constrain(configuration.performance.voice[instance_id], 0, MAX_VOICES - 1); + configuration.performance.voiceconfig_number[instance_id] = constrain(configuration.performance.voiceconfig_number[instance_id], VOICECONFIG_NUM_MIN, VOICECONFIG_NUM_MAX); configuration.dexed[instance_id].lowest_note = constrain(configuration.dexed[instance_id].lowest_note, INSTANCE_LOWEST_NOTE_MIN, INSTANCE_LOWEST_NOTE_MAX); configuration.dexed[instance_id].highest_note = constrain(configuration.dexed[instance_id].highest_note, INSTANCE_HIGHEST_NOTE_MIN, INSTANCE_HIGHEST_NOTE_MAX); configuration.dexed[instance_id].reverb_send = constrain(configuration.dexed[instance_id].reverb_send, REVERB_SEND_MIN, REVERB_SEND_MAX); @@ -1423,6 +1424,7 @@ void init_configuration(void) configuration.dexed[instance_id].midi_channel = DEFAULT_MIDI_CHANNEL; configuration.performance.bank[instance_id] = SYSEXBANK_DEFAULT; configuration.performance.voice[instance_id] = SYSEXSOUND_DEFAULT; + configuration.performance.voiceconfig_number[instance_id] = VOICECONFIG_NUM_DEFAULT; configuration.dexed[instance_id].lowest_note = INSTANCE_LOWEST_NOTE_MIN; configuration.dexed[instance_id].highest_note = INSTANCE_HIGHEST_NOTE_MAX; configuration.dexed[instance_id].reverb_send = REVERB_SEND_DEFAULT; diff --git a/UI.hpp b/UI.hpp index 02bdf8c..81039ce 100644 --- a/UI.hpp +++ b/UI.hpp @@ -3168,8 +3168,12 @@ void UI_func_volume(uint8_t param) void UI_func_load_performance(uint8_t param) { + static uint8_t mode; + if (LCDML.FUNC_setup()) // ****** SETUP ********* { + mode = 0; + encoderDir[ENC_R].reset(); lcd.setCursor(0, 0); @@ -3187,7 +3191,7 @@ void UI_func_load_performance(uint8_t param) if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) + 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()) { @@ -3197,6 +3201,23 @@ void UI_func_load_performance(uint8_t param) { configuration.sys.performance_number = constrain(configuration.sys.performance_number - ENCODER[ENC_L].speed(), PERFORMANCE_NUM_MIN, PERFORMANCE_NUM_MAX); } + else if (LCDML.BT_checkEnter()) + { + mode = 0xff; + + eeprom_write(); + lcd.setCursor(0, 1); + if (load_sd_performance(configuration.sys.performance_number) == false) + lcd.print("Does not exist."); + else + lcd.print("Done. "); + delay(500); + + if (LCDML.MENU_getLastActivFunctionID() < 0xff) + LCDML.OTHER_jumpToID(LCDML.MENU_getLastActivFunctionID()); + else + LCDML.OTHER_setCursorToID(LCDML.MENU_getLastCursorPositionID()); + } lcd.setCursor(0, 1); if (configuration.sys.performance_number == 0) @@ -3212,11 +3233,13 @@ void UI_func_load_performance(uint8_t param) if (LCDML.FUNC_close()) // ****** STABLE END ********* { - eeprom_write(); - load_sd_performance(configuration.sys.performance_number); - lcd.setCursor(0, 1); - lcd.print("Done. "); - delay(500); + if (mode < 0xff) + { + lcd.setCursor(0, 1); + lcd.print("Canceled "); + delay(500); + } + encoderDir[ENC_R].reset(); } } @@ -3282,7 +3305,20 @@ void UI_func_save_performance(uint8_t param) } else { - LCDML.BT_quit(); // does not help :( + mode = 0xff; + eeprom_write(); + if (overwrite == false || yesno == true) + { + save_sd_performance(configuration.performance.fx_number); + lcd.setCursor(0, 1); + lcd.print("Done. "); + delay(500); + } + + if (LCDML.MENU_getLastActivFunctionID() < 0xff) + LCDML.OTHER_jumpToID(LCDML.MENU_getLastActivFunctionID()); + else + LCDML.OTHER_setCursorToID(LCDML.MENU_getLastCursorPositionID()); } } @@ -3319,14 +3355,13 @@ void UI_func_save_performance(uint8_t param) if (LCDML.FUNC_close()) // ****** STABLE END ********* { - eeprom_write(); - if (overwrite == false || yesno == true) + if (mode < 0xff) { - save_sd_performance(configuration.sys.performance_number); lcd.setCursor(0, 1); - lcd.print("Done. "); + lcd.print("Canceled "); delay(500); } + encoderDir[ENC_R].reset(); } } @@ -3335,92 +3370,99 @@ void UI_func_load_voiceconfig(uint8_t param) { #if NUMDEXED > 1 static int8_t instance_id; - static uint8_t chosen; #else uint8_t instance_id = 0; #endif - static bool yesno; + + static uint8_t mode; if (LCDML.FUNC_setup()) // ****** SETUP ********* { + instance_id = 0; + encoderDir[ENC_R].reset(); lcd.setCursor(0, 0); - lcd.print(F("Load Config SD")); - + lcd.print(F("Load Voice Cfg")); #if NUMDEXED > 1 - instance_id = -1; - chosen = 0; + mode = 0; lcd.setCursor(0, 1); - lcd.print(F("Instance [1]")); + lcd.print(F("Instance [0]")); #else + mode = 1; lcd.setCursor(0, 1); - lcd.print(F("[NO ]")); + if (configuration.performance.voiceconfig_number[instance_id] == 0) + lcd.print(F("[DEFAULT]")); + else + { + char tmp[10]; + sprintf(tmp, "[%7d]", configuration.performance.voiceconfig_number[instance_id]); + lcd.print(tmp); + } #endif - - yesno = false; } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if ((LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort()) || (LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) { -#if NUMDEXED > 1 - if ((LCDML.BT_checkDown() || LCDML.BT_checkUp()) && instance_id < 0) + if (LCDML.BT_checkDown()) { - chosen = (chosen + 1) % 2; + if (mode == 0) + instance_id = (instance_id + 1) % 2; + else if (mode == 1) + configuration.performance.voiceconfig_number[instance_id] = constrain(configuration.performance.voiceconfig_number[instance_id] + ENCODER[ENC_L].speed(), VOICECONFIG_NUM_MIN, VOICECONFIG_NUM_MAX); } - else if (LCDML.BT_checkEnter() && instance_id < 0) + else if (LCDML.BT_checkUp()) { - instance_id = chosen; - lcd.setCursor(0, 1); - lcd.print(F("[NO ] ")); + if (mode == 0) + instance_id = (instance_id - 1) % 2; + else if (mode == 1) + configuration.performance.voiceconfig_number[instance_id] = constrain(configuration.performance.voiceconfig_number[instance_id] - ENCODER[ENC_L].speed(), VOICECONFIG_NUM_MIN, VOICECONFIG_NUM_MAX); } - else if ((LCDML.BT_checkDown() || LCDML.BT_checkUp()) && instance_id >= 0) -#else - if ((LCDML.BT_checkDown() || LCDML.BT_checkUp())) -#endif + else if (LCDML.BT_checkEnter()) { - yesno = !yesno; + mode = 0xff; + lcd.setCursor(0, 1); + if (load_sd_voiceconfig(configuration.performance.voiceconfig_number[instance_id], instance_id) == false) + lcd.print("Does not exist."); + else + lcd.print("Done. "); + delay(500); + + if (LCDML.MENU_getLastActivFunctionID() < 0xff) + LCDML.OTHER_jumpToID(LCDML.MENU_getLastActivFunctionID()); + else + LCDML.OTHER_setCursorToID(LCDML.MENU_getLastCursorPositionID()); } -#if NUMDEXED > 1 - if (instance_id < 0) + if (mode == 0) { lcd.setCursor(10, 1); - lcd.print(chosen + 1); + lcd.print(instance_id); } - else + else if (mode == 1) { -#endif - if (yesno == true) - { - lcd.setCursor(1, 1); - lcd.print(F("YES")); - } + lcd.setCursor(0, 1); + if (configuration.performance.voiceconfig_number[instance_id] == 0) + lcd.print(F("[DEFAULT]")); else { - lcd.setCursor(1, 1); - lcd.print(F("NO ")); + char tmp[10]; + sprintf(tmp, "[%7d]", configuration.performance.voiceconfig_number[instance_id]); + lcd.print(tmp); } -#if NUMDEXED > 1 } -#endif - //encoderDir[ENC_R].reset(); } + encoderDir[ENC_R].reset(); } if (LCDML.FUNC_close()) // ****** STABLE END ********* { - if (yesno == true) + if (mode < 0xff) { - LCDML.DISP_clear(); - lcd.print(F("Save Cfg SD")); - - load_sd_voiceconfig(configuration.performance.bank[instance_id], configuration.performance.voice[instance_id], instance_id); - lcd.setCursor(0, 1); - lcd.print(F("Done.")); + lcd.print("Canceled "); delay(500); } @@ -3432,92 +3474,139 @@ void UI_func_save_voiceconfig(uint8_t param) { #if NUMDEXED > 1 static int8_t instance_id; - static uint8_t chosen; #else uint8_t instance_id = 0; #endif + + static bool overwrite; static bool yesno; + static uint8_t mode; if (LCDML.FUNC_setup()) // ****** SETUP ********* { + yesno = false; + instance_id = 0; + encoderDir[ENC_R].reset(); lcd.setCursor(0, 0); lcd.print(F("Save Config SD")); - #if NUMDEXED > 1 - instance_id = -1; - chosen = 0; + mode = 0; lcd.setCursor(0, 1); - lcd.print(F("Instance [1]")); + lcd.print(F("Instance [0]")); #else + mode = 1; lcd.setCursor(0, 1); - lcd.print(F("[NO ]")); -#endif + if (configuration.performance.voice[instance_id] == 0) + lcd.print(F("[DEFAULT]")); + else + { + char tmp[10]; + sprintf(tmp, "[%7d]", configuration.performance.voice[instance_id]); + lcd.print(tmp); + } - yesno = false; + char tmp[FILENAME_LEN]; + sprintf(tmp, "/%s%d.syx", VOICE_CONFIG_NAME, configuration.performance.voiceconfig_number[instance_id]); + if (SD.exists(tmp)) + overwrite = true; + else + overwrite = false; +#endif } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if ((LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort()) || (LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) { -#if NUMDEXED > 1 - if ((LCDML.BT_checkDown() || LCDML.BT_checkUp()) && instance_id < 0) + if (LCDML.BT_checkDown()) { - chosen = (chosen + 1) % 2; + if (mode == 0) + instance_id = (instance_id + 1) % 2; + else if (mode == 1) + configuration.performance.voiceconfig_number[instance_id] = constrain(configuration.performance.voiceconfig_number[instance_id] + ENCODER[ENC_L].speed(), VOICECONFIG_NUM_MIN, VOICECONFIG_NUM_MAX); + else + yesno = true; } - else if (LCDML.BT_checkEnter() && instance_id < 0) + else if (LCDML.BT_checkUp()) { - instance_id = chosen; - lcd.setCursor(0, 1); - lcd.print(F("[NO ] ")); + if (mode == 0) + instance_id = (instance_id - 1) % 2; + else if (mode == 1) + configuration.performance.voiceconfig_number[instance_id] = constrain(configuration.performance.voiceconfig_number[instance_id] - ENCODER[ENC_L].speed(), VOICECONFIG_NUM_MIN, VOICECONFIG_NUM_MAX); + else + yesno = false; } - else if ((LCDML.BT_checkDown() || LCDML.BT_checkUp()) && instance_id >= 0) -#else - if ((LCDML.BT_checkDown() || LCDML.BT_checkUp())) -#endif + else if (LCDML.BT_checkEnter()) { - yesno = !yesno; + if (mode == 1 && overwrite == true) + { + mode = 2; + lcd.setCursor(0, 1); + lcd.print(F("Overwrite: [ ]")); + } + else + { + mode = 0xff; + eeprom_write(); + if (overwrite == false || yesno == true) + { + save_sd_voiceconfig(configuration.performance.voiceconfig_number[instance_id], instance_id); + lcd.setCursor(0, 1); + lcd.print("Done. "); + delay(500); + } + + if (LCDML.MENU_getLastActivFunctionID() < 0xff) + LCDML.OTHER_jumpToID(LCDML.MENU_getLastActivFunctionID()); + else + LCDML.OTHER_setCursorToID(LCDML.MENU_getLastCursorPositionID()); + } } -#if NUMDEXED > 1 - if (instance_id < 0) + if (mode == 0) { lcd.setCursor(10, 1); - lcd.print(chosen + 1); + lcd.print(configuration.performance.voiceconfig_number[instance_id]); } - else + else if (mode == 1) { -#endif - if (yesno == true) + char tmp[FILENAME_LEN]; + sprintf(tmp, "/%s%d.syx", VOICE_CONFIG_NAME, configuration.performance.voiceconfig_number[instance_id]); + if (SD.exists(tmp)) + overwrite = true; + else + overwrite = false; + + lcd.setCursor(0, 1); + if (configuration.performance.voiceconfig_number[instance_id] == 0) + lcd.print(F("[DEFAULT]")); + else { - lcd.setCursor(1, 1); - lcd.print(F("YES")); + char tmp[10]; + sprintf(tmp, "[%7d]", configuration.performance.voiceconfig_number[instance_id]); + lcd.print(tmp); } + } + else if (mode == 2) + { + lcd.setCursor(12, 1); + if (yesno == true) + lcd.print(F("YES")); else - { - lcd.setCursor(1, 1); lcd.print(F("NO ")); - } -#if NUMDEXED > 1 } -#endif - //encoderDir[ENC_R].reset(); } + encoderDir[ENC_R].reset(); } if (LCDML.FUNC_close()) // ****** STABLE END ********* { - if (yesno == true) + if (mode < 0xff) { - LCDML.DISP_clear(); - lcd.print(F("Save Cfg SD")); - - save_sd_voiceconfig(configuration.performance.bank[instance_id], configuration.performance.voice[instance_id], instance_id); - lcd.setCursor(0, 1); - lcd.print(F("Done.")); + lcd.print("Canceled "); delay(500); } @@ -3525,60 +3614,14 @@ void UI_func_save_voiceconfig(uint8_t param) } } -void UI_func_save_voice(uint8_t param) -{ - static bool yesno; - - if (LCDML.FUNC_setup()) // ****** SETUP ********* - { - encoderDir[ENC_R].reset(); - - lcd.setCursor(0, 0); - lcd.print(F("Save Voice")); - lcd.setCursor(0, 1); - lcd.print(F("[NO ]")); - - if (LCDML.FUNC_loop()) // ****** LOOP ********* - { - if ((LCDML.BT_checkDown() || LCDML.BT_checkUp())) - { - yesno = !yesno; - if (yesno == true) - { - lcd.setCursor(1, 1); - lcd.print(F("YES")); - } - else - { - lcd.setCursor(1, 1); - lcd.print(F("NO ")); - } - } - } - - if (LCDML.FUNC_close()) // ****** STABLE END ********* - { - if (yesno == true) - { - LCDML.DISP_clear(); - lcd.print(F("Save Cfg default")); - - // Storing on inside bank TBD - - lcd.setCursor(0, 1); - lcd.print(F("Done.")); - delay(500); - } - - encoderDir[ENC_R].reset(); - } - } -} - void UI_func_load_fx(uint8_t param) { + static uint8_t mode; + if (LCDML.FUNC_setup()) // ****** SETUP ********* { + mode = 0; + encoderDir[ENC_R].reset(); lcd.setCursor(0, 0); @@ -3596,7 +3639,7 @@ void UI_func_load_fx(uint8_t param) if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) + 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()) { @@ -3606,6 +3649,22 @@ void UI_func_load_fx(uint8_t param) { configuration.performance.fx_number = constrain(configuration.performance.fx_number - ENCODER[ENC_L].speed(), FX_NUM_MIN, FX_NUM_MAX); } + else if (LCDML.BT_checkEnter()) + { + mode = 0xff; + eeprom_write(); + + if (load_sd_fx(configuration.performance.fx_number) == false) + lcd.print("Does not exist."); + else + lcd.print("Done. "); + delay(500); + + if (LCDML.MENU_getLastActivFunctionID() < 0xff) + LCDML.OTHER_jumpToID(LCDML.MENU_getLastActivFunctionID()); + else + LCDML.OTHER_setCursorToID(LCDML.MENU_getLastCursorPositionID()); + } lcd.setCursor(0, 1); if (configuration.performance.fx_number == 0) @@ -3621,11 +3680,13 @@ void UI_func_load_fx(uint8_t param) if (LCDML.FUNC_close()) // ****** STABLE END ********* { - eeprom_write(); - load_sd_fx(configuration.performance.fx_number); - lcd.setCursor(0, 1); - lcd.print("Done. "); - delay(500); + if (mode < 0xff) + { + lcd.setCursor(0, 1); + lcd.print("Canceled "); + delay(500); + } + encoderDir[ENC_R].reset(); } } @@ -3691,7 +3752,20 @@ void UI_func_save_fx(uint8_t param) } else { - LCDML.BT_quit(); // does not help :( + mode = 0xff; + eeprom_write(); + if (overwrite == false || yesno == true) + { + save_sd_fx(configuration.performance.fx_number); + lcd.setCursor(0, 1); + lcd.print("Done. "); + delay(500); + } + + if (LCDML.MENU_getLastActivFunctionID() < 0xff) + LCDML.OTHER_jumpToID(LCDML.MENU_getLastActivFunctionID()); + else + LCDML.OTHER_setCursorToID(LCDML.MENU_getLastCursorPositionID()); } } @@ -3728,15 +3802,64 @@ void UI_func_save_fx(uint8_t param) if (LCDML.FUNC_close()) // ****** STABLE END ********* { - eeprom_write(); - if (overwrite == false || yesno == true) + if (mode < 0xff) { - save_sd_fx(configuration.performance.fx_number); lcd.setCursor(0, 1); - lcd.print("Done. "); + lcd.print("Canceled "); delay(500); } + + encoderDir[ENC_R].reset(); + } +} + +void UI_func_save_voice(uint8_t param) +{ + static bool yesno; + + if (LCDML.FUNC_setup()) // ****** SETUP ********* + { encoderDir[ENC_R].reset(); + + lcd.setCursor(0, 0); + lcd.print(F("Save Voice")); + lcd.setCursor(0, 1); + lcd.print(F("[NO ]")); + + if (LCDML.FUNC_loop()) // ****** LOOP ********* + { + if ((LCDML.BT_checkDown() || LCDML.BT_checkUp())) + { + yesno = !yesno; + if (yesno == true) + { + lcd.setCursor(1, 1); + lcd.print(F("YES")); + } + else + { + lcd.setCursor(1, 1); + lcd.print(F("NO ")); + } + } + } + + if (LCDML.FUNC_close()) // ****** STABLE END ********* + { + if (yesno == true) + { + LCDML.DISP_clear(); + lcd.print(F("Save Cfg default")); + + // Storing on inside bank TBD + + lcd.setCursor(0, 1); + lcd.print(F("Done.")); + delay(500); + } + + encoderDir[ENC_R].reset(); + } } } diff --git a/UI_1_FX.h b/UI_1_FX.h index d02df26..31b8d64 100644 --- a/UI_1_FX.h +++ b/UI_1_FX.h @@ -26,7 +26,7 @@ #define _UI_H_ LCDML_add(0, LCDML_0, 1, "Voice", NULL); -LCDML_add(1, LCDML_0_1, 1, "Patch", UI_func_voice_select); +LCDML_add(1, LCDML_0_1, 1, "Select", UI_func_voice_select); LCDML_add(2, LCDML_0_1, 2, "Audio", NULL); LCDML_add(3, LCDML_0_1_2, 1, "Voice Level", UI_func_sound_intensity); LCDML_add(4, LCDML_0_1_2, 2, "Panorama", UI_func_panorama); @@ -99,25 +99,26 @@ LCDML_add(70, LCDML_0_2_3, 2, "Damping", UI_func_reverb_damping); LCDML_add(71, LCDML_0_2_3, 3, "Level", UI_func_reverb_level); LCDML_add(72, LCDML_0, 3, "Load/Save", NULL); LCDML_add(73, LCDML_0_3, 1, "Performance", NULL); -LCDML_add(74, LCDML_0_3_1, 1, "Load Perf. SD", UI_func_load_performance); -LCDML_add(75, LCDML_0_3_1, 2, "Save Perf. SD", UI_func_save_performance); -LCDML_add(76, LCDML_0_3, 2, "Voice", NULL); -LCDML_add(77, LCDML_0_3_2, 1, "Load Config SD", UI_func_load_voiceconfig); -LCDML_add(78, LCDML_0_3_2, 2, "Save Config SD", UI_func_save_voiceconfig); -LCDML_add(79, LCDML_0_3_2, 3, "Save Voice SD", UI_func_save_voice); -LCDML_add(80, LCDML_0_3, 3, "FX", NULL); -LCDML_add(81, LCDML_0_3_3, 1, "Load FX SD", UI_func_load_fx); -LCDML_add(82, LCDML_0_3_3, 2, "Save FX SD", UI_func_save_fx); -LCDML_add(83, LCDML_0_3, 4, "MIDI", NULL); -LCDML_add(84, LCDML_0_3_4, 1, "MIDI Recv Bank", UI_func_sysex_receive_bank); -LCDML_add(85, LCDML_0_3_4, 2, "MIDI Send Bank", UI_func_sysex_send_bank); -LCDML_add(86, LCDML_0_3, 5, "EEPROM Reset", UI_func_eeprom_reset); -LCDML_add(87, LCDML_0, 4, "System", NULL); -LCDML_add(88, LCDML_0_4, 3, "Volume", UI_func_volume); -LCDML_add(89, LCDML_0_4, 1, "Stereo/Mono", UI_func_stereo_mono); -LCDML_add(90, LCDML_0_4, 2, "MIDI Soft THRU", UI_func_midi_soft_thru); -LCDML_add(91, LCDML_0, 6, "Info", UI_func_information); -#define _LCDML_DISP_cnt 91 +LCDML_add(74, LCDML_0_3_1, 1, "Load Performance", UI_func_load_performance); +LCDML_add(75, LCDML_0_3_1, 2, "Save Performance", UI_func_save_performance); +LCDML_add(76, LCDML_0_3, 2, "Voice Config", NULL); +LCDML_add(77, LCDML_0_3_2, 1, "Load Voice Cfg", UI_func_load_voiceconfig); +LCDML_add(78, LCDML_0_3_2, 2, "Save Voice Cfg", UI_func_save_voiceconfig); +LCDML_add(79, LCDML_0_3, 3, "FX", NULL); +LCDML_add(80, LCDML_0_3_3, 1, "Load FX Cfg", UI_func_load_fx); +LCDML_add(81, LCDML_0_3_3, 2, "Save FX Cfg", UI_func_save_fx); +LCDML_add(82, LCDML_0_3, 4, "Voice", NULL); +LCDML_add(83, LCDML_0_3_4, 1, "Save Voice", UI_func_save_voice); +LCDML_add(84, LCDML_0_3, 5, "MIDI", NULL); +LCDML_add(85, LCDML_0_3_5, 1, "MIDI Recv Bank", UI_func_sysex_receive_bank); +LCDML_add(86, LCDML_0_3_5, 2, "MIDI Send Bank", UI_func_sysex_send_bank); +LCDML_add(87, LCDML_0_3, 6, "EEPROM Reset", UI_func_eeprom_reset); +LCDML_add(88, LCDML_0, 4, "System", NULL); +LCDML_add(89, LCDML_0_4, 3, "Volume", UI_func_volume); +LCDML_add(90, LCDML_0_4, 1, "Stereo/Mono", UI_func_stereo_mono); +LCDML_add(91, LCDML_0_4, 2, "MIDI Soft THRU", UI_func_midi_soft_thru); +LCDML_add(92, LCDML_0, 6, "Info", UI_func_information); +#define _LCDML_DISP_cnt 92 #define MENU_ID_OF_INSTANCE_2 58 -#define VOLUME_MENU_ID 88 +#define VOLUME_MENU_ID 89 #endif diff --git a/config.h b/config.h index 564868f..e5af379 100644 --- a/config.h +++ b/config.h @@ -223,12 +223,13 @@ #define MAX_VOICES 32 // voices per bank #define MAX_FX 15 #define MAX_PERFORMANCE 15 +#define MAX_VOICECONFIG 15 #define BANK_NAME_LEN 13 // FAT12 filenames (plus '\0') #define VOICE_NAME_LEN 11 // 10 (plus '\0') #define FILENAME_LEN BANK_NAME_LEN + VOICE_NAME_LEN -#define VOICE_CONFIG_NAME "VCFG" #define FX_CONFIG_NAME "FXCFG" #define PERFORMANCE_CONFIG_NAME "PCFG" +#define VOICE_CONFIG_NAME "VCFG" //************************************************************************************************* //* DO NO CHANGE ANYTHING BEYOND IF YOU DON'T KNOW WHAT YOU ARE DOING !!! @@ -517,6 +518,11 @@ enum { DEXED, CHORUS, DELAY, REVERB}; #define FX_NUM_MIN 0 #define FX_NUM_MAX MAX_FX #define FX_NUM_DEFAULT 0 + +#define VOICECONFIG_NUM_MIN 0 +#define VOICECONFIG_NUM_MAX MAX_VOICECONFIG +#define VOICECONFIG_NUM_DEFAULT 0 + // typedef struct { uint32_t checksum; @@ -575,6 +581,7 @@ typedef struct { uint32_t checksum; uint8_t bank[NUM_DEXED]; uint8_t voice[NUM_DEXED]; + uint8_t voiceconfig_number[NUM_DEXED]; uint8_t fx_number; } performance_t; diff --git a/dexed_sd.cpp b/dexed_sd.cpp index 3c89982..1156acc 100644 --- a/dexed_sd.cpp +++ b/dexed_sd.cpp @@ -76,7 +76,7 @@ bool load_sd_voice(uint8_t b, uint8_t v, uint8_t instance_id) #endif configuration.dexed[instance_id].transpose = MicroDexed[instance_id]->data[DEXED_VOICE_OFFSET + DEXED_TRANSPOSE]; - load_sd_voiceconfig(b, v, instance_id); // check for coice config to load + load_sd_voiceconfig(v, instance_id); // check for coice config to load return (ret); } @@ -176,17 +176,16 @@ bool get_sd_voice(File sysex, uint8_t voice_number, uint8_t* data) /****************************************************************************** SD VOICECONFIG ******************************************************************************/ -bool load_sd_voiceconfig(uint8_t b, uint8_t v, uint8_t instance_id) +bool load_sd_voiceconfig(uint8_t vc, uint8_t instance_id) { - v = constrain(v, 0, MAX_VOICES - 1); - b = constrain(b, 0, MAX_BANKS - 1); + vc = constrain(vc, 0, MAX_VOICECONFIG); if (sd_card > 0) { File sysex; char filename[FILENAME_LEN]; - sprintf(filename, "/%d/%s%d.syx", b, VOICE_CONFIG_NAME, v); + sprintf(filename, "/%s%d.syx", VOICE_CONFIG_NAME, vc); // first check if file exists... if (SD.exists(filename)) @@ -225,23 +224,20 @@ bool load_sd_voiceconfig(uint8_t b, uint8_t v, uint8_t instance_id) return (false); } -bool save_sd_voiceconfig(uint8_t b, uint8_t v, uint8_t instance_id) +bool save_sd_voiceconfig(uint8_t vc, uint8_t instance_id) { - v = constrain(v, 0, MAX_VOICES - 1); - b = constrain(b, 0, MAX_BANKS - 1); + vc = constrain(vc, 0, MAX_VOICECONFIG); if (sd_card > 0) { File sysex; char filename[FILENAME_LEN]; - sprintf(filename, "/%d/%s%d.syx", b, VOICE_CONFIG_NAME, v); + sprintf(filename, "/%s%d.syx", VOICE_CONFIG_NAME, vc); #ifdef DEBUG Serial.print(F("Saving voice config ")); - Serial.print(b); - Serial.print(F("/")); - Serial.print(v); + Serial.print(vc); Serial.print(F("[")); Serial.print(instance_id); Serial.print(F("]")); diff --git a/dexed_sd.h b/dexed_sd.h index 5aee272..71e7115 100644 --- a/dexed_sd.h +++ b/dexed_sd.h @@ -48,8 +48,8 @@ extern uint32_t crc32(byte * calc_start, uint16_t calc_bytes); bool load_sd_voice(uint8_t b, uint8_t v, uint8_t instance_id); bool get_sd_voice(File sysex, uint8_t voice_number, uint8_t* data); -bool load_sd_voiceconfig(uint8_t b, uint8_t v, uint8_t instance_id); -bool save_sd_voiceconfig(uint8_t b, uint8_t v, uint8_t instance_id); +bool load_sd_voiceconfig(uint8_t vc, uint8_t instance_id); +bool save_sd_voiceconfig(uint8_t vc, uint8_t instance_id); bool load_sd_fx(uint8_t fx); bool save_sd_fx(uint8_t fx); diff --git a/doc/MicroDexed_Menu_Structure.odt b/doc/MicroDexed_Menu_Structure.odt new file mode 100644 index 0000000..3148fac Binary files /dev/null and b/doc/MicroDexed_Menu_Structure.odt differ