Fixed displaying voice name when uploading via SYSEX.

pull/32/head
Holger Wirtz 5 years ago
parent 8920c97b32
commit fdd7097930
  1. 8
      MicroDexed.ino
  2. 21
      UI.hpp

@ -215,6 +215,8 @@ const uint8_t mosi_pins[] = { SDCARD_TEENSY_MOSI_PIN, SDCARD_AUDIO_MOSI_PIN };
const uint8_t sck_pins[] = { SDCARD_TEENSY_SCK_PIN, SDCARD_AUDIO_SCK_PIN }; const uint8_t sck_pins[] = { SDCARD_TEENSY_SCK_PIN, SDCARD_AUDIO_SCK_PIN };
char version_string[LCD_cols + 1]; char version_string[LCD_cols + 1];
char sd_string[LCD_cols + 1]; char sd_string[LCD_cols + 1];
char g_voice_name[NUM_DEXED][VOICE_NAME_LEN];
char g_bank_name[NUM_DEXED][BANK_NAME_LEN];
#if defined(USE_FX) #if defined(USE_FX)
// Allocate the delay lines for chorus // Allocate the delay lines for chorus
@ -378,6 +380,9 @@ void setup()
{ {
// load default SYSEX data // load default SYSEX data
load_sd_voice(configuration.performance.bank[instance_id], configuration.performance.voice[instance_id], instance_id); load_sd_voice(configuration.performance.bank[instance_id], configuration.performance.voice[instance_id], instance_id);
memset(g_voice_name[instance_id], 0, VOICE_NAME_LEN);
memset(g_bank_name[instance_id], 0, BANK_NAME_LEN);
} }
} }
@ -962,6 +967,9 @@ void handleSystemExclusive(byte * sysex, uint len)
// load sysex-data into voice memory // load sysex-data into voice memory
MicroDexed[instance_id]->loadVoiceParameters(&sysex[6]); MicroDexed[instance_id]->loadVoiceParameters(&sysex[6]);
// show voice name
strncpy(g_voice_name[instance_id], (char*)&sysex[151], VOICE_NAME_LEN - 1);
LCDML.OTHER_updateFunc(); LCDML.OTHER_updateFunc();
LCDML.loop_menu(); LCDML.loop_menu();

@ -87,6 +87,8 @@ extern AudioAmplifier* dexed_level[NUM_DEXED];
extern AudioEffectMonoStereo* mono2stereo[NUM_DEXED]; extern AudioEffectMonoStereo* mono2stereo[NUM_DEXED];
extern AudioSynthWaveformDc* pan[NUM_DEXED]; extern AudioSynthWaveformDc* pan[NUM_DEXED];
extern char sd_string[LCD_cols + 1]; extern char sd_string[LCD_cols + 1];
extern char g_voice_name[NUM_DEXED][VOICE_NAME_LEN];
extern char g_bank_name[NUM_DEXED][BANK_NAME_LEN];
/*********************************************************************** /***********************************************************************
GLOBAL GLOBAL
@ -3288,6 +3290,7 @@ void UI_func_voice_select(uint8_t param)
switch (menu_voice_select) switch (menu_voice_select)
{ {
case MENU_VOICE_BANK: case MENU_VOICE_BANK:
memset(g_bank_name[instance_id], 0, BANK_NAME_LEN);
bank_tmp = constrain(configuration.performance.bank[instance_id] - ENCODER[ENC_R].speed(), 0, MAX_BANKS - 1); bank_tmp = constrain(configuration.performance.bank[instance_id] - ENCODER[ENC_R].speed(), 0, MAX_BANKS - 1);
configuration.performance.bank[instance_id] = bank_tmp; configuration.performance.bank[instance_id] = bank_tmp;
#ifdef DISPLAY_LCD_SPI #ifdef DISPLAY_LCD_SPI
@ -3299,6 +3302,7 @@ void UI_func_voice_select(uint8_t param)
#endif #endif
break; break;
case MENU_VOICE_SOUND: case MENU_VOICE_SOUND:
memset(g_voice_name[instance_id], 0, VOICE_NAME_LEN);
voice_tmp = configuration.performance.voice[instance_id] - ENCODER[ENC_R].speed(); voice_tmp = configuration.performance.voice[instance_id] - ENCODER[ENC_R].speed();
if (voice_tmp < 0 && configuration.performance.bank[instance_id] - 1 >= 0) if (voice_tmp < 0 && configuration.performance.bank[instance_id] - 1 >= 0)
{ {
@ -3328,6 +3332,7 @@ void UI_func_voice_select(uint8_t param)
switch (menu_voice_select) switch (menu_voice_select)
{ {
case MENU_VOICE_BANK: case MENU_VOICE_BANK:
memset(g_bank_name[instance_id], 0, BANK_NAME_LEN);
bank_tmp = constrain(configuration.performance.bank[instance_id] + ENCODER[ENC_R].speed(), 0, MAX_BANKS - 1); bank_tmp = constrain(configuration.performance.bank[instance_id] + ENCODER[ENC_R].speed(), 0, MAX_BANKS - 1);
configuration.performance.bank[instance_id] = bank_tmp; configuration.performance.bank[instance_id] = bank_tmp;
#ifdef DISPLAY_LCD_SPI #ifdef DISPLAY_LCD_SPI
@ -3339,6 +3344,7 @@ void UI_func_voice_select(uint8_t param)
#endif #endif
break; break;
case MENU_VOICE_SOUND: case MENU_VOICE_SOUND:
memset(g_voice_name[instance_id], 0, VOICE_NAME_LEN);
voice_tmp = configuration.performance.voice[instance_id] + ENCODER[ENC_R].speed(); voice_tmp = configuration.performance.voice[instance_id] + ENCODER[ENC_R].speed();
if (voice_tmp >= MAX_VOICES && configuration.performance.bank[instance_id] + 1 < MAX_BANKS) if (voice_tmp >= MAX_VOICES && configuration.performance.bank[instance_id] + 1 < MAX_BANKS)
{ {
@ -3371,10 +3377,25 @@ void UI_func_voice_select(uint8_t param)
} }
} }
if (strlen(g_bank_name[instance_id]) > 0)
{
strncpy(bank_name, g_bank_name[instance_id], sizeof(bank_name));
}
else
{
if (!get_bank_name(configuration.performance.bank[instance_id], bank_name, sizeof(bank_name))) if (!get_bank_name(configuration.performance.bank[instance_id], bank_name, sizeof(bank_name)))
strncpy(bank_name, "*ERROR*", sizeof(bank_name)); strncpy(bank_name, "*ERROR*", sizeof(bank_name));
}
if (strlen(g_voice_name[instance_id]) > 0)
{
strncpy(voice_name, g_voice_name[instance_id], sizeof(voice_name));
}
else
{
if (!get_voice_by_bank_name(configuration.performance.bank[instance_id], bank_name, configuration.performance.voice[instance_id], voice_name, sizeof(voice_name))) if (!get_voice_by_bank_name(configuration.performance.bank[instance_id], bank_name, configuration.performance.voice[instance_id], voice_name, sizeof(voice_name)))
strncpy(voice_name, "*ERROR*", sizeof(voice_name)); strncpy(voice_name, "*ERROR*", sizeof(voice_name));
}
lcd.show(0, 0, 2, configuration.performance.bank[instance_id]); lcd.show(0, 0, 2, configuration.performance.bank[instance_id]);
lcd.show(1, 0, 2, configuration.performance.voice[instance_id] + 1); lcd.show(1, 0, 2, configuration.performance.voice[instance_id] + 1);

Loading…
Cancel
Save