|
|
@ -38,12 +38,18 @@ |
|
|
|
#define _LCDML_DISP_cfg_scrollbar 1 // enable a scrollbar
|
|
|
|
#define _LCDML_DISP_cfg_scrollbar 1 // enable a scrollbar
|
|
|
|
|
|
|
|
|
|
|
|
extern config_t configuration; |
|
|
|
extern config_t configuration; |
|
|
|
void set_volume(float v, float p); |
|
|
|
//void set_volume(float v, float p);
|
|
|
|
extern char bank_names[MAX_BANKS][BANK_NAME_LEN]; |
|
|
|
extern char bank_names[MAX_BANKS][BANK_NAME_LEN]; |
|
|
|
extern char bank_name[BANK_NAME_LEN]; |
|
|
|
extern char bank_name[BANK_NAME_LEN]; |
|
|
|
extern char voice_name[VOICE_NAME_LEN]; |
|
|
|
extern char voice_name[VOICE_NAME_LEN]; |
|
|
|
extern char voice_names[MAX_VOICES][VOICE_NAME_LEN]; |
|
|
|
extern char voice_names[MAX_VOICES][VOICE_NAME_LEN]; |
|
|
|
extern void strip_extension(char* s, char *target); |
|
|
|
extern void strip_extension(char* s, char *target); |
|
|
|
|
|
|
|
extern void eeprom_write(void); |
|
|
|
|
|
|
|
extern bool get_voice_names_from_bank(uint8_t b); |
|
|
|
|
|
|
|
extern bool load_sysex(uint8_t b, uint8_t v); |
|
|
|
|
|
|
|
extern value_change_t soften_volume; |
|
|
|
|
|
|
|
extern value_change_t soften_filter_res; |
|
|
|
|
|
|
|
extern value_change_t soften_filter_cut; |
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
/***********************************************************************
|
|
|
|
GLOBAL |
|
|
|
GLOBAL |
|
|
@ -62,7 +68,9 @@ const uint8_t scroll_bar[5][8] = { |
|
|
|
|
|
|
|
|
|
|
|
enum { ENC_R, ENC_L }; |
|
|
|
enum { ENC_R, ENC_L }; |
|
|
|
enum { MENU_START, MENU_VOICE, MENU_EDIT, MENU_VOLUME }; |
|
|
|
enum { MENU_START, MENU_VOICE, MENU_EDIT, MENU_VOLUME }; |
|
|
|
|
|
|
|
enum {MENU_VOICE_BANK, MENU_VOICE_SOUND}; |
|
|
|
uint8_t menu_state = MENU_START; |
|
|
|
uint8_t menu_state = MENU_START; |
|
|
|
|
|
|
|
uint8_t menu_voice = MENU_VOICE_SOUND; |
|
|
|
|
|
|
|
|
|
|
|
void lcdml_menu_display(void); |
|
|
|
void lcdml_menu_display(void); |
|
|
|
void lcdml_voice_menu_display(void); |
|
|
|
void lcdml_voice_menu_display(void); |
|
|
@ -184,8 +192,34 @@ void lcdml_menu_control(void) |
|
|
|
case MENU_VOICE: |
|
|
|
case MENU_VOICE: |
|
|
|
#ifdef DEBUG |
|
|
|
#ifdef DEBUG |
|
|
|
Serial.println(F("State: MENU_VOICE, Encoder left down")); |
|
|
|
Serial.println(F("State: MENU_VOICE, Encoder left down")); |
|
|
|
break; |
|
|
|
|
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
switch (menu_voice) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
case MENU_VOICE_BANK: |
|
|
|
|
|
|
|
if (configuration.bank < MAX_BANKS) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
configuration.bank++; |
|
|
|
|
|
|
|
load_sysex(configuration.bank, configuration.voice); |
|
|
|
|
|
|
|
get_voice_names_from_bank(configuration.bank); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case MENU_VOICE_SOUND: |
|
|
|
|
|
|
|
if (configuration.voice < 31) |
|
|
|
|
|
|
|
configuration.voice++; |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (configuration.bank < MAX_BANKS) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
configuration.bank++; |
|
|
|
|
|
|
|
configuration.voice = 0; |
|
|
|
|
|
|
|
load_sysex(configuration.bank, configuration.voice); |
|
|
|
|
|
|
|
get_voice_names_from_bank(configuration.bank); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
eeprom_write(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
UI_func_voice_selection(0); |
|
|
|
|
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
ENCODER[ENC_R].write(g_LCDML_CONTROL_Encoder_position[ENC_R] + 4); |
|
|
|
ENCODER[ENC_R].write(g_LCDML_CONTROL_Encoder_position[ENC_R] + 4); |
|
|
@ -211,8 +245,34 @@ void lcdml_menu_control(void) |
|
|
|
case MENU_VOICE: |
|
|
|
case MENU_VOICE: |
|
|
|
#ifdef DEBUG |
|
|
|
#ifdef DEBUG |
|
|
|
Serial.println(F("State: MENU_VOICE, Encoder left up")); |
|
|
|
Serial.println(F("State: MENU_VOICE, Encoder left up")); |
|
|
|
break; |
|
|
|
|
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
switch (menu_voice) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
case MENU_VOICE_BANK: |
|
|
|
|
|
|
|
if (configuration.bank > 0) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
configuration.bank--; |
|
|
|
|
|
|
|
load_sysex(configuration.bank, configuration.voice); |
|
|
|
|
|
|
|
get_voice_names_from_bank(configuration.bank); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case MENU_VOICE_SOUND: |
|
|
|
|
|
|
|
if (configuration.voice > 0) |
|
|
|
|
|
|
|
configuration.voice--; |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (configuration.bank > 0) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
configuration.bank--; |
|
|
|
|
|
|
|
configuration.voice = 31; |
|
|
|
|
|
|
|
load_sysex(configuration.bank, configuration.voice); |
|
|
|
|
|
|
|
get_voice_names_from_bank(configuration.bank); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
eeprom_write(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
UI_func_voice_selection(0); |
|
|
|
|
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
ENCODER[ENC_R].write(g_LCDML_CONTROL_Encoder_position[ENC_R] - 4); |
|
|
|
ENCODER[ENC_R].write(g_LCDML_CONTROL_Encoder_position[ENC_R] - 4); |
|
|
@ -258,6 +318,11 @@ void lcdml_menu_control(void) |
|
|
|
#ifdef DEBUG |
|
|
|
#ifdef DEBUG |
|
|
|
Serial.println(F("State: MENU_VOICE, button short press")); |
|
|
|
Serial.println(F("State: MENU_VOICE, button short press")); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
if (menu_voice == MENU_VOICE_BANK) |
|
|
|
|
|
|
|
menu_voice = MENU_VOICE_SOUND; |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
menu_voice = MENU_VOICE_BANK; |
|
|
|
|
|
|
|
UI_func_voice_selection(0); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -279,11 +344,14 @@ void lcdml_menu_control(void) |
|
|
|
#ifdef DEBUG |
|
|
|
#ifdef DEBUG |
|
|
|
Serial.println(F("Volume +")); |
|
|
|
Serial.println(F("Volume +")); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
if (configuration.vol < 1.0) |
|
|
|
if (configuration.vol < 0.95) |
|
|
|
{ |
|
|
|
{ |
|
|
|
set_volume(configuration.vol + 0.05, configuration.pan); |
|
|
|
//set_volume(configuration.vol + 0.05, configuration.pan);
|
|
|
|
UI_func_volume(0); |
|
|
|
soften_volume.diff = 0.05 / SOFTEN_VALUE_CHANGE_STEPS; |
|
|
|
|
|
|
|
soften_volume.steps = SOFTEN_VALUE_CHANGE_STEPS; |
|
|
|
|
|
|
|
eeprom_write(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
UI_func_volume(0); |
|
|
|
} |
|
|
|
} |
|
|
|
ENCODER[ENC_L].write(g_LCDML_CONTROL_Encoder_position[ENC_L] + 4); |
|
|
|
ENCODER[ENC_L].write(g_LCDML_CONTROL_Encoder_position[ENC_L] + 4); |
|
|
|
} |
|
|
|
} |
|
|
@ -301,11 +369,14 @@ void lcdml_menu_control(void) |
|
|
|
#ifdef DEBUG |
|
|
|
#ifdef DEBUG |
|
|
|
Serial.println(F("Volume -")); |
|
|
|
Serial.println(F("Volume -")); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
if (configuration.vol > 0.0) |
|
|
|
if (configuration.vol > 0.05) |
|
|
|
{ |
|
|
|
{ |
|
|
|
set_volume(configuration.vol - 0.05, configuration.pan); |
|
|
|
//set_volume(configuration.vol - 0.05, configuration.pan);
|
|
|
|
UI_func_volume(0); |
|
|
|
soften_volume.diff = -0.05 / SOFTEN_VALUE_CHANGE_STEPS; |
|
|
|
|
|
|
|
soften_volume.steps = SOFTEN_VALUE_CHANGE_STEPS; |
|
|
|
|
|
|
|
eeprom_write(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
UI_func_volume(0); |
|
|
|
} |
|
|
|
} |
|
|
|
ENCODER[ENC_L].write(g_LCDML_CONTROL_Encoder_position[ENC_L] - 4); |
|
|
|
ENCODER[ENC_L].write(g_LCDML_CONTROL_Encoder_position[ENC_L] - 4); |
|
|
|
} |
|
|
|
} |
|
|
@ -619,23 +690,34 @@ void UI_func_voice_selection(uint8_t param) |
|
|
|
|
|
|
|
|
|
|
|
menu_state = MENU_VOICE; |
|
|
|
menu_state = MENU_VOICE; |
|
|
|
|
|
|
|
|
|
|
|
// update LCD content
|
|
|
|
|
|
|
|
LCDML.DISP_clear(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lcd.show(0, 0, 2, configuration.bank); |
|
|
|
|
|
|
|
lcd.show(0, 2, 1, " "); |
|
|
|
|
|
|
|
strip_extension(bank_names[configuration.bank], bank_name); |
|
|
|
strip_extension(bank_names[configuration.bank], bank_name); |
|
|
|
|
|
|
|
|
|
|
|
lcd.show(0, 2, 1, " "); |
|
|
|
//LCDML.DISP_clear();
|
|
|
|
lcd.show(0, 3, 8, bank_name); |
|
|
|
|
|
|
|
lcd.show(0, 11, 1, " "); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// display bank and voice number
|
|
|
|
|
|
|
|
lcd.show(0, 0, 2, configuration.bank); |
|
|
|
lcd.show(1, 0, 2, configuration.voice + 1); |
|
|
|
lcd.show(1, 0, 2, configuration.voice + 1); |
|
|
|
lcd.show(1, 2, 1, " "); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lcd.show(1, 2, 1, "["); |
|
|
|
// display names
|
|
|
|
lcd.show(1, 3, 10, voice_names[configuration.voice]); |
|
|
|
lcd.show(0, 4, 10, bank_name); |
|
|
|
lcd.show(1, 14, 1, "]"); |
|
|
|
lcd.show(1, 4, 10, voice_names[configuration.voice]); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// display selections
|
|
|
|
|
|
|
|
switch (menu_voice) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
case MENU_VOICE_BANK: |
|
|
|
|
|
|
|
lcd.show(0, 2, 2, " ["); |
|
|
|
|
|
|
|
lcd.show(0, 14, 2, "] "); |
|
|
|
|
|
|
|
lcd.show(1, 2, 2, " "); |
|
|
|
|
|
|
|
lcd.show(1, 14, 2, " "); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case MENU_VOICE_SOUND: |
|
|
|
|
|
|
|
lcd.show(0, 2, 2, " "); |
|
|
|
|
|
|
|
lcd.show(0, 14, 2, " "); |
|
|
|
|
|
|
|
lcd.show(1, 2, 2, " ["); |
|
|
|
|
|
|
|
lcd.show(1, 14, 2, "] "); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void UI_func_volume(uint8_t param) |
|
|
|
void UI_func_volume(uint8_t param) |
|
|
|