|
|
@ -97,7 +97,7 @@ extern char receive_bank_filename[FILENAME_LEN]; |
|
|
|
GLOBAL |
|
|
|
GLOBAL |
|
|
|
************************************************************************/ |
|
|
|
************************************************************************/ |
|
|
|
elapsedMillis back_from_volume; |
|
|
|
elapsedMillis back_from_volume; |
|
|
|
uint8_t instance_num[2][8]; |
|
|
|
uint8_t instance_num[8][8]; |
|
|
|
|
|
|
|
|
|
|
|
#ifdef I2C_DISPLAY |
|
|
|
#ifdef I2C_DISPLAY |
|
|
|
#include <LiquidCrystal_I2C.h> |
|
|
|
#include <LiquidCrystal_I2C.h> |
|
|
@ -158,9 +158,15 @@ const uint8_t meter_bar[5][8] = { |
|
|
|
{B00000, B00001, B00001, B00001, B00001, B00001, B00001, B00000} |
|
|
|
{B00000, B00001, B00001, B00001, B00001, B00001, B00001, B00000} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const uint8_t inverse_num[6][8] = { |
|
|
|
const uint8_t inverse_num[8][8] = { |
|
|
|
{B11111, B11011, B10011, B11011, B11011, B11011, B11011, B11111}, // 1 invers
|
|
|
|
{B11111, B11011, B10011, B11011, B11011, B11011, B11011, B11111}, // 1 small invers
|
|
|
|
{B11111, B11011, B10101, B11101, B11011, B10111, B10001, B11111} // 2 invers
|
|
|
|
{B11111, B11011, B10101, B11101, B11011, B10111, B10001, B11111}, // 2 small invers
|
|
|
|
|
|
|
|
{B11111, B11011, B10011, B11011, B11011, B11011, B11011, B11111}, // 1 OP invers
|
|
|
|
|
|
|
|
{B11111, B11011, B10101, B11101, B11011, B10111, B10001, B11111}, // 2 OP invers
|
|
|
|
|
|
|
|
{B11111, B10001, B11101, B11011, B11101, B10101, B11011, B11111}, // 3 OP invers
|
|
|
|
|
|
|
|
{B11111, B10111, B10111, B10101, B10001, B11101, B11101, B11111}, // 4 OP invers
|
|
|
|
|
|
|
|
{B11111, B10001, B10111, B10011, B11101, B11101, B10011, B11111}, // 5 OP invers
|
|
|
|
|
|
|
|
{B11111, B11011, B10101, B10011, B10101, B10101, B11011, B11111} // 6 OP invers
|
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
enum { SCROLLBAR, BLOCKBAR, METERBAR }; |
|
|
|
enum { SCROLLBAR, BLOCKBAR, METERBAR }; |
|
|
@ -215,13 +221,7 @@ void UI_func_at_mode(uint8_t param); |
|
|
|
void UI_func_portamento_mode(uint8_t param); |
|
|
|
void UI_func_portamento_mode(uint8_t param); |
|
|
|
void UI_func_portamento_glissando(uint8_t param); |
|
|
|
void UI_func_portamento_glissando(uint8_t param); |
|
|
|
void UI_func_portamento_time(uint8_t param); |
|
|
|
void UI_func_portamento_time(uint8_t param); |
|
|
|
void UI_func_OP1(uint8_t param); |
|
|
|
void UI_handle_OP(uint8_t param); |
|
|
|
void UI_func_OP2(uint8_t param); |
|
|
|
|
|
|
|
void UI_func_OP3(uint8_t param); |
|
|
|
|
|
|
|
void UI_func_OP4(uint8_t param); |
|
|
|
|
|
|
|
void UI_func_OP5(uint8_t param); |
|
|
|
|
|
|
|
void UI_func_OP6(uint8_t param); |
|
|
|
|
|
|
|
void UI_handle_OP(uint8_t param, uint8_t op, uint8_t instance_id); |
|
|
|
|
|
|
|
void UI_func_information(uint8_t param); |
|
|
|
void UI_func_information(uint8_t param); |
|
|
|
void UI_func_volume(uint8_t param); |
|
|
|
void UI_func_volume(uint8_t param); |
|
|
|
void UI_func_load_performance(uint8_t param); |
|
|
|
void UI_func_load_performance(uint8_t param); |
|
|
@ -249,6 +249,7 @@ void lcd_display_bar_float(const char* title, float value, float factor, int32_t |
|
|
|
void lcd_display_meter_int(const char* title, uint32_t value, float factor, float offset, int32_t min_value, int32_t max_value, uint8_t size, bool zeros, bool brackets, bool sign, bool init); |
|
|
|
void lcd_display_meter_int(const char* title, uint32_t value, float factor, float offset, int32_t min_value, int32_t max_value, uint8_t size, bool zeros, bool brackets, bool sign, bool init); |
|
|
|
void lcd_display_meter_float(const char* title, float value, float factor, float offset, int32_t min_value, int32_t max_value, uint8_t size_number, uint8_t size_fraction, bool zeros, bool brackets, bool sign, bool init); |
|
|
|
void lcd_display_meter_float(const char* title, float value, float factor, float offset, int32_t min_value, int32_t max_value, uint8_t size_number, uint8_t size_fraction, bool zeros, bool brackets, bool sign, bool init); |
|
|
|
void lcd_active_instance_number(uint8_t instance_id); |
|
|
|
void lcd_active_instance_number(uint8_t instance_id); |
|
|
|
|
|
|
|
void lcd_OP_active_instance_number(uint8_t instance_id, uint8_t op); |
|
|
|
void lcd_special_chars(uint8_t mode); |
|
|
|
void lcd_special_chars(uint8_t mode); |
|
|
|
void eeprom_update_var(uint16_t pos, uint8_t val, const char* val_string); |
|
|
|
void eeprom_update_var(uint16_t pos, uint8_t val, const char* val_string); |
|
|
|
|
|
|
|
|
|
|
@ -3405,96 +3406,82 @@ void UI_func_portamento_time(uint8_t param) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void UI_func_OP1(uint8_t param) |
|
|
|
void UI_handle_OP(uint8_t param) |
|
|
|
{ |
|
|
|
{ |
|
|
|
uint8_t selected_instance_id = 0; |
|
|
|
static uint8_t op_selected; |
|
|
|
|
|
|
|
|
|
|
|
UI_handle_OP(param, 0, selected_instance_id); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UI_func_OP2(uint8_t param) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
uint8_t selected_instance_id = 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UI_handle_OP(param, 1, selected_instance_id); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UI_func_OP3(uint8_t param) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
uint8_t selected_instance_id = 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UI_handle_OP(param, 2, selected_instance_id); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UI_func_OP4(uint8_t param) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
uint8_t selected_instance_id = 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UI_handle_OP(param, 3, selected_instance_id); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UI_func_OP5(uint8_t param) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
uint8_t selected_instance_id = 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UI_handle_OP(param, 4, selected_instance_id); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UI_func_OP6(uint8_t param) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
uint8_t selected_instance_id = 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UI_handle_OP(param, 5, selected_instance_id); |
|
|
|
lcd_OP_active_instance_number(selected_instance_id, configuration.dexed[selected_instance_id].op_enabled); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UI_handle_OP(uint8_t param, uint8_t op, uint8_t selected_instance_id) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
bool state = bitRead(configuration.dexed[selected_instance_id].op_enabled, op); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (LCDML.FUNC_setup()) // ****** SETUP *********
|
|
|
|
if (LCDML.FUNC_setup()) // ****** SETUP *********
|
|
|
|
{ |
|
|
|
{ |
|
|
|
encoderDir[ENC_R].reset(); |
|
|
|
encoderDir[ENC_R].reset(); |
|
|
|
|
|
|
|
|
|
|
|
lcd.setCursor(0, 0); |
|
|
|
lcd.setCursor(0, 0); |
|
|
|
lcd.print(F("Operator ")); |
|
|
|
lcd.print(F("Operator Enable")); |
|
|
|
lcd.print(op + 1); |
|
|
|
|
|
|
|
lcd.setCursor(0, 1); |
|
|
|
lcd.setCursor(0, 1); |
|
|
|
if (state == true) |
|
|
|
for (uint8_t i = 2; i < 8; i++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
lcd.print(F("[ENABLED ]")); |
|
|
|
lcd.print(F(" ")); |
|
|
|
} |
|
|
|
lcd.write(i); |
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
lcd.print(F("[DISABLED]")); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
lcd.setCursor(op_selected * 2, 1); |
|
|
|
|
|
|
|
lcd.print(F("[")); |
|
|
|
|
|
|
|
lcd.setCursor(op_selected * 2 + 2, 1); |
|
|
|
|
|
|
|
lcd.print(F("]")); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if NUM_DEXED > 1 |
|
|
|
|
|
|
|
lcd.setCursor(15, 0); |
|
|
|
|
|
|
|
lcd.write(0); |
|
|
|
|
|
|
|
lcd.setCursor(15, 1); |
|
|
|
|
|
|
|
lcd.write(1); |
|
|
|
|
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (LCDML.FUNC_loop()) // ****** LOOP *********
|
|
|
|
if (LCDML.FUNC_loop()) // ****** LOOP *********
|
|
|
|
{ |
|
|
|
{ |
|
|
|
if (LCDML.BT_checkUp() && state == true) |
|
|
|
uint8_t op_selected_old = op_selected; |
|
|
|
{ |
|
|
|
|
|
|
|
bitClear(configuration.dexed[selected_instance_id].op_enabled, op); |
|
|
|
|
|
|
|
state = false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else if (LCDML.BT_checkDown() && state == false) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
bitSet(configuration.dexed[selected_instance_id].op_enabled, op); |
|
|
|
|
|
|
|
state = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) |
|
|
|
if (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
lcd.setCursor(0, 1); |
|
|
|
if (op_selected == 0) |
|
|
|
if (state == true) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
lcd.print(F("[ENABLED ]")); |
|
|
|
selected_instance_id = !selected_instance_id; |
|
|
|
|
|
|
|
op_selected = 5; |
|
|
|
|
|
|
|
lcd_OP_active_instance_number(selected_instance_id, configuration.dexed[selected_instance_id].op_enabled); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
|
|
|
|
op_selected = constrain(op_selected - 1, 0, 5); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else if (LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (op_selected == 5) |
|
|
|
{ |
|
|
|
{ |
|
|
|
lcd.print(F("[DISABLED]")); |
|
|
|
selected_instance_id = !selected_instance_id; |
|
|
|
|
|
|
|
op_selected = 0; |
|
|
|
|
|
|
|
lcd_OP_active_instance_number(selected_instance_id, configuration.dexed[selected_instance_id].op_enabled); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
op_selected = constrain(op_selected + 1, 0, 5); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else if (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort()) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (bitRead(configuration.dexed[selected_instance_id].op_enabled, op_selected)) |
|
|
|
|
|
|
|
bitClear(configuration.dexed[selected_instance_id].op_enabled, op_selected); |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
bitSet(configuration.dexed[selected_instance_id].op_enabled, op_selected); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lcd_OP_active_instance_number(selected_instance_id, configuration.dexed[selected_instance_id].op_enabled); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lcd.setCursor(op_selected_old * 2, 1); |
|
|
|
|
|
|
|
lcd.print(F(" ")); |
|
|
|
|
|
|
|
lcd.setCursor(op_selected_old * 2 + 2, 1); |
|
|
|
|
|
|
|
lcd.print(F(" ")); |
|
|
|
|
|
|
|
lcd.setCursor(op_selected * 2, 1); |
|
|
|
|
|
|
|
lcd.print(F("[")); |
|
|
|
|
|
|
|
lcd.setCursor(op_selected * 2 + 2, 1); |
|
|
|
|
|
|
|
lcd.print(F("]")); |
|
|
|
|
|
|
|
|
|
|
|
MicroDexed[selected_instance_id]->setOPs(configuration.dexed[selected_instance_id].op_enabled); |
|
|
|
MicroDexed[selected_instance_id]->setOPs(configuration.dexed[selected_instance_id].op_enabled); |
|
|
|
MicroDexed[selected_instance_id]->doRefreshVoice(); |
|
|
|
MicroDexed[selected_instance_id]->doRefreshVoice(); |
|
|
|
} |
|
|
|
} |
|
|
@ -3502,11 +3489,9 @@ void UI_handle_OP(uint8_t param, uint8_t op, uint8_t selected_instance_id) |
|
|
|
if (LCDML.FUNC_close()) // ****** STABLE END *********
|
|
|
|
if (LCDML.FUNC_close()) // ****** STABLE END *********
|
|
|
|
{ |
|
|
|
{ |
|
|
|
encoderDir[ENC_R].reset(); |
|
|
|
encoderDir[ENC_R].reset(); |
|
|
|
if (selected_instance_id == 0) |
|
|
|
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[0].op_enabled), configuration.dexed[0].op_enabled); |
|
|
|
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[0].op_enabled), configuration.dexed[0].op_enabled); |
|
|
|
|
|
|
|
#if NUM_DEXED > 1 |
|
|
|
#if NUM_DEXED > 1 |
|
|
|
else |
|
|
|
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[1].op_enabled), configuration.dexed[1].op_enabled); |
|
|
|
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[1].op_enabled), configuration.dexed[1].op_enabled); |
|
|
|
|
|
|
|
#endif |
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -5196,8 +5181,62 @@ void lcd_active_instance_number(uint8_t instance_id) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
lcd.createChar(5, (uint8_t*)instance_num[0]); |
|
|
|
lcd.createChar(5, instance_num[0]); |
|
|
|
lcd.createChar(6, (uint8_t*)instance_num[1]); |
|
|
|
lcd.createChar(6, instance_num[1]); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void lcd_OP_active_instance_number(uint8_t instance_id, uint8_t op) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
uint8_t i, n; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (n = 2; n < 8; n++) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
for (i = 0; i < 8; i++) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (bitRead(op, n - 2)) |
|
|
|
|
|
|
|
instance_num[n][i] = inverse_num[n][i]; |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
instance_num[n][i] = ~inverse_num[n][i]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
lcd.createChar(n, instance_num[n]); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < 8; i++) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (instance_id == 0) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (configuration.dexed[instance_id].polyphony == 0) |
|
|
|
|
|
|
|
instance_num[0][i] = bit_reverse8(inverse_num[0][i]); |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
instance_num[0][i] = inverse_num[0][i]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (configuration.dexed[!instance_id].polyphony == 0) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
instance_num[1][i] = bit_reverse8(inverse_num[1][i]); |
|
|
|
|
|
|
|
instance_num[1][i] = ~instance_num[1][i]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
instance_num[1][i] = ~inverse_num[1][i]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (configuration.dexed[!instance_id].polyphony == 0) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
instance_num[0][i] = bit_reverse8(inverse_num[0][i]); |
|
|
|
|
|
|
|
instance_num[0][i] = ~instance_num[0][i]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
instance_num[0][i] = ~inverse_num[0][i]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (configuration.dexed[instance_id].polyphony == 0) |
|
|
|
|
|
|
|
instance_num[1][i] = bit_reverse8(inverse_num[1][i]); |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
instance_num[1][i] = inverse_num[1][i]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lcd.createChar(0, instance_num[0]); |
|
|
|
|
|
|
|
lcd.createChar(1, instance_num[1]); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void lcd_special_chars(uint8_t mode) |
|
|
|
void lcd_special_chars(uint8_t mode) |
|
|
|