From a157e3a8c49588f234120d27c8e14d282d9adcd9 Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Mon, 23 Mar 2020 16:59:15 +0100 Subject: [PATCH] Added note refresh option: normal (new note is triggered), retriggered (search for same note an retrigger) --- MicroDexed.ino | 28 ++++++++----- UI.hpp | 73 ++++++++++++++++++++++++++++++++- UI_1.h | 79 ++++++++++++++++++------------------ UI_1_FX.h | 107 +++++++++++++++++++++++++------------------------ config.h | 5 +++ dexed.cpp | 32 +++++++++++++-- dexed.h | 2 + update | 13 ++++++ 8 files changed, 234 insertions(+), 105 deletions(-) create mode 100644 update diff --git a/MicroDexed.ino b/MicroDexed.ino index 06dc45c..145beeb 100644 --- a/MicroDexed.ino +++ b/MicroDexed.ino @@ -245,14 +245,6 @@ void setup() AudioNoInterrupts(); AudioMemory(AUDIO_MEM); -#ifdef DEBUG - Serial.begin(SERIAL_SPEED); - while (!Serial) - { - yield(); - } -#endif - #ifdef DISPLAY_LCD_SPI pinMode(SDCARD_CS_PIN, OUTPUT); pinMode(U8X8_CS_PIN, OUTPUT); @@ -260,7 +252,18 @@ void setup() #ifdef ENABLE_LCD_UI setup_ui(); -#else +#endif +#ifdef DEBUG +#ifdef ENABLE_LCD_UI + setup_debug_message(); +#endif + Serial.begin(SERIAL_SPEED); + while (!Serial) + { + yield(); + } +#endif +#ifndef ENABLE_LCD_UI #ifdef DEBUG Serial.println(F("NO LCD DISPLAY ENABLED!")); #endif @@ -1420,6 +1423,7 @@ void check_configuration(void) configuration.dexed[instance_id].velocity_level = constrain(configuration.dexed[instance_id].velocity_level, VELOCITY_LEVEL_MIN, VELOCITY_LEVEL_MAX); configuration.dexed[instance_id].engine = constrain(configuration.dexed[instance_id].engine, ENGINE_MIN, ENGINE_MAX); configuration.dexed[instance_id].monopoly = constrain(configuration.dexed[instance_id].monopoly, MONOPOLY_MIN, MONOPOLY_MAX); + configuration.dexed[instance_id].note_refresh = constrain(configuration.dexed[instance_id].note_refresh, NOTE_REFRESH_MIN, NOTE_REFRESH_MAX); configuration.dexed[instance_id].pb_range = constrain(configuration.dexed[instance_id].pb_range, PB_RANGE_MIN, PB_RANGE_MAX); configuration.dexed[instance_id].pb_step = constrain(configuration.dexed[instance_id].pb_step, PB_STEP_MIN, PB_STEP_MAX); configuration.dexed[instance_id].mw_range = constrain(configuration.dexed[instance_id].mw_range, MW_RANGE_MIN, MW_RANGE_MAX); @@ -1491,6 +1495,7 @@ void init_configuration(void) configuration.dexed[instance_id].velocity_level = VELOCITY_LEVEL_DEFAULT; configuration.dexed[instance_id].engine = ENGINE_DEFAULT; configuration.dexed[instance_id].monopoly = MONOPOLY_DEFAULT; + configuration.dexed[instance_id].note_refresh = NOTE_REFRESH_DEFAULT; configuration.dexed[instance_id].pb_range = PB_RANGE_DEFAULT; configuration.dexed[instance_id].pb_step = PB_STEP_DEFAULT; configuration.dexed[instance_id].mw_range = MW_RANGE_DEFAULT; @@ -1739,16 +1744,21 @@ void show_configuration(void) Serial.print(F(" Polyphony ")); Serial.println(configuration.dexed[instance_id].polyphony, DEC); Serial.print(F(" Engine ")); Serial.println(configuration.dexed[instance_id].engine, DEC); Serial.print(F(" Mono/Poly ")); Serial.println(configuration.dexed[instance_id].monopoly, DEC); + Serial.print(F(" Note Refresh ")); Serial.println(configuration.dexed[instance_id].note_refresh, DEC); Serial.print(F(" Pitchbend Range ")); Serial.println(configuration.dexed[instance_id].pb_range, DEC); Serial.print(F(" Pitchbend Step ")); Serial.println(configuration.dexed[instance_id].pb_step, DEC); Serial.print(F(" Modwheel Range ")); Serial.println(configuration.dexed[instance_id].mw_range, DEC); Serial.print(F(" Modwheel Assign ")); Serial.println(configuration.dexed[instance_id].mw_assign, DEC); + Serial.print(F(" Modwheel Mode ")); Serial.println(configuration.dexed[instance_id].mw_mode, DEC); Serial.print(F(" Footctrl Range ")); Serial.println(configuration.dexed[instance_id].fc_range, DEC); Serial.print(F(" Footctrl Assign ")); Serial.println(configuration.dexed[instance_id].fc_assign, DEC); + Serial.print(F(" Footctrl Mode ")); Serial.println(configuration.dexed[instance_id].fc_mode, DEC); Serial.print(F(" BreathCtrl Range ")); Serial.println(configuration.dexed[instance_id].bc_range, DEC); Serial.print(F(" Breathctrl Assign ")); Serial.println(configuration.dexed[instance_id].bc_assign, DEC); + Serial.print(F(" Breathctrl Mode ")); Serial.println(configuration.dexed[instance_id].bc_mode, DEC); Serial.print(F(" Aftertouch Range ")); Serial.println(configuration.dexed[instance_id].at_range, DEC); Serial.print(F(" Aftertouch Assign ")); Serial.println(configuration.dexed[instance_id].at_range, DEC); + Serial.print(F(" Aftertouch Mode ")); Serial.println(configuration.dexed[instance_id].at_mode, DEC); Serial.print(F(" Portamento Mode ")); Serial.println(configuration.dexed[instance_id].portamento_mode, DEC); Serial.print(F(" Portamento Glissando ")); Serial.println(configuration.dexed[instance_id].portamento_glissando, DEC); Serial.print(F(" Portamento Time ")); Serial.println(configuration.dexed[instance_id].portamento_time, DEC); diff --git a/UI.hpp b/UI.hpp index ebc82b6..63deae9 100644 --- a/UI.hpp +++ b/UI.hpp @@ -170,6 +170,7 @@ void UI_func_midi_channel(uint8_t param); void UI_func_sound_intensity(uint8_t param); void UI_func_panorama(uint8_t param); void UI_func_stereo_mono(uint8_t param); +void UI_func_note_refresh(uint8_t param); void UI_func_polyphony(uint8_t param); void UI_func_engine(uint8_t param); void UI_func_mono_poly(uint8_t param); @@ -288,6 +289,17 @@ void setup_ui(void) { //LCDML.SCREEN_enable(UI_func_voice_selection, VOICE_SELECTION_MS); // set to 10 seconds } +#ifdef DEBUG +void setup_debug_message(void) { + // LCD Begin + lcd.clear(); + lcd.setCursor(3, 0); + lcd.print(F("DEBUG MODE")); + lcd.setCursor(0, 1); + lcd.print(F("ENABLE CONSOLE!")); +} +#endif + void lcdml_menu_control(void) { // If something must init, put in in the setup condition @@ -2015,6 +2027,65 @@ void UI_func_mono_poly(uint8_t param) } } +void UI_func_note_refresh(uint8_t param) +{ + uint8_t instance_id = 0; + + if (LCDML.FUNC_getID() > MENU_ID_OF_INSTANCE_2) + instance_id = 1; + + if (LCDML.FUNC_setup()) // ****** SETUP ********* + { + // setup function + lcd.setCursor(0, 0); + lcd.print(F("Note Refresh")); + } + + if (LCDML.FUNC_loop()) // ****** LOOP ********* + { + if (LCDML.BT_checkEnter()) + { + LCDML.FUNC_goBackToMenu(); + } + else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + { + if (LCDML.BT_checkDown()) + { + if (configuration.dexed[instance_id].note_refresh < NOTE_REFRESH_MAX) + { + configuration.dexed[instance_id].note_refresh++; + } + } + else if (LCDML.BT_checkUp()) + { + if (configuration.dexed[instance_id].note_refresh > NOTE_REFRESH_MIN) + { + configuration.dexed[instance_id].note_refresh--; + } + } + + MicroDexed[instance_id]->setRefreshMode(configuration.dexed[instance_id].note_refresh); + } + + lcd.setCursor(0, 1); + switch (configuration.dexed[instance_id].note_refresh) + { + case 0: + lcd.print(F("[NORMAL ]")); + break; + case 1: + lcd.print(F("[RETRIGGERED]")); + break; + } + } + + if (LCDML.FUNC_close()) // ****** STABLE END ********* + { + // you can here reset some global vars or do nothing + eeprom_write(); + } +} + void UI_func_pb_range(uint8_t param) { uint8_t instance_id = 0; @@ -2391,7 +2462,7 @@ void UI_func_fc_assign(uint8_t param) } } - MicroDexed[instance_id]->setFCController(configuration.dexed[instance_id].fc_range, configuration.dexed[instance_id].fc_assign,configuration.dexed[instance_id].fc_mode); + 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); diff --git a/UI_1.h b/UI_1.h index 34e1390..1b794b7 100644 --- a/UI_1.h +++ b/UI_1.h @@ -35,44 +35,45 @@ LCDML_add(6, LCDML_0_1, 6, "Polyphony", UI_func_polyphony); LCDML_add(7, LCDML_0_1, 7, "Velocity Lvl", UI_func_velocity_level); LCDML_add(8, LCDML_0_1, 8, "Engine", UI_func_engine); LCDML_add(9, LCDML_0_1, 9, "Mono/Poly", UI_func_mono_poly); -LCDML_add(10, LCDML_0_1, 10, "Pitchbend", NULL); -LCDML_add(11, LCDML_0_1_10, 1, "PB Range", UI_func_pb_range); -LCDML_add(12, LCDML_0_1_10, 2, "PB Step", UI_func_pb_step); -LCDML_add(13, LCDML_0_1, 11, "Mod Wheel", NULL); -LCDML_add(14, LCDML_0_1_11, 1, "MW Range", UI_func_mw_range); -LCDML_add(15, LCDML_0_1_11, 2, "MW Assign", UI_func_mw_assign); -LCDML_add(16, LCDML_0_1_11, 3, "MW Mode", UI_func_mw_mode); -LCDML_add(17, LCDML_0_1, 12, "Foot Ctrl", NULL); -LCDML_add(18, LCDML_0_1_12, 1, "FC Range", UI_func_fc_range); -LCDML_add(19, LCDML_0_1_12, 2, "FC Assign", UI_func_fc_assign); -LCDML_add(20, LCDML_0_1_12, 3, "FC Mode", UI_func_fc_mode); -LCDML_add(21, LCDML_0_1, 13, "Breath Ctrl", NULL); -LCDML_add(22, LCDML_0_1_13, 1, "BC Range", UI_func_bc_range); -LCDML_add(23, LCDML_0_1_13, 2, "BC Assign", UI_func_bc_assign); -LCDML_add(24, LCDML_0_1_13, 3, "BC Mode", UI_func_bc_mode); -LCDML_add(25, LCDML_0_1, 14, "Aftertouch", NULL); -LCDML_add(26, LCDML_0_1_14, 1, "AT Range", UI_func_at_range); -LCDML_add(27, LCDML_0_1_14, 2, "AT Assign", UI_func_at_assign); -LCDML_add(28, LCDML_0_1_14, 3, "AT Mode", UI_func_at_mode); -LCDML_add(29, LCDML_0_1, 15, "Portamento", NULL); -LCDML_add(30, LCDML_0_1_15, 1, "Port. Mode", UI_func_portamento_mode); -LCDML_add(31, LCDML_0_1_15, 2, "Port. Gliss", UI_func_portamento_glissando); -LCDML_add(32, LCDML_0_1_15, 3, "Port. Time", UI_func_portamento_time); -LCDML_add(33, LCDML_0_1, 16, "Operator", NULL); -LCDML_add(34, LCDML_0_1_16, 1, "OP1", UI_func_OP1); -LCDML_add(35, LCDML_0_1_16, 2, "OP2", UI_func_OP2); -LCDML_add(36, LCDML_0_1_16, 3, "OP3", UI_func_OP3); -LCDML_add(37, LCDML_0_1_16, 4, "OP4", UI_func_OP4); -LCDML_add(38, LCDML_0_1_16, 5, "OP5", UI_func_OP5); -LCDML_add(39, LCDML_0_1_16, 6, "OP6", UI_func_OP6); -LCDML_add(40, LCDML_0, 2, "Load/Save", NULL); -LCDML_add(41, LCDML_0_2, 1, "Load", UI_func_load); -LCDML_add(42, LCDML_0_2, 2, "Save", UI_func_save); -LCDML_add(43, LCDML_0, 3, "System", NULL); -LCDML_add(44, LCDML_0_3, 1, "Stereo/Mono", UI_func_stereo_mono); -LCDML_add(45, LCDML_0_3, 2, "MIDI Soft THRU", UI_func_midi_soft_thru); -LCDML_add(46, LCDML_0, 4, "Info", UI_func_information); -#define _LCDML_DISP_cnt 46 -#define MENU_ID_OF_INSTANCE_2 40 +LCDML_add(10, LCDML_0_1, 10, "Note Refresh", UI_func_note_refresh); +LCDML_add(11, LCDML_0_1, 11, "Pitchbend", NULL); +LCDML_add(12, LCDML_0_1_11, 1, "PB Range", UI_func_pb_range); +LCDML_add(13, LCDML_0_1_11, 2, "PB Step", UI_func_pb_step); +LCDML_add(14, LCDML_0_1, 12, "Mod Wheel", NULL); +LCDML_add(15, LCDML_0_1_12, 1, "MW Range", UI_func_mw_range); +LCDML_add(16, LCDML_0_1_12, 2, "MW Assign", UI_func_mw_assign); +LCDML_add(17, LCDML_0_1_12, 3, "MW Mode", UI_func_mw_mode); +LCDML_add(18, LCDML_0_1, 13, "Foot Ctrl", NULL); +LCDML_add(19, LCDML_0_1_13, 1, "FC Range", UI_func_fc_range); +LCDML_add(20, LCDML_0_1_13, 2, "FC Assign", UI_func_fc_assign); +LCDML_add(21, LCDML_0_1_13, 3, "FC Mode", UI_func_fc_mode); +LCDML_add(22, LCDML_0_1, 14, "Breath Ctrl", NULL); +LCDML_add(23, LCDML_0_1_14, 1, "BC Range", UI_func_bc_range); +LCDML_add(24, LCDML_0_1_14, 2, "BC Assign", UI_func_bc_assign); +LCDML_add(25, LCDML_0_1_14, 3, "BC Mode", UI_func_bc_mode); +LCDML_add(26, LCDML_0_1, 15, "Aftertouch", NULL); +LCDML_add(27, LCDML_0_1_15, 1, "AT Range", UI_func_at_range); +LCDML_add(28, LCDML_0_1_15, 2, "AT Assign", UI_func_at_assign); +LCDML_add(29, LCDML_0_1_15, 3, "AT Mode", UI_func_at_mode); +LCDML_add(30, LCDML_0_1, 16, "Portamento", NULL); +LCDML_add(31, LCDML_0_1_16, 1, "Port. Mode", UI_func_portamento_mode); +LCDML_add(32, LCDML_0_1_16, 2, "Port. Gliss", UI_func_portamento_glissando); +LCDML_add(33, LCDML_0_1_16, 3, "Port. Time", UI_func_portamento_time); +LCDML_add(34, LCDML_0_1, 17, "Operator", NULL); +LCDML_add(35, LCDML_0_1_17, 1, "OP1", UI_func_OP1); +LCDML_add(36, LCDML_0_1_17, 2, "OP2", UI_func_OP2); +LCDML_add(37, LCDML_0_1_17, 3, "OP3", UI_func_OP3); +LCDML_add(38, LCDML_0_1_17, 4, "OP4", UI_func_OP4); +LCDML_add(39, LCDML_0_1_17, 5, "OP5", UI_func_OP5); +LCDML_add(40, LCDML_0_1_17, 6, "OP6", UI_func_OP6); +LCDML_add(41, LCDML_0, 2, "Load/Save", NULL); +LCDML_add(42, LCDML_0_2, 1, "Load", UI_func_load); +LCDML_add(43, LCDML_0_2, 2, "Save", UI_func_save); +LCDML_add(44, LCDML_0, 3, "System", NULL); +LCDML_add(45, LCDML_0_3, 1, "Stereo/Mono", UI_func_stereo_mono); +LCDML_add(46, LCDML_0_3, 2, "MIDI Soft THRU", UI_func_midi_soft_thru); +LCDML_add(47, LCDML_0, 4, "Info", UI_func_information); +#define _LCDML_DISP_cnt 47 +#define MENU_ID_OF_INSTANCE_2 41 #endif diff --git a/UI_1_FX.h b/UI_1_FX.h index 56e8d54..54198fc 100644 --- a/UI_1_FX.h +++ b/UI_1_FX.h @@ -41,57 +41,58 @@ LCDML_add(12, LCDML_0_1, 10, "Polyphony", UI_func_polyphony); LCDML_add(13, LCDML_0_1, 11, "Velocity Lvl", UI_func_velocity_level); LCDML_add(14, LCDML_0_1, 12, "Engine", UI_func_engine); LCDML_add(15, LCDML_0_1, 13, "Mono/Poly", UI_func_mono_poly); -LCDML_add(16, LCDML_0_1, 14, "Pitchbend", NULL); -LCDML_add(17, LCDML_0_1_14, 1, "PB Range", UI_func_pb_range); -LCDML_add(18, LCDML_0_1_14, 2, "PB Step", UI_func_pb_step); -LCDML_add(19, LCDML_0_1, 15, "Mod Wheel", NULL); -LCDML_add(20, LCDML_0_1_15, 1, "MW Range", UI_func_mw_range); -LCDML_add(21, LCDML_0_1_15, 2, "MW Assign", UI_func_mw_assign); -LCDML_add(22, LCDML_0_1_15, 3, "MW Mode", UI_func_mw_mode); -LCDML_add(23, LCDML_0_1, 16, "Foot Ctrl", NULL); -LCDML_add(24, LCDML_0_1_16, 1, "FC Range", UI_func_fc_range); -LCDML_add(25, LCDML_0_1_16, 2, "FC Assign", UI_func_fc_assign); -LCDML_add(26, LCDML_0_1_16, 3, "FC Mode", UI_func_fc_mode); -LCDML_add(27, LCDML_0_1, 17, "Breath Ctrl", NULL); -LCDML_add(28, LCDML_0_1_17, 1, "BC Range", UI_func_bc_range); -LCDML_add(29, LCDML_0_1_17, 2, "BC Assign", UI_func_bc_assign); -LCDML_add(30, LCDML_0_1_17, 3, "BC Mode", UI_func_bc_mode); -LCDML_add(31, LCDML_0_1, 18, "Aftertouch", NULL); -LCDML_add(32, LCDML_0_1_18, 1, "AT Range", UI_func_at_range); -LCDML_add(33, LCDML_0_1_18, 2, "AT Assign", UI_func_at_assign); -LCDML_add(34, LCDML_0_1_18, 3, "AT Mode", UI_func_at_mode); -LCDML_add(35, LCDML_0_1, 19, "Portamento", NULL); -LCDML_add(36, LCDML_0_1_19, 1, "Port. Mode", UI_func_portamento_mode); -LCDML_add(37, LCDML_0_1_19, 2, "Port. Gliss", UI_func_portamento_glissando); -LCDML_add(38, LCDML_0_1_19, 3, "Port. Time", UI_func_portamento_time); -LCDML_add(39, LCDML_0_1, 20, "Operator", NULL); -LCDML_add(40, LCDML_0_1_20, 1, "OP1", UI_func_OP1); -LCDML_add(41, LCDML_0_1_20, 2, "OP2", UI_func_OP2); -LCDML_add(42, LCDML_0_1_20, 3, "OP3", UI_func_OP3); -LCDML_add(43, LCDML_0_1_20, 4, "OP4", UI_func_OP4); -LCDML_add(44, LCDML_0_1_20, 5, "OP5", UI_func_OP5); -LCDML_add(45, LCDML_0_1_20, 6, "OP6", UI_func_OP6); -LCDML_add(46, LCDML_0, 2, "Effect", NULL); -LCDML_add(47, LCDML_0_2, 1, "Reverb", NULL); -LCDML_add(48, LCDML_0_2_1, 1, "Roomsize", UI_func_reverb_roomsize); -LCDML_add(49, LCDML_0_2_1, 2, "Damping", UI_func_reverb_damping); -LCDML_add(50, LCDML_0_2_1, 3, "Level", UI_func_reverb_level); -LCDML_add(51, LCDML_0_2, 2, "Chorus", NULL); -LCDML_add(52, LCDML_0_2_2, 1, "Frequency", UI_func_chorus_frequency); -LCDML_add(53, LCDML_0_2_2, 2, "Waveform", UI_func_chorus_waveform); -LCDML_add(54, LCDML_0_2_2, 3, "Depth", UI_func_chorus_depth); -LCDML_add(55, LCDML_0_2_2, 4, "Level", UI_func_chorus_level); -LCDML_add(56, LCDML_0_2, 3, "Delay", NULL); -LCDML_add(57, LCDML_0_2_3, 1, "Time", UI_func_delay_time); -LCDML_add(58, LCDML_0_2_3, 2, "Feedback", UI_func_delay_feedback); -LCDML_add(59, LCDML_0_2_3, 3, "Level", UI_func_delay_level); -LCDML_add(60, LCDML_0, 3, "Load/Save", NULL); -LCDML_add(61, LCDML_0_3, 1, "Load", UI_func_load); -LCDML_add(62, LCDML_0_3, 2, "Save", UI_func_save); -LCDML_add(63, LCDML_0, 4, "System", NULL); -LCDML_add(64, LCDML_0_4, 1, "Stereo/Mono", UI_func_stereo_mono); -LCDML_add(65, LCDML_0_4, 2, "MIDI Soft THRU", UI_func_midi_soft_thru); -LCDML_add(66, LCDML_0, 5, "Info", UI_func_information); -#define _LCDML_DISP_cnt 66 -#define MENU_ID_OF_INSTANCE_2 46 +LCDML_add(16, LCDML_0_1, 14, "Note Refresh", UI_func_note_refresh); +LCDML_add(17, LCDML_0_1, 15, "Pitchbend", NULL); +LCDML_add(18, LCDML_0_1_15, 1, "PB Range", UI_func_pb_range); +LCDML_add(19, LCDML_0_1_15, 2, "PB Step", UI_func_pb_step); +LCDML_add(20, LCDML_0_1, 16, "Mod Wheel", NULL); +LCDML_add(21, LCDML_0_1_16, 1, "MW Range", UI_func_mw_range); +LCDML_add(22, LCDML_0_1_16, 2, "MW Assign", UI_func_mw_assign); +LCDML_add(23, LCDML_0_1_16, 3, "MW Mode", UI_func_mw_mode); +LCDML_add(24, LCDML_0_1, 17, "Foot Ctrl", NULL); +LCDML_add(25, LCDML_0_1_17, 1, "FC Range", UI_func_fc_range); +LCDML_add(26, LCDML_0_1_17, 2, "FC Assign", UI_func_fc_assign); +LCDML_add(27, LCDML_0_1_17, 3, "FC Mode", UI_func_fc_mode); +LCDML_add(28, LCDML_0_1, 18, "Breath Ctrl", NULL); +LCDML_add(29, LCDML_0_1_18, 1, "BC Range", UI_func_bc_range); +LCDML_add(30, LCDML_0_1_18, 2, "BC Assign", UI_func_bc_assign); +LCDML_add(31, LCDML_0_1_18, 3, "BC Mode", UI_func_bc_mode); +LCDML_add(32, LCDML_0_1, 19, "Aftertouch", NULL); +LCDML_add(33, LCDML_0_1_19, 1, "AT Range", UI_func_at_range); +LCDML_add(34, LCDML_0_1_19, 2, "AT Assign", UI_func_at_assign); +LCDML_add(35, LCDML_0_1_19, 3, "AT Mode", UI_func_at_mode); +LCDML_add(36, LCDML_0_1, 20, "Portamento", NULL); +LCDML_add(37, LCDML_0_1_20, 1, "Port. Mode", UI_func_portamento_mode); +LCDML_add(38, LCDML_0_1_20, 2, "Port. Gliss", UI_func_portamento_glissando); +LCDML_add(39, LCDML_0_1_20, 3, "Port. Time", UI_func_portamento_time); +LCDML_add(40, LCDML_0_1, 21, "Operator", NULL); +LCDML_add(41, LCDML_0_1_21, 1, "OP1", UI_func_OP1); +LCDML_add(42, LCDML_0_1_21, 2, "OP2", UI_func_OP2); +LCDML_add(43, LCDML_0_1_21, 3, "OP3", UI_func_OP3); +LCDML_add(44, LCDML_0_1_21, 4, "OP4", UI_func_OP4); +LCDML_add(45, LCDML_0_1_21, 5, "OP5", UI_func_OP5); +LCDML_add(46, LCDML_0_1_21, 6, "OP6", UI_func_OP6); +LCDML_add(47, LCDML_0, 2, "Effect", NULL); +LCDML_add(48, LCDML_0_2, 1, "Reverb", NULL); +LCDML_add(49, LCDML_0_2_1, 1, "Roomsize", UI_func_reverb_roomsize); +LCDML_add(50, LCDML_0_2_1, 2, "Damping", UI_func_reverb_damping); +LCDML_add(51, LCDML_0_2_1, 3, "Level", UI_func_reverb_level); +LCDML_add(52, LCDML_0_2, 2, "Chorus", NULL); +LCDML_add(53, LCDML_0_2_2, 1, "Frequency", UI_func_chorus_frequency); +LCDML_add(54, LCDML_0_2_2, 2, "Waveform", UI_func_chorus_waveform); +LCDML_add(55, LCDML_0_2_2, 3, "Depth", UI_func_chorus_depth); +LCDML_add(56, LCDML_0_2_2, 4, "Level", UI_func_chorus_level); +LCDML_add(57, LCDML_0_2, 3, "Delay", NULL); +LCDML_add(58, LCDML_0_2_3, 1, "Time", UI_func_delay_time); +LCDML_add(59, LCDML_0_2_3, 2, "Feedback", UI_func_delay_feedback); +LCDML_add(60, LCDML_0_2_3, 3, "Level", UI_func_delay_level); +LCDML_add(61, LCDML_0, 3, "Load/Save", NULL); +LCDML_add(62, LCDML_0_3, 1, "Load", UI_func_load); +LCDML_add(63, LCDML_0_3, 2, "Save", UI_func_save); +LCDML_add(64, LCDML_0, 4, "System", NULL); +LCDML_add(65, LCDML_0_4, 1, "Stereo/Mono", UI_func_stereo_mono); +LCDML_add(66, LCDML_0_4, 2, "MIDI Soft THRU", UI_func_midi_soft_thru); +LCDML_add(67, LCDML_0, 5, "Info", UI_func_information); +#define _LCDML_DISP_cnt 67 +#define MENU_ID_OF_INSTANCE_2 47 #endif diff --git a/config.h b/config.h index 6ad72a0..b5eeb5e 100644 --- a/config.h +++ b/config.h @@ -400,6 +400,10 @@ enum { DEXED, CHORUS, DELAY, REVERB}; #define MONOPOLY_MAX 1 #define MONOPOLY_DEFAULT 0 +#define NOTE_REFRESH_MIN 0 +#define NOTE_REFRESH_MAX 1 +#define NOTE_REFRESH_DEFAULT 0 + #define PB_RANGE_MIN 0 #define PB_RANGE_MAX 12 #define PB_RANGE_DEFAULT 1 @@ -512,6 +516,7 @@ typedef struct { uint8_t velocity_level; uint8_t engine; uint8_t monopoly; + uint8_t note_refresh; uint8_t pb_range; uint8_t pb_step; uint8_t mw_range; diff --git a/dexed.cpp b/dexed.cpp index 3078c72..04b247e 100644 --- a/dexed.cpp +++ b/dexed.cpp @@ -179,8 +179,29 @@ void Dexed::keydown(int16_t pitch, uint8_t velo) { uint8_t note = currentNote; uint8_t keydown_counter = 0; - for (uint8_t i = 0; i < max_notes; i++) { - if (!voices[note].keydown) { + if (!monoMode && refreshMode) + { + for (uint8_t i = 0; i < max_notes; i++) + { + if (voices[i].midi_note == pitch && voices[i].keydown == false && voices[i].live && voices[i].sustained == true) + { + // retrigger or refresh note? + voices[i].dx7_note->keyup(); + voices[i].midi_note = pitch; + voices[i].velocity = velo; + voices[i].keydown = true; + voices[i].sustained = sustain; + voices[i].live = true; + voices[i].dx7_note->init(data, pitch, velo, pitch, porta); + return; + } + } + } + + for (uint8_t i = 0; i < max_notes; i++) + { + if (!voices[note].keydown) + { currentNote = (note + 1) % max_notes; voices[note].midi_note = pitch; voices[note].velocity = velo; @@ -193,8 +214,9 @@ void Dexed::keydown(int16_t pitch, uint8_t velo) { break; } else + { keydown_counter++; - + } note = (note + 1) % max_notes; } @@ -321,6 +343,10 @@ void Dexed::setMonoMode(bool mode) { monoMode = mode; } +void Dexed::setRefreshMode(bool mode) { + refreshMode = mode; +} + void Dexed::setSustain(bool s) { if (sustain == s) diff --git a/dexed.h b/dexed.h index 1f5a372..c0ac588 100644 --- a/dexed.h +++ b/dexed.h @@ -149,6 +149,7 @@ class Dexed void setEngineType(uint8_t tp); bool isMonoMode(void); void setMonoMode(bool mode); + void setRefreshMode(bool mode); void getSamples(uint16_t n_samples, int16_t* buffer); void panic(void); void notesOff(void); @@ -200,6 +201,7 @@ class Dexed int16_t currentNote; bool sustain; bool monoMode; + bool refreshMode; bool refreshVoice; uint8_t engineType; VoiceStatus voiceStatus; diff --git a/update b/update new file mode 100644 index 0000000..93490ff --- /dev/null +++ b/update @@ -0,0 +1,13 @@ +dexed.cpp: voices[i].dx7_note->update(data, voices[i].midi_note, voices[i].velocity, voices[i].porta); +dexed.cpp: voices[note].dx7_note->compute(audiobuf.get(), lfovalue, lfodelay, &controllers); +dexed.cpp: voices[note].dx7_note->update(data, voices[note].midi_note, voices[note].velocity, voices[note].porta); +dexed.cpp: voices[note].dx7_note->oscSync(); +dexed.cpp: voices[note].dx7_note->init(data, pitch, velo, srcnote, porta); +dexed.cpp: voices[note].dx7_note->oscSync(); +dexed.cpp: voices[note].dx7_note->transferSignal(*voices[i].dx7_note); +dexed.cpp: voices[note].dx7_note->transferState(*voices[i].dx7_note); +dexed.cpp: voices[target].dx7_note->transferState(*voices[note].dx7_note); +dexed.cpp: voices[note].dx7_note->keyup(); +dexed.cpp: voices[i].dx7_note->oscSync(); +dexed.cpp: voices[i].dx7_note->peekVoiceStatus(voiceStatus); +MicroDexed.ino: MicroDexed[instance_id]->voices[note].dx7_note->keyup();