From 2e6d8ace0dcca0bc08a24e88e15916186a18d194 Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Thu, 26 Mar 2020 14:22:06 +0100 Subject: [PATCH] Added block-bar for more menus. Optimized menu handling. --- UI.hpp | 648 ++++++++++++++++++++++++++++--------------------------- config.h | 2 +- 2 files changed, 334 insertions(+), 316 deletions(-) diff --git a/UI.hpp b/UI.hpp index 8b6fb74..f365d2c 100644 --- a/UI.hpp +++ b/UI.hpp @@ -210,7 +210,7 @@ void UI_function_not_enabled(void); void UI_function_not_implemented(uint8_t param); void lcd_display_int(int16_t var, uint8_t size, bool zeros, bool brackets, bool sign); void lcd_display_float(float var, uint8_t size_number, uint8_t size_fraction, bool zeros, bool brackets, bool sign); -void lcd_display_bar_int(const char* title, uint32_t value, uint32_t min_value, uint32_t max_value, uint8_t size, bool zeros, bool brackets, bool sign, bool init); +void lcd_display_bar_int(const char* title, uint32_t value, float factor, uint32_t min_value, uint32_t max_value, uint8_t size, bool zeros, bool brackets, bool sign, bool init); void lcd_special_chars(uint8_t mode); // normal menu @@ -817,8 +817,8 @@ void UI_func_reverb_roomsize(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { // setup function - lcd.setCursor(0, 0); - lcd.print(F("Reverb Roomsize")); + lcd_special_chars(BLOCKBAR); + lcd_display_bar_int("Reverb Room", configuration.reverb_roomsize, 1.0, REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX, 3, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -834,16 +834,16 @@ void UI_func_reverb_roomsize(uint8_t param) else if (LCDML.BT_checkUp()) configuration.reverb_roomsize = constrain(configuration.reverb_roomsize - ENCODER[ENC_R].speed(), REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX); + lcd_display_bar_int("Reverb Room", configuration.reverb_roomsize, 1.0, REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX, 3, false, false, false, false); + freeverb_r.roomsize(mapfloat(configuration.reverb_roomsize, REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX, 0.0, 1.0)); freeverb_l.roomsize(mapfloat(configuration.reverb_roomsize, REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX, 0.0, 1.0)); } - - lcd.setCursor(0, 1); - lcd_display_int(configuration.reverb_roomsize, 3, true, true, false); } if (LCDML.FUNC_close()) // ****** STABLE END ********* { + lcd_special_chars(SCROLLBAR); eeprom_write(); } } @@ -853,8 +853,8 @@ void UI_func_reverb_damping(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { // setup function - lcd.setCursor(0, 0); - lcd.print(F("Reverb Damping")); + lcd_special_chars(BLOCKBAR); + lcd_display_bar_int("Reverb Damp.", configuration.reverb_damping, 1.0, REVERB_DAMPING_MIN, REVERB_DAMPING_MAX, 3, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -870,16 +870,16 @@ void UI_func_reverb_damping(uint8_t param) else if (LCDML.BT_checkUp()) configuration.reverb_damping = constrain(configuration.reverb_damping - ENCODER[ENC_R].speed(), REVERB_DAMPING_MIN, REVERB_DAMPING_MAX); + lcd_display_bar_int("Reverb Damp.", configuration.reverb_damping, 1.0, REVERB_DAMPING_MIN, REVERB_DAMPING_MAX, 3, false, false, false, false); + freeverb_r.damping(mapfloat(configuration.reverb_damping, REVERB_DAMPING_MIN, REVERB_DAMPING_MAX, 0.0, 1.0)); freeverb_l.damping(mapfloat(configuration.reverb_damping, REVERB_DAMPING_MIN, REVERB_DAMPING_MAX, 0.0, 1.0)); } - - lcd.setCursor(0, 1); - lcd_display_int(configuration.reverb_damping, 3, true, true, false); } if (LCDML.FUNC_close()) // ****** STABLE END ********* { + lcd_special_chars(SCROLLBAR); eeprom_write(); } } @@ -894,8 +894,8 @@ void UI_func_reverb_send(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { // setup function - lcd.setCursor(0, 0); - lcd.print(F("Reverb Send")); + lcd_special_chars(BLOCKBAR); + lcd_display_bar_int("Reverb Send", configuration.dexed[instance_id].reverb_send, 1.0, REVERB_SEND_MIN, REVERB_SEND_MAX, 3, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -911,16 +911,16 @@ void UI_func_reverb_send(uint8_t param) else if (LCDML.BT_checkUp()) configuration.dexed[instance_id].reverb_send = constrain(configuration.dexed[instance_id].reverb_send - ENCODER[ENC_R].speed(), REVERB_SEND_MIN, REVERB_SEND_MAX); + lcd_display_bar_int("Reverb Send", configuration.dexed[instance_id].reverb_send, 1.0, REVERB_SEND_MIN, REVERB_SEND_MAX, 3, false, false, false, false); + reverb_send_mixer_r.gain(instance_id, configuration.dexed[instance_id].reverb_send / 100.0); reverb_send_mixer_l.gain(instance_id, configuration.dexed[instance_id].reverb_send / 100.0); } - - lcd.setCursor(0, 1); - lcd_display_int(configuration.dexed[instance_id].reverb_send, 3, true, true, false); } if (LCDML.FUNC_close()) // ****** STABLE END ********* { + lcd_special_chars(SCROLLBAR); eeprom_write(); } } @@ -930,8 +930,8 @@ void UI_func_reverb_level(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { // setup function - lcd.setCursor(0, 0); - lcd.print(F("Reverb Level")); + lcd_special_chars(BLOCKBAR); + lcd_display_bar_int("Reverb Level", configuration.reverb_level, 1.0, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 3, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -947,16 +947,16 @@ void UI_func_reverb_level(uint8_t param) else if (LCDML.BT_checkUp()) configuration.reverb_level = constrain(configuration.reverb_level - ENCODER[ENC_R].speed(), REVERB_LEVEL_MIN, REVERB_LEVEL_MAX); + lcd_display_bar_int("Reverb Level", configuration.reverb_level, 1.0, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 3, false, false, false, true); + master_mixer_r.gain(REVERB, mapfloat(configuration.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, 1.0)); master_mixer_l.gain(REVERB, mapfloat(configuration.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, 1.0)); } - - lcd.setCursor(0, 1); - lcd_display_int(configuration.reverb_level, 3, true, true, false); } if (LCDML.FUNC_close()) // ****** STABLE END ********* { + lcd_special_chars(SCROLLBAR); eeprom_write(); } } @@ -966,6 +966,8 @@ void UI_func_chorus_frequency(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { // setup function + //lcd_special_chars(BLOCKBAR); + //lcd_display_bar_float("Chorus Frq.", configuration.chorus_frequency, CHORUS_FREQUENCY_MIN, CHORUS_FREQUENCY_MAX, 3, false, false, false, true); lcd.setCursor(0, 0); lcd.print(F("Chorus Frequency")); } @@ -984,15 +986,17 @@ void UI_func_chorus_frequency(uint8_t param) configuration.chorus_frequency = constrain(configuration.chorus_frequency - ENCODER[ENC_R].speed(), CHORUS_FREQUENCY_MIN, CHORUS_FREQUENCY_MAX); chorus_modulator.frequency(configuration.chorus_frequency / 10.0); - } - lcd.setCursor(0, 1); - lcd_display_float(configuration.chorus_frequency / 10.0, 2, 1, false, true, false); - lcd.print(F(" Hz")); + //lcd_display_bar_float("Chorus Frq.", configuration.chorus_frequency, CHORUS_FREQUENCY_MIN, CHORUS_FREQUENCY_MAX, 3, false, false, false, true); + lcd.setCursor(0, 1); + lcd_display_float(configuration.chorus_frequency / 10.0, 2, 1, false, true, false); + lcd.print(F(" Hz")); + } } if (LCDML.FUNC_close()) // ****** STABLE END ********* { + //lcd_special_chars(SCROLLBAR); eeprom_write(); } } @@ -1045,8 +1049,8 @@ void UI_func_chorus_depth(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { // setup function - lcd.setCursor(0, 0); - lcd.print(F("Chorus Depth")); + lcd_special_chars(BLOCKBAR); + lcd_display_bar_int("Chorus Dpt.", configuration.chorus_depth, 1.0, CHORUS_DEPTH_MIN, CHORUS_DEPTH_MAX, 3, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -1062,16 +1066,15 @@ void UI_func_chorus_depth(uint8_t param) else if (LCDML.BT_checkUp()) configuration.chorus_depth = constrain(configuration.chorus_depth - ENCODER[ENC_R].speed(), CHORUS_DEPTH_MIN, CHORUS_DEPTH_MAX); + lcd_display_bar_int("Chorus Dpt.", configuration.chorus_depth, 1.0, CHORUS_DEPTH_MIN, CHORUS_DEPTH_MAX, 3, false, false, false, false); + chorus_modulator.amplitude(configuration.chorus_depth / 100.0); } - - lcd.setCursor(0, 1); - lcd_display_int(configuration.chorus_depth, 3, true, true, false); } if (LCDML.FUNC_close()) // ****** STABLE END ********* { - // you can here reset some global vars or do nothing + lcd_special_chars(SCROLLBAR); eeprom_write(); } } @@ -1086,8 +1089,8 @@ void UI_func_chorus_send(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { // setup function - lcd.setCursor(0, 0); - lcd.print(F("Chorus Send")); + lcd_special_chars(BLOCKBAR); + lcd_display_bar_int("Chorus Send", configuration.dexed[instance_id].chorus_send, 1.0, CHORUS_SEND_MIN, CHORUS_SEND_MAX, 3, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -1103,17 +1106,16 @@ void UI_func_chorus_send(uint8_t param) else if (LCDML.BT_checkUp()) configuration.dexed[instance_id].chorus_send = constrain(configuration.dexed[instance_id].chorus_send - ENCODER[ENC_R].speed(), CHORUS_SEND_MIN, CHORUS_SEND_MAX); + lcd_display_bar_int("Chorus Send", configuration.dexed[instance_id].chorus_send, 1.0, CHORUS_SEND_MIN, CHORUS_SEND_MAX, 3, false, false, false, false); + chorus_send_mixer_r.gain(instance_id, configuration.dexed[instance_id].chorus_send / 100.0); chorus_send_mixer_l.gain(instance_id, configuration.dexed[instance_id].chorus_send / 100.0); } - - lcd.setCursor(0, 1); - lcd_display_int(configuration.dexed[instance_id].chorus_send, 3, true, true, false); } if (LCDML.FUNC_close()) // ****** STABLE END ********* { - // you can here reset some global vars or do nothing + lcd_special_chars(SCROLLBAR); eeprom_write(); } } @@ -1123,8 +1125,8 @@ void UI_func_chorus_level(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { // setup function - lcd.setCursor(0, 0); - lcd.print(F("Chorus Level")); + lcd_special_chars(BLOCKBAR); + lcd_display_bar_int("Chorus Lvl.", configuration.chorus_level, 1.0, CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 3, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -1140,27 +1142,28 @@ void UI_func_chorus_level(uint8_t param) else if (LCDML.BT_checkUp()) configuration.chorus_level = constrain(configuration.chorus_level - ENCODER[ENC_R].speed(), CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX); + lcd_display_bar_int("Chorus Lvl.", configuration.chorus_level, 1.0, CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 3, false, false, false, false); + master_mixer_r.gain(CHORUS, mapfloat(configuration.chorus_level, CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 0.0, 1.0)); master_mixer_l.gain(CHORUS, mapfloat(configuration.chorus_level, CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 0.0, 1.0)); } - - lcd.setCursor(0, 1); - lcd_display_int(configuration.chorus_level, 3, true, true, false); } if (LCDML.FUNC_close()) // ****** STABLE END ********* { + lcd_special_chars(SCROLLBAR); eeprom_write(); } } +/* HIER */ void UI_func_delay_time(uint8_t param) { if (LCDML.FUNC_setup()) // ****** SETUP ********* { // setup function - lcd.setCursor(0, 0); - lcd.print(F("Delay Time")); + lcd_special_chars(BLOCKBAR); + lcd_display_bar_int("Delay Time", configuration.delay_time, 10.0, DELAY_TIME_MIN, DELAY_TIME_MAX, 3, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -1176,18 +1179,16 @@ void UI_func_delay_time(uint8_t param) else if (LCDML.BT_checkUp()) configuration.delay_time = constrain(configuration.delay_time - ENCODER[ENC_R].speed(), DELAY_TIME_MIN, DELAY_TIME_MAX); + lcd_display_bar_int("Delay Time", configuration.delay_time, 10.0, DELAY_TIME_MIN, DELAY_TIME_MAX, 3, false, false, false, true); + delay_r.delay(0, configuration.delay_time * 10); delay_l.delay(0, configuration.delay_time * 10); } - - lcd.setCursor(0, 1); - lcd_display_int(configuration.delay_time * 10, 3, true, true, false); - lcd.print(F(" ms")); } if (LCDML.FUNC_close()) // ****** STABLE END ********* { - // you can here reset some global vars or do nothing + lcd_special_chars(SCROLLBAR); eeprom_write(); } } @@ -1197,8 +1198,8 @@ void UI_func_delay_feedback(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { // setup function - lcd.setCursor(0, 0); - lcd.print(F("Delay Feedback")); + lcd_special_chars(BLOCKBAR); + lcd_display_bar_int("Delay Feedb.", configuration.delay_feedback, 1.0, DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 3, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -1214,18 +1215,17 @@ void UI_func_delay_feedback(uint8_t param) else if (LCDML.BT_checkUp()) configuration.delay_feedback = constrain(configuration.delay_feedback - ENCODER[ENC_R].speed(), DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX); + lcd_display_bar_int("Delay Feedb.", configuration.delay_feedback, 1.0, DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 3, false, false, false, false); + delay_fb_mixer_r.gain(1, configuration.delay_feedback / 100.0); // amount of feedback delay_fb_mixer_l.gain(1, configuration.delay_feedback / 100.0); // amount of feedback //delay_fb_mixer.gain(0, 1.0 - configuration.delay_feedback / 200.0); // original signal } - - lcd.setCursor(0, 1); - lcd_display_int(configuration.delay_feedback, 3, true, true, false); } if (LCDML.FUNC_close()) // ****** STABLE END ********* { - // you can here reset some global vars or do nothing + lcd_special_chars(SCROLLBAR); eeprom_write(); } } @@ -1240,8 +1240,8 @@ void UI_func_delay_send(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { // setup function - lcd.setCursor(0, 0); - lcd.print(F("Delay Send")); + lcd_special_chars(BLOCKBAR); + lcd_display_bar_int("Delay Send", configuration.dexed[instance_id].delay_send, 1.0, DELAY_SEND_MIN, DELAY_SEND_MAX, 3, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -1257,17 +1257,16 @@ void UI_func_delay_send(uint8_t param) else if (LCDML.BT_checkUp()) configuration.dexed[instance_id].delay_send = constrain(configuration.dexed[instance_id].delay_send - ENCODER[ENC_R].speed(), DELAY_SEND_MIN, DELAY_SEND_MAX); + lcd_display_bar_int("Delay Send", configuration.dexed[instance_id].delay_send, 1.0, DELAY_SEND_MIN, DELAY_SEND_MAX, 3, false, false, false, false); + delay_send_mixer_r.gain(instance_id, configuration.dexed[instance_id].delay_send / 100.0); delay_send_mixer_l.gain(instance_id, configuration.dexed[instance_id].delay_send / 100.0); } } - lcd.setCursor(0, 1); - lcd_display_int(configuration.dexed[instance_id].delay_send, 3, true, true, false); - if (LCDML.FUNC_close()) // ****** STABLE END ********* { - // you can here reset some global vars or do nothing + lcd_special_chars(SCROLLBAR); eeprom_write(); } } @@ -1277,8 +1276,8 @@ void UI_func_delay_level(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { // setup function - lcd.setCursor(0, 0); - lcd.print(F("Delay Level")); + lcd_special_chars(BLOCKBAR); + lcd_display_bar_int("Delay Lvl.", configuration.delay_level, 1.0, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 3, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -1294,6 +1293,8 @@ void UI_func_delay_level(uint8_t param) else if (LCDML.BT_checkUp()) configuration.delay_level = constrain(configuration.delay_level - ENCODER[ENC_R].speed(), DELAY_LEVEL_MIN, DELAY_LEVEL_MAX); + lcd_display_bar_int("Delay Lvl.", configuration.delay_level, 1.0, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 3, false, false, false, false); + master_mixer_r.gain(DELAY, mapfloat(configuration.delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0)); master_mixer_l.gain(DELAY, mapfloat(configuration.delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0)); } @@ -1304,6 +1305,7 @@ void UI_func_delay_level(uint8_t param) if (LCDML.FUNC_close()) // ****** STABLE END ********* { + lcd_special_chars(SCROLLBAR); eeprom_write(); } } @@ -1318,8 +1320,8 @@ void UI_func_filter_cutoff(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { // setup function - lcd.setCursor(0, 0); - lcd.print(F("Filter Cut-Off")); + lcd_special_chars(BLOCKBAR); + lcd_display_bar_int("Filter Cut", configuration.dexed[instance_id].filter_cutoff, 1.0, FILTER_CUTOFF_MIN, FILTER_CUTOFF_MAX, 3, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -1335,6 +1337,8 @@ void UI_func_filter_cutoff(uint8_t param) else if (LCDML.BT_checkUp()) configuration.dexed[instance_id].filter_cutoff = constrain(configuration.dexed[instance_id].filter_cutoff - ENCODER[ENC_R].speed(), FILTER_CUTOFF_MIN, FILTER_CUTOFF_MAX); + lcd_display_bar_int("Filter Cut", configuration.dexed[instance_id].filter_cutoff, 1.0, FILTER_CUTOFF_MIN, FILTER_CUTOFF_MAX, 3, false, false, false, false); + MicroDexed[instance_id]->fx.Cutoff = mapfloat(configuration.dexed[instance_id].filter_cutoff, FILTER_CUTOFF_MIN, FILTER_CUTOFF_MAX, 1.0, 0.0); } @@ -1344,7 +1348,7 @@ void UI_func_filter_cutoff(uint8_t param) if (LCDML.FUNC_close()) // ****** STABLE END ********* { - // you can here reset some global vars or do nothing + lcd_special_chars(SCROLLBAR); eeprom_write(); } } @@ -1359,8 +1363,8 @@ void UI_func_filter_resonance(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { // setup function - lcd.setCursor(0, 0); - lcd.print(F("Filter Resonance")); + lcd_special_chars(BLOCKBAR); + lcd_display_bar_int("Filter Res", configuration.dexed[instance_id].filter_resonance, 1.0, FILTER_RESONANCE_MIN, FILTER_RESONANCE_MAX, 3, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -1376,6 +1380,8 @@ void UI_func_filter_resonance(uint8_t param) else if (LCDML.BT_checkUp()) configuration.dexed[instance_id].filter_resonance = constrain(configuration.dexed[instance_id].filter_resonance - ENCODER[ENC_R].speed(), FILTER_RESONANCE_MIN, FILTER_RESONANCE_MAX); + lcd_display_bar_int("Filter Res", configuration.dexed[instance_id].filter_resonance, 1.0, FILTER_RESONANCE_MIN, FILTER_RESONANCE_MAX, 3, false, false, false, false); + MicroDexed[instance_id]->fx.Reso = mapfloat(configuration.dexed[instance_id].filter_resonance, FILTER_RESONANCE_MIN, FILTER_RESONANCE_MAX, 1.0, 0.0); } @@ -1385,7 +1391,7 @@ void UI_func_filter_resonance(uint8_t param) if (LCDML.FUNC_close()) // ****** STABLE END ********* { - // you can here reset some global vars or do nothing + lcd_special_chars(SCROLLBAR); eeprom_write(); } } @@ -1532,7 +1538,7 @@ void UI_func_sound_intensity(uint8_t param) { // setup function lcd_special_chars(BLOCKBAR); - lcd_display_bar_int("Sound Intens.", configuration.dexed[instance_id].sound_intensity, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 3, false, false, false, true); + lcd_display_bar_int("Sound Intens.", configuration.dexed[instance_id].sound_intensity, 1.0, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 3, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -1548,10 +1554,11 @@ void UI_func_sound_intensity(uint8_t param) else if (LCDML.BT_checkUp()) configuration.dexed[instance_id].sound_intensity = constrain(configuration.dexed[instance_id].sound_intensity - ENCODER[ENC_R].speed(), SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX); + lcd_display_bar_int("Sound Intens.", configuration.dexed[instance_id].sound_intensity, 1.0, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 3, false, false, false, false); + dexed_level[instance_id]->gain(mapfloat(configuration.dexed[instance_id].sound_intensity, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 0.0, SOUND_INTENSITY_AMP_MAX)); } - lcd_display_bar_int("Sound Intens.", configuration.dexed[instance_id].sound_intensity, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 3, false, false, false, false); } if (LCDML.FUNC_close()) // ****** STABLE END ********* @@ -1666,8 +1673,8 @@ void UI_func_polyphony(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { // setup function - lcd.setCursor(0, 0); - lcd.print(F("Polyphony")); + lcd_special_chars(BLOCKBAR); + lcd_display_bar_int("Polyphony", configuration.dexed[instance_id].polyphony, 1.0, POLYPHONY_MIN, POLYPHONY_MAX, 3, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -1683,16 +1690,15 @@ void UI_func_polyphony(uint8_t param) else if (LCDML.BT_checkUp()) configuration.dexed[instance_id].polyphony = constrain(configuration.dexed[instance_id].polyphony - ENCODER[ENC_R].speed(), POLYPHONY_MIN, POLYPHONY_MAX); + lcd_display_bar_int("Polyphony", configuration.dexed[instance_id].polyphony, 1.0, POLYPHONY_MIN, POLYPHONY_MAX, 3, false, false, false, false); + MicroDexed[instance_id]->setMaxNotes(configuration.dexed[instance_id].polyphony); } - - lcd.setCursor(0, 1); - lcd_display_int(configuration.dexed[instance_id].polyphony, 2, false, true, false); } if (LCDML.FUNC_close()) // ****** STABLE END ********* { - // you can here reset some global vars or do nothing + lcd_special_chars(SCROLLBAR); eeprom_write(); } } @@ -1858,7 +1864,7 @@ void UI_func_pb_range(uint8_t param) { // setup function lcd_special_chars(BLOCKBAR); - lcd_display_bar_int("PB Range", configuration.dexed[instance_id].pb_range, PB_RANGE_MIN, PB_RANGE_MAX, 2, false, false, false, true); + lcd_display_bar_int("PB Range", configuration.dexed[instance_id].pb_range, 1.0, PB_RANGE_MIN, PB_RANGE_MAX, 2, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -1874,10 +1880,10 @@ void UI_func_pb_range(uint8_t param) else if (LCDML.BT_checkUp()) configuration.dexed[instance_id].pb_range = constrain(configuration.dexed[instance_id].pb_range - ENCODER[ENC_R].speed(), PB_RANGE_MIN, PB_RANGE_MAX); + lcd_display_bar_int("PB Range", configuration.dexed[instance_id].pb_range, 1.0, PB_RANGE_MIN, PB_RANGE_MAX, 2, false, false, false, false); + MicroDexed[instance_id]->setPBController(configuration.dexed[instance_id].pb_range, configuration.dexed[instance_id].pb_step); } - - lcd_display_bar_int("PB Range", configuration.dexed[instance_id].pb_range, PB_RANGE_MIN, PB_RANGE_MAX, 2, false, false, false, false); } if (LCDML.FUNC_close()) // ****** STABLE END ********* @@ -1898,7 +1904,7 @@ void UI_func_pb_step(uint8_t param) { // setup function lcd_special_chars(BLOCKBAR); - lcd_display_bar_int("PB Step", configuration.dexed[instance_id].pb_step, PB_STEP_MIN, PB_STEP_MAX, 2, false, false, false, true); + lcd_display_bar_int("PB Step", configuration.dexed[instance_id].pb_step, 1.0, PB_STEP_MIN, PB_STEP_MAX, 2, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -1914,10 +1920,10 @@ void UI_func_pb_step(uint8_t param) else if (LCDML.BT_checkUp()) configuration.dexed[instance_id].pb_step = constrain(configuration.dexed[instance_id].pb_step - ENCODER[ENC_R].speed(), PB_STEP_MIN, PB_STEP_MAX); + lcd_display_bar_int("PB Step", configuration.dexed[instance_id].pb_step, 1.0, PB_STEP_MIN, PB_STEP_MAX, 2, false, false, false, false); + MicroDexed[instance_id]->setPBController(configuration.dexed[instance_id].pb_range, configuration.dexed[instance_id].pb_step); } - - lcd_display_bar_int("PB Step", configuration.dexed[instance_id].pb_step, PB_STEP_MIN, PB_STEP_MAX, 2, false, false, false, false); } if (LCDML.FUNC_close()) // ****** STABLE END ********* @@ -1939,7 +1945,7 @@ void UI_func_mw_range(uint8_t param) { // setup function lcd_special_chars(BLOCKBAR); - lcd_display_bar_int("MW Range", configuration.dexed[instance_id].mw_range, MW_RANGE_MIN, MW_RANGE_MAX, 2, false, false, false, true); + lcd_display_bar_int("MW Range", configuration.dexed[instance_id].mw_range, 1.0, MW_RANGE_MIN, MW_RANGE_MAX, 2, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -1955,10 +1961,10 @@ void UI_func_mw_range(uint8_t param) else if (LCDML.BT_checkUp()) configuration.dexed[instance_id].mw_range = constrain(configuration.dexed[instance_id].mw_range - ENCODER[ENC_R].speed(), MW_RANGE_MIN, MW_RANGE_MAX); + lcd_display_bar_int("MW Range", configuration.dexed[instance_id].mw_range, 1.0, MW_RANGE_MIN, MW_RANGE_MAX, 2, false, false, false, false); + MicroDexed[instance_id]->setMWController(configuration.dexed[instance_id].mw_range, configuration.dexed[instance_id].mw_assign, configuration.dexed[instance_id].mw_mode); } - - lcd_display_bar_int("MW Range", configuration.dexed[instance_id].mw_range, MW_RANGE_MIN, MW_RANGE_MAX, 2, false, false, false, false); } if (LCDML.FUNC_close()) // ****** STABLE END ********* @@ -1996,36 +2002,36 @@ void UI_func_mw_assign(uint8_t param) else if (LCDML.BT_checkUp()) configuration.dexed[instance_id].mw_assign = constrain(configuration.dexed[instance_id].mw_assign - 1, MW_ASSIGN_MIN, MW_ASSIGN_MAX); - MicroDexed[instance_id]->setMWController(configuration.dexed[instance_id].mw_range, configuration.dexed[instance_id].mw_assign, configuration.dexed[instance_id].mw_mode); - } + lcd.setCursor(0, 1); + switch (configuration.dexed[instance_id].mw_assign) + { + case 0: + lcd.print(F("[ NONE ]")); + break; + case 1: + lcd.print(F("[PTCH ]")); + break; + case 2: + lcd.print(F("[ AMP ]")); + break; + case 3: + lcd.print(F("[PTCH AMP ]")); + break; + case 4: + lcd.print(F("[ EG-BS]")); + break; + case 5: + lcd.print(F("[PTCH EG-BS]")); + break; + case 6: + lcd.print(F("[ AMP EG-BS]")); + break; + case 7: + lcd.print(F("[PTCH AMP EG-BS]")); + break; + } - lcd.setCursor(0, 1); - switch (configuration.dexed[instance_id].mw_assign) - { - case 0: - lcd.print(F("[ NONE ]")); - break; - case 1: - lcd.print(F("[PTCH ]")); - break; - case 2: - lcd.print(F("[ AMP ]")); - break; - case 3: - lcd.print(F("[PTCH AMP ]")); - break; - case 4: - lcd.print(F("[ EG-BS]")); - break; - case 5: - lcd.print(F("[PTCH EG-BS]")); - break; - case 6: - lcd.print(F("[ AMP EG-BS]")); - break; - case 7: - lcd.print(F("[PTCH AMP EG-BS]")); - break; + MicroDexed[instance_id]->setMWController(configuration.dexed[instance_id].mw_range, configuration.dexed[instance_id].mw_assign, configuration.dexed[instance_id].mw_mode); } } @@ -2063,18 +2069,18 @@ void UI_func_mw_mode(uint8_t param) else if (LCDML.BT_checkUp()) configuration.dexed[instance_id].mw_mode = constrain(configuration.dexed[instance_id].mw_mode - 1, MW_MODE_MIN, MW_MODE_MAX); - MicroDexed[instance_id]->setMWController(configuration.dexed[instance_id].mw_range, configuration.dexed[instance_id].mw_assign, configuration.dexed[instance_id].mw_mode); - } + lcd.setCursor(0, 1); + switch (configuration.dexed[instance_id].mw_mode) + { + case 0: + lcd.print(F("[NORMAL ]")); + break; + case 1: + lcd.print(F("[REVERSE]")); + break; + } - lcd.setCursor(0, 1); - switch (configuration.dexed[instance_id].mw_mode) - { - case 0: - lcd.print(F("[NORMAL ]")); - break; - case 1: - lcd.print(F("[REVERSE]")); - break; + MicroDexed[instance_id]->setMWController(configuration.dexed[instance_id].mw_range, configuration.dexed[instance_id].mw_assign, configuration.dexed[instance_id].mw_mode); } } @@ -2096,7 +2102,7 @@ void UI_func_fc_range(uint8_t param) { // setup function lcd_special_chars(BLOCKBAR); - lcd_display_bar_int("FC Range", configuration.dexed[instance_id].fc_range, FC_RANGE_MIN, FC_RANGE_MAX, 2, false, false, false, true); + lcd_display_bar_int("FC Range", configuration.dexed[instance_id].fc_range, 1.0, FC_RANGE_MIN, FC_RANGE_MAX, 2, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -2112,10 +2118,10 @@ void UI_func_fc_range(uint8_t param) else if (LCDML.BT_checkUp()) configuration.dexed[instance_id].fc_range = constrain(configuration.dexed[instance_id].fc_range - ENCODER[ENC_R].speed(), FC_RANGE_MIN, FC_RANGE_MAX); + lcd_display_bar_int("FC Range", configuration.dexed[instance_id].fc_range, 1.0, FC_RANGE_MIN, FC_RANGE_MAX, 2, false, false, false, false); + MicroDexed[instance_id]->setFCController(configuration.dexed[instance_id].fc_range, configuration.dexed[instance_id].fc_assign, configuration.dexed[instance_id].fc_mode); } - - lcd_display_bar_int("FC Range", configuration.dexed[instance_id].fc_range, FC_RANGE_MIN, FC_RANGE_MAX, 2, false, false, false, false); } if (LCDML.FUNC_close()) // ****** STABLE END ********* @@ -2153,36 +2159,36 @@ void UI_func_fc_assign(uint8_t param) else if (LCDML.BT_checkUp()) configuration.dexed[instance_id].fc_assign = constrain(configuration.dexed[instance_id].fc_assign - 1, FC_ASSIGN_MIN, FC_ASSIGN_MAX); - MicroDexed[instance_id]->setFCController(configuration.dexed[instance_id].fc_range, configuration.dexed[instance_id].fc_assign, configuration.dexed[instance_id].fc_mode); - } + lcd.setCursor(0, 1); + switch (configuration.dexed[instance_id].fc_assign) + { + case 0: + lcd.print(F("[ NONE ]")); + break; + case 1: + lcd.print(F("[PTCH ]")); + break; + case 2: + lcd.print(F("[ AMP ]")); + break; + case 3: + lcd.print(F("[PTCH AMP ]")); + break; + case 4: + lcd.print(F("[ EG-BS]")); + break; + case 5: + lcd.print(F("[PTCH EG-BS]")); + break; + case 6: + lcd.print(F("[ AMP EG-BS]")); + break; + case 7: + lcd.print(F("[PTCH AMP EG-BS]")); + break; + } - lcd.setCursor(0, 1); - switch (configuration.dexed[instance_id].fc_assign) - { - case 0: - lcd.print(F("[ NONE ]")); - break; - case 1: - lcd.print(F("[PTCH ]")); - break; - case 2: - lcd.print(F("[ AMP ]")); - break; - case 3: - lcd.print(F("[PTCH AMP ]")); - break; - case 4: - lcd.print(F("[ EG-BS]")); - break; - case 5: - lcd.print(F("[PTCH EG-BS]")); - break; - case 6: - lcd.print(F("[ AMP EG-BS]")); - break; - case 7: - lcd.print(F("[PTCH AMP EG-BS]")); - break; + MicroDexed[instance_id]->setFCController(configuration.dexed[instance_id].fc_range, configuration.dexed[instance_id].fc_assign, configuration.dexed[instance_id].fc_mode); } } @@ -2220,18 +2226,18 @@ void UI_func_fc_mode(uint8_t param) else if (LCDML.BT_checkUp()) configuration.dexed[instance_id].fc_mode = constrain(configuration.dexed[instance_id].fc_mode - 1, FC_MODE_MIN, FC_MODE_MAX); - MicroDexed[instance_id]->setFCController(configuration.dexed[instance_id].fc_range, configuration.dexed[instance_id].fc_assign, configuration.dexed[instance_id].fc_mode); - } + lcd.setCursor(0, 1); + switch (configuration.dexed[instance_id].fc_mode) + { + case 0: + lcd.print(F("[NORMAL ]")); + break; + case 1: + lcd.print(F("[REVERSE]")); + break; + } - lcd.setCursor(0, 1); - switch (configuration.dexed[instance_id].fc_mode) - { - case 0: - lcd.print(F("[NORMAL ]")); - break; - case 1: - lcd.print(F("[REVERSE]")); - break; + MicroDexed[instance_id]->setFCController(configuration.dexed[instance_id].fc_range, configuration.dexed[instance_id].fc_assign, configuration.dexed[instance_id].fc_mode); } } @@ -2253,7 +2259,7 @@ void UI_func_bc_range(uint8_t param) { // setup function lcd_special_chars(BLOCKBAR); - lcd_display_bar_int("BC Range", configuration.dexed[instance_id].bc_range, BC_RANGE_MIN, BC_RANGE_MAX, 2, false, false, false, true); + lcd_display_bar_int("BC Range", configuration.dexed[instance_id].bc_range, 1.0, BC_RANGE_MIN, BC_RANGE_MAX, 2, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -2269,10 +2275,10 @@ void UI_func_bc_range(uint8_t param) else if (LCDML.BT_checkUp()) configuration.dexed[instance_id].bc_range = constrain(configuration.dexed[instance_id].bc_range - ENCODER[ENC_R].speed(), BC_RANGE_MIN, BC_RANGE_MAX); + lcd_display_bar_int("BC Range", configuration.dexed[instance_id].bc_range, 1.0, BC_RANGE_MIN, BC_RANGE_MAX, 2, false, false, false, false); + MicroDexed[instance_id]->setBCController(configuration.dexed[instance_id].bc_range, configuration.dexed[instance_id].bc_assign, configuration.dexed[instance_id].bc_mode); } - - lcd_display_bar_int("BC Range", configuration.dexed[instance_id].bc_range, BC_RANGE_MIN, BC_RANGE_MAX, 2, false, false, false, false); } if (LCDML.FUNC_close()) // ****** STABLE END ********* @@ -2310,36 +2316,36 @@ void UI_func_bc_assign(uint8_t param) else if (LCDML.BT_checkUp()) configuration.dexed[instance_id].bc_assign = constrain(configuration.dexed[instance_id].bc_assign - 1, BC_ASSIGN_MIN, BC_ASSIGN_MAX); - MicroDexed[instance_id]->setBCController(configuration.dexed[instance_id].bc_range, configuration.dexed[instance_id].bc_assign, configuration.dexed[instance_id].bc_mode); - } + lcd.setCursor(0, 1); + switch (configuration.dexed[instance_id].bc_assign) + { + case 0: + lcd.print(F("[ NONE ]")); + break; + case 1: + lcd.print(F("[PTCH ]")); + break; + case 2: + lcd.print(F("[ AMP ]")); + break; + case 3: + lcd.print(F("[PTCH AMP ]")); + break; + case 4: + lcd.print(F("[ EG-BS]")); + break; + case 5: + lcd.print(F("[PTCH EG-BS]")); + break; + case 6: + lcd.print(F("[ AMP EG-BS]")); + break; + case 7: + lcd.print(F("[PTCH AMP EG-BS]")); + break; + } - lcd.setCursor(0, 1); - switch (configuration.dexed[instance_id].bc_assign) - { - case 0: - lcd.print(F("[ NONE ]")); - break; - case 1: - lcd.print(F("[PTCH ]")); - break; - case 2: - lcd.print(F("[ AMP ]")); - break; - case 3: - lcd.print(F("[PTCH AMP ]")); - break; - case 4: - lcd.print(F("[ EG-BS]")); - break; - case 5: - lcd.print(F("[PTCH EG-BS]")); - break; - case 6: - lcd.print(F("[ AMP EG-BS]")); - break; - case 7: - lcd.print(F("[PTCH AMP EG-BS]")); - break; + MicroDexed[instance_id]->setBCController(configuration.dexed[instance_id].bc_range, configuration.dexed[instance_id].bc_assign, configuration.dexed[instance_id].bc_mode); } } @@ -2377,18 +2383,18 @@ void UI_func_bc_mode(uint8_t param) else if (LCDML.BT_checkUp()) configuration.dexed[instance_id].bc_mode = constrain(configuration.dexed[instance_id].bc_mode - 1, BC_MODE_MIN, BC_MODE_MAX); - MicroDexed[instance_id]->setBCController(configuration.dexed[instance_id].bc_range, configuration.dexed[instance_id].bc_assign, configuration.dexed[instance_id].bc_mode); - } + lcd.setCursor(0, 1); + switch (configuration.dexed[instance_id].bc_mode) + { + case 0: + lcd.print(F("[NORMAL ]")); + break; + case 1: + lcd.print(F("[REVERSE]")); + break; + } - lcd.setCursor(0, 1); - switch (configuration.dexed[instance_id].bc_mode) - { - case 0: - lcd.print(F("[NORMAL ]")); - break; - case 1: - lcd.print(F("[REVERSE]")); - break; + MicroDexed[instance_id]->setBCController(configuration.dexed[instance_id].bc_range, configuration.dexed[instance_id].bc_assign, configuration.dexed[instance_id].bc_mode); } } @@ -2410,7 +2416,7 @@ void UI_func_at_range(uint8_t param) { // setup function lcd_special_chars(BLOCKBAR); - lcd_display_bar_int("AT Range", configuration.dexed[instance_id].at_range, AT_RANGE_MIN, AT_RANGE_MAX, 2, false, false, false, true); + lcd_display_bar_int("AT Range", configuration.dexed[instance_id].at_range, 1.0, AT_RANGE_MIN, AT_RANGE_MAX, 2, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -2426,10 +2432,10 @@ void UI_func_at_range(uint8_t param) else if (LCDML.BT_checkUp()) configuration.dexed[instance_id].at_range = constrain(configuration.dexed[instance_id].at_range - ENCODER[ENC_R].speed(), AT_RANGE_MIN, AT_RANGE_MAX); + lcd_display_bar_int("AT Range", configuration.dexed[instance_id].at_range, 1.0, AT_RANGE_MIN, AT_RANGE_MAX, 2, false, false, false, false); + MicroDexed[instance_id]->setATController(configuration.dexed[instance_id].at_range, configuration.dexed[instance_id].at_assign, configuration.dexed[instance_id].at_mode); } - - lcd_display_bar_int("AT Range", configuration.dexed[instance_id].at_range, AT_RANGE_MIN, AT_RANGE_MAX, 2, false, false, false, false); } if (LCDML.FUNC_close()) // ****** STABLE END ********* @@ -2467,36 +2473,36 @@ void UI_func_at_assign(uint8_t param) else if (LCDML.BT_checkUp()) configuration.dexed[instance_id].at_assign = constrain(configuration.dexed[instance_id].at_assign - 1, AT_ASSIGN_MIN, AT_ASSIGN_MAX); - MicroDexed[instance_id]->setATController(configuration.dexed[instance_id].at_range, configuration.dexed[instance_id].at_assign, configuration.dexed[instance_id].at_mode); - } + lcd.setCursor(0, 1); + switch (configuration.dexed[instance_id].at_assign) + { + case 0: + lcd.print(F("[ NONE ]")); + break; + case 1: + lcd.print(F("[PTCH ]")); + break; + case 2: + lcd.print(F("[ AMP ]")); + break; + case 3: + lcd.print(F("[PTCH AMP ]")); + break; + case 4: + lcd.print(F("[ EG-BS]")); + break; + case 5: + lcd.print(F("[PTCH EG-BS]")); + break; + case 6: + lcd.print(F("[ AMP EG-BS]")); + break; + case 7: + lcd.print(F("[PTCH AMP EG-BS]")); + break; + } - lcd.setCursor(0, 1); - switch (configuration.dexed[instance_id].at_assign) - { - case 0: - lcd.print(F("[ NONE ]")); - break; - case 1: - lcd.print(F("[PTCH ]")); - break; - case 2: - lcd.print(F("[ AMP ]")); - break; - case 3: - lcd.print(F("[PTCH AMP ]")); - break; - case 4: - lcd.print(F("[ EG-BS]")); - break; - case 5: - lcd.print(F("[PTCH EG-BS]")); - break; - case 6: - lcd.print(F("[ AMP EG-BS]")); - break; - case 7: - lcd.print(F("[PTCH AMP EG-BS]")); - break; + MicroDexed[instance_id]->setATController(configuration.dexed[instance_id].at_range, configuration.dexed[instance_id].at_assign, configuration.dexed[instance_id].at_mode); } } @@ -2534,18 +2540,18 @@ void UI_func_at_mode(uint8_t param) else if (LCDML.BT_checkUp()) configuration.dexed[instance_id].at_mode = constrain(configuration.dexed[instance_id].at_mode - 1, AT_MODE_MIN, AT_MODE_MAX); - MicroDexed[instance_id]->setATController(configuration.dexed[instance_id].at_range, configuration.dexed[instance_id].at_assign, configuration.dexed[instance_id].at_mode); - } + lcd.setCursor(0, 1); + switch (configuration.dexed[instance_id].at_mode) + { + case 0: + lcd.print(F("[NORMAL ]")); + break; + case 1: + lcd.print(F("[REVERSE]")); + break; + } - lcd.setCursor(0, 1); - switch (configuration.dexed[instance_id].at_mode) - { - case 0: - lcd.print(F("[NORMAL ]")); - break; - case 1: - lcd.print(F("[REVERSE]")); - break; + MicroDexed[instance_id]->setATController(configuration.dexed[instance_id].at_range, configuration.dexed[instance_id].at_assign, configuration.dexed[instance_id].at_mode); } } @@ -2583,24 +2589,24 @@ void UI_func_portamento_mode(uint8_t param) else if (LCDML.BT_checkUp()) configuration.dexed[instance_id].portamento_mode = constrain(configuration.dexed[instance_id].portamento_mode - 1, PORTAMENTO_MODE_MIN, PORTAMENTO_MODE_MAX); - MicroDexed[instance_id]->setPortamentoMode(configuration.dexed[instance_id].portamento_mode, configuration.dexed[instance_id].portamento_glissando, configuration.dexed[instance_id].portamento_time); - } + lcd.setCursor(0, 1); + switch (configuration.dexed[instance_id].portamento_mode) + { + case 0: + if (configuration.dexed[instance_id].monopoly == 1) + lcd.print(F("[RETAIN ]")); + else + lcd.print(F("[FINGERED]")); + break; + case 1: + if (configuration.dexed[instance_id].monopoly == 1) + lcd.print(F("[FOLLOW ]")); + else + lcd.print(F("[FULL ]")); + break; + } - lcd.setCursor(0, 1); - switch (configuration.dexed[instance_id].portamento_mode) - { - case 0: - if (configuration.dexed[instance_id].monopoly == 1) - lcd.print(F("[RETAIN ]")); - else - lcd.print(F("[FINGERED]")); - break; - case 1: - if (configuration.dexed[instance_id].monopoly == 1) - lcd.print(F("[FOLLOW ]")); - else - lcd.print(F("[FULL ]")); - break; + MicroDexed[instance_id]->setPortamentoMode(configuration.dexed[instance_id].portamento_mode, configuration.dexed[instance_id].portamento_glissando, configuration.dexed[instance_id].portamento_time); } } @@ -2638,18 +2644,18 @@ void UI_func_portamento_glissando(uint8_t param) else if (LCDML.BT_checkUp()) configuration.dexed[instance_id].portamento_glissando = constrain(configuration.dexed[instance_id].portamento_glissando - 1, PORTAMENTO_GLISSANDO_MIN, PORTAMENTO_GLISSANDO_MAX); - MicroDexed[instance_id]->setPortamentoMode(configuration.dexed[instance_id].portamento_mode, configuration.dexed[instance_id].portamento_glissando, configuration.dexed[instance_id].portamento_time); - } + lcd.setCursor(0, 1); + switch (configuration.dexed[instance_id].portamento_glissando) + { + case 0: + lcd.print(F("[OFF]")); + break; + case 1: + lcd.print(F("[ON ]")); + break; + } - lcd.setCursor(0, 1); - switch (configuration.dexed[instance_id].portamento_glissando) - { - case 0: - lcd.print(F("[OFF ]")); - break; - case 1: - lcd.print(F("[ON ]")); - break; + MicroDexed[instance_id]->setPortamentoMode(configuration.dexed[instance_id].portamento_mode, configuration.dexed[instance_id].portamento_glissando, configuration.dexed[instance_id].portamento_time); } } @@ -2670,7 +2676,7 @@ void UI_func_portamento_time(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { lcd_special_chars(BLOCKBAR); - lcd_display_bar_int("Portam. Time", configuration.dexed[instance_id].portamento_time, PORTAMENTO_TIME_MIN, PORTAMENTO_TIME_MAX, 2, false, false, false, true); + lcd_display_bar_int("Portam. Time", configuration.dexed[instance_id].portamento_time, 1.0, PORTAMENTO_TIME_MIN, PORTAMENTO_TIME_MAX, 2, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -2686,10 +2692,10 @@ void UI_func_portamento_time(uint8_t param) else if (LCDML.BT_checkUp()) configuration.dexed[instance_id].portamento_time = constrain(configuration.dexed[instance_id].portamento_time - ENCODER[ENC_R].speed(), PORTAMENTO_TIME_MIN, PORTAMENTO_TIME_MAX); + lcd_display_bar_int("Portam. Time", configuration.dexed[instance_id].portamento_time, 1.0, PORTAMENTO_TIME_MIN, PORTAMENTO_TIME_MAX, 2, false, false, false, false); + MicroDexed[instance_id]->setPortamentoMode(configuration.dexed[instance_id].portamento_mode, configuration.dexed[instance_id].portamento_glissando, configuration.dexed[instance_id].portamento_time); } - - lcd_display_bar_int("Portam. Time", configuration.dexed[instance_id].portamento_time, PORTAMENTO_TIME_MIN, PORTAMENTO_TIME_MAX, 2, false, false, false, false); } if (LCDML.FUNC_close()) // ****** STABLE END ********* @@ -2770,6 +2776,15 @@ void UI_handle_OP(uint8_t param, uint8_t op, uint8_t instance_id) lcd.setCursor(0, 0); lcd.print(F("Operator ")); lcd.print(op + 1); + lcd.setCursor(0, 1); + if (state == true) + { + lcd.print(F("[ENABLED ]")); + } + else + { + lcd.print(F("[DISABLED]")); + } } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -2788,19 +2803,22 @@ void UI_handle_OP(uint8_t param, uint8_t op, uint8_t instance_id) bitSet(configuration.dexed[instance_id].op_enabled, op); state = true; } - } - lcd.setCursor(0, 1); - if (state == true) - { - lcd.print(F("[ENABLED ]")); - } - else - { - lcd.print(F("[DISABLED]")); + if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + { + lcd.setCursor(0, 1); + if (state == true) + { + lcd.print(F("[ENABLED ]")); + } + else + { + lcd.print(F("[DISABLED]")); + } + MicroDexed[instance_id]->setOPs(configuration.dexed[instance_id].op_enabled); + MicroDexed[instance_id]->doRefreshVoice(); + } } - MicroDexed[instance_id]->setOPs(configuration.dexed[instance_id].op_enabled); - MicroDexed[instance_id]->doRefreshVoice(); if (LCDML.FUNC_close()) // ****** STABLE END ********* { @@ -2861,17 +2879,17 @@ void UI_func_midi_soft_thru(uint8_t param) configuration.soft_midi_thru = constrain(configuration.soft_midi_thru + 1, SOFT_MIDI_THRU_MIN, SOFT_MIDI_THRU_MAX); else if (LCDML.BT_checkUp()) configuration.soft_midi_thru = constrain(configuration.soft_midi_thru - 1, SOFT_MIDI_THRU_MIN, SOFT_MIDI_THRU_MAX); - } - lcd.setCursor(0, 1); - switch (configuration.soft_midi_thru) - { - case 0: - lcd.print(F("[OFF]")); - break; - case 1: - lcd.print(F("[ON ]")); - break; + lcd.setCursor(0, 1); + switch (configuration.soft_midi_thru) + { + case 0: + lcd.print(F("[OFF]")); + break; + case 1: + lcd.print(F("[ON ]")); + break; + } } } @@ -2893,7 +2911,7 @@ void UI_func_velocity_level(uint8_t param) { // setup function lcd_special_chars(BLOCKBAR); - lcd_display_bar_int("Velocity Lvl", configuration.dexed[instance_id].velocity_level, VELOCITY_LEVEL_MIN, VELOCITY_LEVEL_MAX, 3, false, false, false, true); + lcd_display_bar_int("Velocity Lvl", configuration.dexed[instance_id].velocity_level, 1.0, VELOCITY_LEVEL_MIN, VELOCITY_LEVEL_MAX, 3, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -2908,9 +2926,9 @@ void UI_func_velocity_level(uint8_t param) configuration.dexed[instance_id].velocity_level = constrain(configuration.dexed[instance_id].velocity_level + ENCODER[ENC_R].speed(), VELOCITY_LEVEL_MIN, VELOCITY_LEVEL_MAX); else if (LCDML.BT_checkUp()) configuration.dexed[instance_id].velocity_level = constrain(configuration.dexed[instance_id].velocity_level - ENCODER[ENC_R].speed(), VELOCITY_LEVEL_MIN, VELOCITY_LEVEL_MAX); - } - lcd_display_bar_int("Velocity Lvl", configuration.dexed[instance_id].velocity_level, VELOCITY_LEVEL_MIN, VELOCITY_LEVEL_MAX, 3, false, false, false, false); + lcd_display_bar_int("Velocity Lvl", configuration.dexed[instance_id].velocity_level, 1.0, VELOCITY_LEVEL_MIN, VELOCITY_LEVEL_MAX, 3, false, false, false, false); + } } if (LCDML.FUNC_close()) // ****** STABLE END ********* @@ -2997,11 +3015,11 @@ void UI_func_volume(uint8_t param) if (menu_state != MENU_VOLUME) { lcd_special_chars(BLOCKBAR); - lcd_display_bar_int("Volume", configuration.vol, VOLUME_MIN, VOLUME_MAX, 3, false, false, false, true); + lcd_display_bar_int("Volume", configuration.vol, 1.0, VOLUME_MIN, VOLUME_MAX, 3, false, false, false, true); menu_state = MENU_VOLUME; } else - lcd_display_bar_int("Volume", configuration.vol, VOLUME_MIN, VOLUME_MAX, 3, false, false, false, false); + lcd_display_bar_int("Volume", configuration.vol, 1.0, VOLUME_MIN, VOLUME_MAX, 3, false, false, false, false); set_volume(configuration.vol, configuration.mono); eeprom_write(); @@ -3242,7 +3260,7 @@ void lcd_display_float(float var, uint8_t size_number, uint8_t size_fraction, bo lcd.print(F("]")); } -void lcd_display_bar_int(const char* title, uint32_t value, uint32_t min_value, uint32_t max_value, uint8_t size, bool zeros, bool brackets, bool sign, bool init) +void lcd_display_bar_int(const char* title, uint32_t value, float factor, uint32_t min_value, uint32_t max_value, uint8_t size, bool zeros, bool brackets, bool sign, bool init) { float _v = float((value - min_value) * LCD_cols) / (max_value - min_value); float _vi = 0.0; @@ -3255,7 +3273,7 @@ void lcd_display_bar_int(const char* title, uint32_t value, uint32_t min_value, LCDML.DISP_clear(); lcd.show(0, 0, LCD_cols - 1, title); lcd.setCursor(LCD_cols - (size + 1) + 1, 0); - lcd_display_int(value, size, zeros, brackets, sign); + lcd_display_int(uint16_t(float(value)*factor + 0.5), size, zeros, brackets, sign); lcd.setCursor(0, 1); if (vi == 0 && uint8_t(vf / 2) == 0) @@ -3286,7 +3304,7 @@ void lcd_display_bar_int(const char* title, uint32_t value, uint32_t min_value, uint8_t ca = uint8_t (float(LCD_cols - 1) / float(max_value)) + 1; lcd.setCursor(LCD_cols - (size + 1) + 1, 0); - lcd_display_int(value, size, zeros, brackets, sign); + lcd_display_int(uint16_t(float(value)*factor + 0.5), size, zeros, brackets, sign); if (vi == 0 && uint8_t(vf / 2) == 0) { diff --git a/config.h b/config.h index 74d0e81..5273898 100644 --- a/config.h +++ b/config.h @@ -352,7 +352,7 @@ enum { DEXED, CHORUS, DELAY, REVERB}; #define CHORUS_LEVEL_DEFAULT 0 #define DELAY_TIME_MIN 0 -#define DELAY_TIME_MAX DELAY_MAX_TIME +#define DELAY_TIME_MAX DELAY_MAX_TIME/10 #define DELAY_TIME_DEFAULT 0 #define DELAY_FEEDBACK_MIN 0