|
|
|
@ -1874,19 +1874,19 @@ void UI_func_polyphony(uint8_t param) |
|
|
|
|
void UI_func_polyphony(uint8_t param) |
|
|
|
|
{ |
|
|
|
|
char poly_value_string[3]; |
|
|
|
|
static uint8_t instance_id; |
|
|
|
|
static uint8_t poly_instance_id; |
|
|
|
|
|
|
|
|
|
if (LCDML.FUNC_setup()) // ****** SETUP *********
|
|
|
|
|
{ |
|
|
|
|
encoderDir[ENC_R].reset(); |
|
|
|
|
|
|
|
|
|
if (LCDML.FUNC_getID() > MENU_ID_OF_INSTANCE_2) |
|
|
|
|
instance_id = 1; |
|
|
|
|
poly_instance_id = 1; |
|
|
|
|
else |
|
|
|
|
instance_id = 0; |
|
|
|
|
poly_instance_id = 0; |
|
|
|
|
|
|
|
|
|
lcd.show(0, 0, 16, "Polyphony"); |
|
|
|
|
if (instance_id == 0) |
|
|
|
|
if (poly_instance_id == 0) |
|
|
|
|
lcd.show(1, 0, 16, "1:[ ] 2:"); |
|
|
|
|
else |
|
|
|
|
lcd.show(1, 0, 16, "1: 2:[ ]"); |
|
|
|
@ -1904,19 +1904,19 @@ void UI_func_polyphony(uint8_t param) |
|
|
|
|
if (LCDML.BT_checkDown()) |
|
|
|
|
{ |
|
|
|
|
if (configuration.dexed[0].polyphony + configuration.dexed[1].polyphony + 1 <= POLYPHONY_MAX) |
|
|
|
|
configuration.dexed[instance_id].polyphony = constrain(configuration.dexed[instance_id].polyphony + 1, POLYPHONY_MIN, POLYPHONY_MAX); |
|
|
|
|
configuration.dexed[poly_instance_id].polyphony = constrain(configuration.dexed[poly_instance_id].polyphony + 1, POLYPHONY_MIN, POLYPHONY_MAX); |
|
|
|
|
} |
|
|
|
|
else if (LCDML.BT_checkUp()) |
|
|
|
|
{ |
|
|
|
|
if (configuration.dexed[instance_id].polyphony - 1 < 0) |
|
|
|
|
configuration.dexed[instance_id].polyphony = 0; |
|
|
|
|
if (configuration.dexed[poly_instance_id].polyphony - 1 < 0) |
|
|
|
|
configuration.dexed[poly_instance_id].polyphony = 0; |
|
|
|
|
else |
|
|
|
|
configuration.dexed[instance_id].polyphony = constrain(configuration.dexed[instance_id].polyphony - 1, POLYPHONY_MIN - 1, POLYPHONY_MAX); |
|
|
|
|
configuration.dexed[poly_instance_id].polyphony = constrain(configuration.dexed[poly_instance_id].polyphony - 1, POLYPHONY_MIN - 1, POLYPHONY_MAX); |
|
|
|
|
} |
|
|
|
|
else if (LCDML.BT_checkEnter()) |
|
|
|
|
{ |
|
|
|
|
instance_id = !instance_id; |
|
|
|
|
if (instance_id == 0) |
|
|
|
|
poly_instance_id = !poly_instance_id; |
|
|
|
|
if (poly_instance_id == 0) |
|
|
|
|
lcd.show(1, 0, 16, "1:[ ] 2:"); |
|
|
|
|
else |
|
|
|
|
lcd.show(1, 0, 16, "1: 2:[ ]"); |
|
|
|
@ -1927,7 +1927,7 @@ void UI_func_polyphony(uint8_t param) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (instance_id == 0) |
|
|
|
|
if (poly_instance_id == 0) |
|
|
|
|
{ |
|
|
|
|
sprintf(poly_value_string, "%2d", configuration.dexed[0].polyphony); |
|
|
|
|
lcd.show(1, 3, 2, poly_value_string); |
|
|
|
@ -3307,7 +3307,7 @@ void UI_func_eeprom_reset(uint8_t param) |
|
|
|
|
|
|
|
|
|
void UI_func_voice_select(uint8_t param) |
|
|
|
|
{ |
|
|
|
|
static uint8_t instance_id = 0; |
|
|
|
|
static uint8_t voice_select_instance_id; |
|
|
|
|
static uint8_t menu_voice_select = MENU_VOICE_SOUND; |
|
|
|
|
|
|
|
|
|
if (LCDML.FUNC_setup()) // ****** SETUP *********
|
|
|
|
@ -3317,32 +3317,32 @@ void UI_func_voice_select(uint8_t param) |
|
|
|
|
encoderDir[ENC_R].reset(); |
|
|
|
|
|
|
|
|
|
if (LCDML.FUNC_getID() > MENU_ID_OF_INSTANCE_2) |
|
|
|
|
instance_id = 1; |
|
|
|
|
voice_select_instance_id = 1; |
|
|
|
|
else |
|
|
|
|
instance_id = 0; |
|
|
|
|
voice_select_instance_id = 0; |
|
|
|
|
|
|
|
|
|
char bank_name[BANK_NAME_LEN]; |
|
|
|
|
char voice_name[VOICE_NAME_LEN]; |
|
|
|
|
|
|
|
|
|
if (!get_bank_name(configuration.performance.bank[instance_id], bank_name, sizeof(bank_name))) |
|
|
|
|
if (!get_bank_name(configuration.performance.bank[voice_select_instance_id], bank_name, sizeof(bank_name))) |
|
|
|
|
strncpy(bank_name, "*ERROR*", sizeof(bank_name)); |
|
|
|
|
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[voice_select_instance_id], bank_name, configuration.performance.voice[voice_select_instance_id], voice_name, sizeof(voice_name))) |
|
|
|
|
strncpy(voice_name, "*ERROR*", sizeof(voice_name)); |
|
|
|
|
|
|
|
|
|
lcd.show(0, 0, 2, configuration.performance.bank[instance_id]); |
|
|
|
|
lcd.show(1, 0, 2, configuration.performance.voice[instance_id] + 1); |
|
|
|
|
lcd.show(0, 0, 2, configuration.performance.bank[voice_select_instance_id]); |
|
|
|
|
lcd.show(1, 0, 2, configuration.performance.voice[voice_select_instance_id] + 1); |
|
|
|
|
lcd.show(0, 4, 10, bank_name); |
|
|
|
|
lcd.show(1, 4, 10, voice_name); |
|
|
|
|
|
|
|
|
|
#if NUM_DEXED > 1 |
|
|
|
|
lcd.setCursor(15, 0); |
|
|
|
|
if (instance_id == 0) |
|
|
|
|
lcd.write(instance_id); |
|
|
|
|
if (voice_select_instance_id == 0) |
|
|
|
|
lcd.write(voice_select_instance_id); |
|
|
|
|
else |
|
|
|
|
lcd.write(2); |
|
|
|
|
lcd.setCursor(15, 1); |
|
|
|
|
if (instance_id == 1) |
|
|
|
|
lcd.write(instance_id); |
|
|
|
|
if (voice_select_instance_id == 1) |
|
|
|
|
lcd.write(voice_select_instance_id); |
|
|
|
|
else |
|
|
|
|
lcd.write(3); |
|
|
|
|
#endif |
|
|
|
@ -3379,37 +3379,37 @@ void UI_func_voice_select(uint8_t param) |
|
|
|
|
switch (menu_voice_select) |
|
|
|
|
{ |
|
|
|
|
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); |
|
|
|
|
configuration.performance.bank[instance_id] = bank_tmp; |
|
|
|
|
memset(g_bank_name[voice_select_instance_id], 0, BANK_NAME_LEN); |
|
|
|
|
bank_tmp = constrain(configuration.performance.bank[voice_select_instance_id] - ENCODER[ENC_R].speed(), 0, MAX_BANKS - 1); |
|
|
|
|
configuration.performance.bank[voice_select_instance_id] = bank_tmp; |
|
|
|
|
#ifdef DISPLAY_LCD_SPI |
|
|
|
|
change_disp_sd(false); |
|
|
|
|
#endif |
|
|
|
|
load_sd_voice(configuration.performance.bank[instance_id], configuration.performance.voice[instance_id], instance_id); |
|
|
|
|
load_sd_voice(configuration.performance.bank[voice_select_instance_id], configuration.performance.voice[voice_select_instance_id], voice_select_instance_id); |
|
|
|
|
#ifdef DISPLAY_LCD_SPI |
|
|
|
|
change_disp_sd(true); |
|
|
|
|
#endif |
|
|
|
|
break; |
|
|
|
|
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(); |
|
|
|
|
if (voice_tmp < 0 && configuration.performance.bank[instance_id] - 1 >= 0) |
|
|
|
|
memset(g_voice_name[voice_select_instance_id], 0, VOICE_NAME_LEN); |
|
|
|
|
voice_tmp = configuration.performance.voice[voice_select_instance_id] - ENCODER[ENC_R].speed(); |
|
|
|
|
if (voice_tmp < 0 && configuration.performance.bank[voice_select_instance_id] - 1 >= 0) |
|
|
|
|
{ |
|
|
|
|
configuration.performance.bank[instance_id]--; |
|
|
|
|
configuration.performance.bank[instance_id] = constrain(configuration.performance.bank[instance_id], 0, MAX_BANKS - 1); |
|
|
|
|
configuration.performance.bank[voice_select_instance_id]--; |
|
|
|
|
configuration.performance.bank[voice_select_instance_id] = constrain(configuration.performance.bank[voice_select_instance_id], 0, MAX_BANKS - 1); |
|
|
|
|
} |
|
|
|
|
else if (voice_tmp < 0 && configuration.performance.bank[instance_id] - 1 <= 0) |
|
|
|
|
else if (voice_tmp < 0 && configuration.performance.bank[voice_select_instance_id] - 1 <= 0) |
|
|
|
|
{ |
|
|
|
|
voice_tmp = 0; |
|
|
|
|
} |
|
|
|
|
if (voice_tmp < 0) |
|
|
|
|
voice_tmp = MAX_VOICES + voice_tmp; |
|
|
|
|
configuration.performance.voice[instance_id] = constrain(voice_tmp, 0, MAX_VOICES - 1); |
|
|
|
|
configuration.performance.voice[voice_select_instance_id] = constrain(voice_tmp, 0, MAX_VOICES - 1); |
|
|
|
|
|
|
|
|
|
#ifdef DISPLAY_LCD_SPI |
|
|
|
|
change_disp_sd(false); |
|
|
|
|
#endif |
|
|
|
|
load_sd_voice(configuration.performance.bank[instance_id], configuration.performance.voice[instance_id], instance_id); |
|
|
|
|
load_sd_voice(configuration.performance.bank[voice_select_instance_id], configuration.performance.voice[voice_select_instance_id], voice_select_instance_id); |
|
|
|
|
#ifdef DISPLAY_LCD_SPI |
|
|
|
|
change_disp_sd(true); |
|
|
|
|
#endif |
|
|
|
@ -3421,36 +3421,36 @@ void UI_func_voice_select(uint8_t param) |
|
|
|
|
switch (menu_voice_select) |
|
|
|
|
{ |
|
|
|
|
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); |
|
|
|
|
configuration.performance.bank[instance_id] = bank_tmp; |
|
|
|
|
memset(g_bank_name[voice_select_instance_id], 0, BANK_NAME_LEN); |
|
|
|
|
bank_tmp = constrain(configuration.performance.bank[voice_select_instance_id] + ENCODER[ENC_R].speed(), 0, MAX_BANKS - 1); |
|
|
|
|
configuration.performance.bank[voice_select_instance_id] = bank_tmp; |
|
|
|
|
#ifdef DISPLAY_LCD_SPI |
|
|
|
|
change_disp_sd(false); |
|
|
|
|
#endif |
|
|
|
|
load_sd_voice(configuration.performance.bank[instance_id], configuration.performance.voice[instance_id], instance_id); |
|
|
|
|
load_sd_voice(configuration.performance.bank[voice_select_instance_id], configuration.performance.voice[voice_select_instance_id], voice_select_instance_id); |
|
|
|
|
#ifdef DISPLAY_LCD_SPI |
|
|
|
|
change_disp_sd(true); |
|
|
|
|
#endif |
|
|
|
|
break; |
|
|
|
|
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(); |
|
|
|
|
if (voice_tmp >= MAX_VOICES && configuration.performance.bank[instance_id] + 1 < MAX_BANKS) |
|
|
|
|
memset(g_voice_name[voice_select_instance_id], 0, VOICE_NAME_LEN); |
|
|
|
|
voice_tmp = configuration.performance.voice[voice_select_instance_id] + ENCODER[ENC_R].speed(); |
|
|
|
|
if (voice_tmp >= MAX_VOICES && configuration.performance.bank[voice_select_instance_id] + 1 < MAX_BANKS) |
|
|
|
|
{ |
|
|
|
|
voice_tmp %= MAX_VOICES; |
|
|
|
|
configuration.performance.bank[instance_id]++; |
|
|
|
|
configuration.performance.bank[instance_id] = constrain(configuration.performance.bank[instance_id], 0, MAX_BANKS - 1); |
|
|
|
|
configuration.performance.bank[voice_select_instance_id]++; |
|
|
|
|
configuration.performance.bank[voice_select_instance_id] = constrain(configuration.performance.bank[voice_select_instance_id], 0, MAX_BANKS - 1); |
|
|
|
|
} |
|
|
|
|
else if (voice_tmp >= MAX_VOICES && configuration.performance.bank[instance_id] + 1 >= MAX_BANKS) |
|
|
|
|
else if (voice_tmp >= MAX_VOICES && configuration.performance.bank[voice_select_instance_id] + 1 >= MAX_BANKS) |
|
|
|
|
{ |
|
|
|
|
voice_tmp = MAX_VOICES - 1; |
|
|
|
|
} |
|
|
|
|
configuration.performance.voice[instance_id] = constrain(voice_tmp, 0, MAX_VOICES - 1); |
|
|
|
|
configuration.performance.voice[voice_select_instance_id] = constrain(voice_tmp, 0, MAX_VOICES - 1); |
|
|
|
|
|
|
|
|
|
#ifdef DISPLAY_LCD_SPI |
|
|
|
|
change_disp_sd(false); |
|
|
|
|
#endif |
|
|
|
|
load_sd_voice(configuration.performance.bank[instance_id], configuration.performance.voice[instance_id], instance_id); |
|
|
|
|
load_sd_voice(configuration.performance.bank[voice_select_instance_id], configuration.performance.voice[voice_select_instance_id], voice_select_instance_id); |
|
|
|
|
#ifdef DISPLAY_LCD_SPI |
|
|
|
|
change_disp_sd(true); |
|
|
|
|
#endif |
|
|
|
@ -3471,29 +3471,29 @@ void UI_func_voice_select(uint8_t param) |
|
|
|
|
if (menu_voice_select == MENU_VOICE_BANK) |
|
|
|
|
{ |
|
|
|
|
menu_voice_select = MENU_VOICE_SOUND; |
|
|
|
|
instance_id = !instance_id; |
|
|
|
|
voice_select_instance_id = !voice_select_instance_id; |
|
|
|
|
|
|
|
|
|
char bank_name[BANK_NAME_LEN]; |
|
|
|
|
char voice_name[VOICE_NAME_LEN]; |
|
|
|
|
|
|
|
|
|
if (!get_bank_name(configuration.performance.bank[instance_id], bank_name, sizeof(bank_name))) |
|
|
|
|
if (!get_bank_name(configuration.performance.bank[voice_select_instance_id], bank_name, sizeof(bank_name))) |
|
|
|
|
strncpy(bank_name, "*ERROR*", sizeof(bank_name)); |
|
|
|
|
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[voice_select_instance_id], bank_name, configuration.performance.voice[voice_select_instance_id], voice_name, sizeof(voice_name))) |
|
|
|
|
strncpy(voice_name, "*ERROR*", sizeof(voice_name)); |
|
|
|
|
|
|
|
|
|
lcd.show(0, 0, 2, configuration.performance.bank[instance_id]); |
|
|
|
|
lcd.show(1, 0, 2, configuration.performance.voice[instance_id] + 1); |
|
|
|
|
lcd.show(0, 0, 2, configuration.performance.bank[voice_select_instance_id]); |
|
|
|
|
lcd.show(1, 0, 2, configuration.performance.voice[voice_select_instance_id] + 1); |
|
|
|
|
lcd.show(0, 4, 10, bank_name); |
|
|
|
|
lcd.show(1, 4, 10, voice_name); |
|
|
|
|
|
|
|
|
|
lcd.setCursor(15, 0); |
|
|
|
|
if (instance_id == 0) |
|
|
|
|
lcd.write(instance_id); |
|
|
|
|
if (voice_select_instance_id == 0) |
|
|
|
|
lcd.write(voice_select_instance_id); |
|
|
|
|
else |
|
|
|
|
lcd.write(2); |
|
|
|
|
lcd.setCursor(15, 1); |
|
|
|
|
if (instance_id == 1) |
|
|
|
|
lcd.write(instance_id); |
|
|
|
|
if (voice_select_instance_id == 1) |
|
|
|
|
lcd.write(voice_select_instance_id); |
|
|
|
|
else |
|
|
|
|
lcd.write(3); |
|
|
|
|
} |
|
|
|
@ -3503,28 +3503,28 @@ void UI_func_voice_select(uint8_t param) |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (strlen(g_bank_name[instance_id]) > 0) |
|
|
|
|
if (strlen(g_bank_name[voice_select_instance_id]) > 0) |
|
|
|
|
{ |
|
|
|
|
strncpy(bank_name, g_bank_name[instance_id], sizeof(bank_name)); |
|
|
|
|
strncpy(bank_name, g_bank_name[voice_select_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[voice_select_instance_id], bank_name, sizeof(bank_name))) |
|
|
|
|
strncpy(bank_name, "*ERROR*", sizeof(bank_name)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (strlen(g_voice_name[instance_id]) > 0) |
|
|
|
|
if (strlen(g_voice_name[voice_select_instance_id]) > 0) |
|
|
|
|
{ |
|
|
|
|
strncpy(voice_name, g_voice_name[instance_id], sizeof(voice_name)); |
|
|
|
|
strncpy(voice_name, g_voice_name[voice_select_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[voice_select_instance_id], bank_name, configuration.performance.voice[voice_select_instance_id], voice_name, sizeof(voice_name))) |
|
|
|
|
strncpy(voice_name, "*ERROR*", sizeof(voice_name)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
lcd.show(0, 0, 2, configuration.performance.bank[instance_id]); |
|
|
|
|
lcd.show(1, 0, 2, configuration.performance.voice[instance_id] + 1); |
|
|
|
|
lcd.show(0, 0, 2, configuration.performance.bank[voice_select_instance_id]); |
|
|
|
|
lcd.show(1, 0, 2, configuration.performance.voice[voice_select_instance_id] + 1); |
|
|
|
|
lcd.show(0, 4, 10, bank_name); |
|
|
|
|
lcd.show(1, 4, 10, voice_name); |
|
|
|
|
|
|
|
|
@ -3550,7 +3550,7 @@ void UI_func_voice_select(uint8_t param) |
|
|
|
|
lcd_special_chars(SCROLLBAR); |
|
|
|
|
|
|
|
|
|
encoderDir[ENC_R].reset(); |
|
|
|
|
if (instance_id == 0) |
|
|
|
|
if (voice_select_instance_id == 0) |
|
|
|
|
{ |
|
|
|
|
//eeprom_update_var(offsetof(configuration_s, performance.voice[0]), configuration.performance.voice[0], "configuration.performance.voice[0]");
|
|
|
|
|
//eeprom_update_var(offsetof(configuration_s, performance.bank[0]), configuration.performance.bank[0], "configuration.performance.bank[0]");
|
|
|
|
@ -3560,8 +3560,8 @@ void UI_func_voice_select(uint8_t param) |
|
|
|
|
#if NUM_DEXED > 1 |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, performance.voice[0]), configuration.performance.voice[1]); |
|
|
|
|
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, performance.bank[0]), configuration.performance.bank[1]); |
|
|
|
|
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, performance.voice[1]), configuration.performance.voice[1]); |
|
|
|
|
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, performance.bank[1]), configuration.performance.bank[1]); |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|