From 257d2a9125760f975688631d1984d4537dbce43d Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Fri, 31 Dec 2021 11:28:58 +0100 Subject: [PATCH] Renaming of "seq.seq_*" to "seq.*" and "lcd.*" to "display.*" --- MicroDexed.ino | 94 +- UI.hpp | 3794 +++++++++++++++++++++++----------------------- dexed_sd.cpp | 124 +- midi_devices.hpp | 8 +- sequencer.cpp | 142 +- sequencer.h | 70 +- 6 files changed, 2116 insertions(+), 2116 deletions(-) diff --git a/MicroDexed.ino b/MicroDexed.ino index da2cebd..4ecc1e8 100644 --- a/MicroDexed.ino +++ b/MicroDexed.ino @@ -690,7 +690,7 @@ void setup() #ifdef USE_SEQUENCER // Start timer (to avoid a crash when loading the performance data) - sequencer_timer.begin(sequencer, seq.seq_tempo_ms / 2, false); + sequencer_timer.begin(sequencer, seq.tempo_ms / 2, false); #endif // Load initial Performance or the last used one @@ -780,7 +780,7 @@ void setup() //ep_modchorus.set_bypass(true); - strcpy(seq.seq_name, "INIT Perf"); + strcpy(seq.name, "INIT Perf"); LCDML.OTHER_jumpToFunc(UI_func_voice_select); } @@ -797,34 +797,34 @@ void loop() LCDML.loop(); #endif - if (seq.seq_running) + if (seq.running) { - if (seq.seq_step != seq_UI_last_step) + if (seq.step != seq_UI_last_step) { - seq_UI_last_step = seq.seq_step; + seq_UI_last_step = seq.step; if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_seq_pattern_editor)) //is in UI of Sequencer { - lcd.setCursor(seq.seq_step, 1); - lcd.write(124); - if (seq.seq_step == 0) + display.setCursor(seq.step, 1); + display.write(124); + if (seq.step == 0) { - lcd.setCursor(15, 1); - lcd.print(seq_find_shortname(15)[0]); + display.setCursor(15, 1); + display.print(seq_find_shortname(15)[0]); } else { - lcd.setCursor(seq.seq_step - 1, 1); - lcd.print(seq_find_shortname(seq.seq_step - 1)[0]); + display.setCursor(seq.step - 1, 1); + display.print(seq_find_shortname(seq.step - 1)[0]); } } else if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_arpeggio)) //is in UI of Arpeggiator { - lcd.setCursor(7, 0); - lcd.print( seq.seq_chord_names[seq.arp_chord][0]); - lcd.print( seq.seq_chord_names[seq.arp_chord][1]); - lcd.print( seq.seq_chord_names[seq.arp_chord][2]); - lcd.print( seq.seq_chord_names[seq.arp_chord][3]); + display.setCursor(7, 0); + display.print( seq.chord_names[seq.arp_chord][0]); + display.print( seq.chord_names[seq.arp_chord][1]); + display.print( seq.chord_names[seq.arp_chord][2]); + display.print( seq.chord_names[seq.arp_chord][3]); } } } @@ -850,29 +850,29 @@ void loop() if (midi_decay_timer > MIDI_DECAY_TIMER && midi_decay[instance_id] > 0) { midi_decay[instance_id]--; - lcd.createChar(6 + instance_id, (uint8_t*)special_chars[15 - (7 - midi_decay[instance_id])]); - lcd.setCursor(14 + instance_id, 1); - lcd.write(6 + instance_id); + display.createChar(6 + instance_id, (uint8_t*)special_chars[15 - (7 - midi_decay[instance_id])]); + display.setCursor(14 + instance_id, 1); + display.write(6 + instance_id); } else if (midi_voices[instance_id] == 0 && midi_decay[instance_id] == 0 && !MicroDexed[instance_id]->getSustain()) { midi_decay[instance_id]--; - lcd.setCursor(14 + instance_id, 1); - lcd.write(20); // blank + display.setCursor(14 + instance_id, 1); + display.write(20); // blank } #else static bool midi_playing[NUM_DEXED]; if (midi_voices[instance_id] > 0 && midi_playing[instance_id] == false) { midi_playing[instance_id] = true; - lcd.setCursor(14 + instance_id, 1); - lcd.write(6 + instance_id); + display.setCursor(14 + instance_id, 1); + display.write(6 + instance_id); } else if (midi_voices[instance_id] == 0 && !MicroDexed[instance_id]->getSustain()) { midi_playing[instance_id] = false; - lcd.setCursor(14 + instance_id, 1); - lcd.write(20); // blank + display.setCursor(14 + instance_id, 1); + display.write(20); // blank } #endif } @@ -954,7 +954,7 @@ void handleNoteOn(byte inChannel, byte inNumber, byte inVelocity) // Drum Sampler // #if NUM_DRUMS > 0 - if (activesample < 6 && seq.seq_running == false && LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_seq_pattern_editor) ) // live play pitched sample + if (activesample < 6 && seq.running == false && LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_seq_pattern_editor) ) // live play pitched sample { if (drum_counter >= NUM_DRUMS) drum_counter = 0; @@ -976,7 +976,7 @@ void handleNoteOn(byte inChannel, byte inNumber, byte inVelocity) else #endif //Ignore the note when playing & recording the same note into the sequencer - if (seq.seq_recording == false || (seq.seq_recording && inNumber != seq.seq_note_in )) + if (seq.recording == false || (seq.recording && inNumber != seq.note_in )) { // Check for MicroDexed for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) @@ -1761,8 +1761,8 @@ void handleSystemExclusive(byte * sysex, uint len) #ifdef DEBUG Serial.println(F("E: Not a SysEx bank bulk upload.")); #endif - lcd.setCursor(0, 1); - lcd.print(F("Error (TYPE) ")); + display.setCursor(0, 1); + display.print(F("Error (TYPE) ")); delay(MESSAGE_WAIT_TIME); LCDML.FUNC_goBackToMenu(); return; @@ -1777,8 +1777,8 @@ void handleSystemExclusive(byte * sysex, uint len) #ifdef DEBUG Serial.println(F("E: Wrong length for SysEx bank bulk upload (not 4096).")); #endif - lcd.setCursor(0, 1); - lcd.print(F("Error (SIZE) ")); + display.setCursor(0, 1); + display.print(F("Error (SIZE) ")); delay(MESSAGE_WAIT_TIME); LCDML.FUNC_goBackToMenu(); return; @@ -1804,8 +1804,8 @@ void handleSystemExclusive(byte * sysex, uint len) Serial.print(bulk_checksum_calc, HEX); Serial.println(F("]")); #endif - lcd.setCursor(0, 1); - lcd.print(F("Error (CHECKSUM)")); + display.setCursor(0, 1); + display.print(F("Error (CHECKSUM)")); delay(MESSAGE_WAIT_TIME); LCDML.FUNC_goBackToMenu(); return; @@ -1822,8 +1822,8 @@ void handleSystemExclusive(byte * sysex, uint len) Serial.print(receive_bank_filename); Serial.println(F("]")); #endif - lcd.setCursor(0, 1); - lcd.print(F("Done. ")); + display.setCursor(0, 1); + display.print(F("Done. ")); delay(MESSAGE_WAIT_TIME); LCDML.FUNC_goBackToMenu(); } @@ -1834,8 +1834,8 @@ void handleSystemExclusive(byte * sysex, uint len) Serial.print(receive_bank_filename); Serial.println(F("]")); #endif - lcd.setCursor(0, 1); - lcd.print(F("Error. ")); + display.setCursor(0, 1); + display.print(F("Error. ")); delay(MESSAGE_WAIT_TIME); LCDML.FUNC_goBackToMenu(); } @@ -1946,9 +1946,9 @@ void handleStart(void) midi_bpm_timer = 0; midi_bpm_counter = 0; _midi_bpm = -1; - seq.seq_step = 0; - seq.seq_chain_active_step = 0; - seq.seq_running = true; + seq.step = 0; + seq.chain_active_step = 0; + seq.running = true; #ifdef USE_SEQUENCER sequencer_timer.start(); #endif @@ -1965,11 +1965,11 @@ void handleStop(void) #ifdef USE_SEQUENCER sequencer_timer.stop(); #endif - seq.seq_running = false; - seq.seq_recording = false; - seq.seq_note_in = 0; - seq.seq_step = 0; - seq.seq_chain_active_step = 0; + seq.running = false; + seq.recording = false; + seq.note_in = 0; + seq.step = 0; + seq.chain_active_step = 0; MicroDexed[0]->panic(); #if NUM_DEXED > 1 @@ -2522,7 +2522,7 @@ void set_fx_params(void) delay_fx[instance_id]->delay(0, constrain(configuration.fx.delay_time[instance_id], DELAY_TIME_MIN, DELAY_TIME_MAX) * 10); if (configuration.fx.delay_sync[instance_id] > 0) { - uint16_t midi_sync_delay_time = uint16_t(60000.0 * midi_ticks_factor[configuration.fx.delay_sync[instance_id]] / seq.seq_bpm); + uint16_t midi_sync_delay_time = uint16_t(60000.0 * midi_ticks_factor[configuration.fx.delay_sync[instance_id]] / seq.bpm); delay_fx[instance_id]->delay(0, constrain(midi_sync_delay_time, DELAY_TIME_MIN, DELAY_TIME_MAX * 10)); } diff --git a/UI.hpp b/UI.hpp index 5282951..ef8b0cf 100644 --- a/UI.hpp +++ b/UI.hpp @@ -181,7 +181,7 @@ float temp_float; #ifdef I2C_DISPLAY #include -Disp_Plus lcd(LCD_I2C_ADDRESS, _LCDML_DISP_cols, _LCDML_DISP_rows); +Disp_Plus display(LCD_I2C_ADDRESS, _LCDML_DISP_cols, _LCDML_DISP_rows); #endif #ifdef U8X8_DISPLAY @@ -584,10 +584,10 @@ void smart_filter(uint8_t dir) if (found == false) activesample = constrain(activesample - 1, 0, NUM_DRUMSET_CONFIG - 2); for (uint8_t d = 0; d < 10; d++) { - if (seq.seq_content_type[d] == 0) { + if (seq.content_type[d] == 0) { for (uint8_t y = 0; y < 16; y++) { - if (drum_config[activesample].midinote == seq.seq_data[d][y] || drum_config[activesample].midinote == seq.seq_vel[d][y]) + if (drum_config[activesample].midinote == seq.data[d][y] || drum_config[activesample].midinote == seq.vel[d][y]) { found = true; break; @@ -607,11 +607,11 @@ void smart_filter(uint8_t dir) if (found == false) activesample = constrain(activesample + 1, 0, NUM_DRUMSET_CONFIG - 2); for (uint8_t d = 0; d < 10; d++) { - if (seq.seq_content_type[d] == 0) { + if (seq.content_type[d] == 0) { for (uint8_t y = 0; y < 16; y++) { - if (drum_config[activesample].midinote == seq.seq_data[d][y] || drum_config[activesample].midinote == seq.seq_vel[d][y]) + if (drum_config[activesample].midinote == seq.data[d][y] || drum_config[activesample].midinote == seq.vel[d][y]) { found = true; break; @@ -630,19 +630,19 @@ void setup_ui(void) { // LCD Begin #ifdef I2C_DISPLAY - lcd.init(); - lcd.backlight(); - lcd.clear(); - lcd.noCursor(); + display.init(); + display.backlight(); + display.clear(); + display.noCursor(); #else - lcd.begin(); - lcd.clear(); - lcd.setFont(u8x8_font_amstrad_cpc_extended_f); + display.begin(); + display.clear(); + display.setFont(u8x8_font_amstrad_cpc_extended_f); #endif - lcd.setCursor(3, 0); - lcd.print(F("MicroDexed")); - lcd.setCursor(0, 1); - lcd.print(F("(c)parasiTstudio")); + display.setCursor(3, 0); + display.print(F("MicroDexed")); + display.setCursor(0, 1); + display.print(F("(c)parasiTstudio")); lcd_special_chars(SCROLLBAR); // LCDMenuLib Setup @@ -653,25 +653,25 @@ void setup_ui(void) void setup_debug_message(void) { // LCD Begin - lcd.clear(); - lcd.setCursor(1, 0); - lcd.print(F("* DEBUG MODE *")); - lcd.setCursor(1, 1); - lcd.print(F("ENABLE CONSOLE")); + display.clear(); + display.setCursor(1, 0); + display.print(F("* DEBUG MODE *")); + display.setCursor(1, 1); + display.print(F("ENABLE CONSOLE")); delay(300); - lcd.setCursor(1, 1); - lcd.print(_LCDML_VERSION); - lcd.print(F(" ")); + display.setCursor(1, 1); + display.print(_LCDML_VERSION); + display.print(F(" ")); } #endif void toggle_sequencer_play_status() { - if (seq.seq_running == false && seq.seq_recording == false) + if (seq.running == false && seq.recording == false) { handleStart(); } - else if (seq.seq_running == true && seq.seq_recording == false) + else if (seq.running == true && seq.recording == false) { handleStop(); } @@ -812,11 +812,11 @@ void lcdml_menu_control(void) #endif encoderDir[ENC_R].ButtonLong(true); - // if (seq.seq_running) { - // seq.seq_running = false; - // seq.seq_recording = false; - // seq.seq_step = 0; - // seq.seq_chain_active_step = 0; + // if (seq.running) { + // seq.running = false; + // seq.recording = false; + // seq.step = 0; + // seq.chain_active_step = 0; // MicroDexed[0]->panic(); // } @@ -974,8 +974,8 @@ void lcdml_menu_control(void) ***********************************************************************/ void lcdml_menu_clear(void) { - lcd.clear(); - lcd.setCursor(0, 0); + display.clear(); + display.setCursor(0, 0); } void lcdml_menu_display(void) @@ -1012,8 +1012,8 @@ void lcdml_menu_display(void) { // display normal content LCDML_getContent(content_text, tmp->getID()); - lcd.setCursor(1, n); - lcd.print(content_text); + display.setCursor(1, n); + display.print(content_text); } else { @@ -1043,29 +1043,29 @@ void lcdml_menu_display(void) for (uint8_t n = 0; n < n_max; n++) { //set cursor - lcd.setCursor(0, n); + display.setCursor(0, n); //set cursor char if (n == LCDML.MENU_getCursorPos()) { - lcd.write(_LCDML_DISP_cfg_cursor); + display.write(_LCDML_DISP_cfg_cursor); } else { - lcd.write(' '); + display.write(' '); } // delete or reset scrollbar if (_LCDML_DISP_cfg_scrollbar == 1) { if (scrollbar_max > n_max) { #ifdef I2C_DISPLAY - lcd.setCursor((_LCDML_DISP_cols - 1), n); - lcd.write((uint8_t)0); + display.setCursor((_LCDML_DISP_cols - 1), n); + display.write((uint8_t)0); #else - lcd.drawTile((_LCDML_DISP_cols - 1), n, 1, flipped_scroll_bar[0]); - lcd.setCursor((_LCDML_DISP_cols), n + 1); + display.drawTile((_LCDML_DISP_cols - 1), n, 1, flipped_scroll_bar[0]); + display.setCursor((_LCDML_DISP_cols), n + 1); #endif } else { - lcd.setCursor((_LCDML_DISP_cols - 1), n); - lcd.print(F(" ")); + display.setCursor((_LCDML_DISP_cols - 1), n); + display.print(F(" ")); } } } @@ -1077,29 +1077,29 @@ void lcdml_menu_display(void) if (scrollbar_cur_pos == scrollbar_min) { // min pos #ifdef I2C_DISPLAY - lcd.setCursor((_LCDML_DISP_cols - 1), 0); - lcd.write((uint8_t)1); + display.setCursor((_LCDML_DISP_cols - 1), 0); + display.write((uint8_t)1); #else - lcd.drawTile((_LCDML_DISP_cols - 1), 0, 1, flipped_scroll_bar[1]); - lcd.setCursor((_LCDML_DISP_cols), 1); + display.drawTile((_LCDML_DISP_cols - 1), 0, 1, flipped_scroll_bar[1]); + display.setCursor((_LCDML_DISP_cols), 1); #endif } else if (scrollbar_cur_pos == (scrollbar_max - 1)) { // max pos #ifdef I2C_DISPLAY - lcd.setCursor((_LCDML_DISP_cols - 1), (n_max - 1)); - lcd.write((uint8_t)4); + display.setCursor((_LCDML_DISP_cols - 1), (n_max - 1)); + display.write((uint8_t)4); #else - lcd.drawTile((_LCDML_DISP_cols - 1), (n_max - 1), 1, flipped_scroll_bar[4]); - lcd.setCursor((_LCDML_DISP_cols), (n_max)); + display.drawTile((_LCDML_DISP_cols - 1), (n_max - 1), 1, flipped_scroll_bar[4]); + display.setCursor((_LCDML_DISP_cols), (n_max)); #endif } else { // between #ifdef I2C_DISPLAY - lcd.setCursor((_LCDML_DISP_cols - 1), scroll_pos / n_max); - lcd.write((uint8_t)(scroll_pos % n_max) + 1); + display.setCursor((_LCDML_DISP_cols - 1), scroll_pos / n_max); + display.write((uint8_t)(scroll_pos % n_max) + 1); #else - lcd.drawTile((_LCDML_DISP_cols - 1), scroll_pos / n_max, 1, flipped_scroll_bar[(scroll_pos % n_max) + 1]); - lcd.setCursor((_LCDML_DISP_cols), (scroll_pos / n_max) + 1); + display.drawTile((_LCDML_DISP_cols - 1), scroll_pos / n_max, 1, flipped_scroll_bar[(scroll_pos % n_max) + 1]); + display.setCursor((_LCDML_DISP_cols), (scroll_pos / n_max) + 1); #endif } } @@ -1394,8 +1394,8 @@ void UI_func_chorus_waveform(uint8_t param) { encoderDir[ENC_R].reset(); - lcd.setCursor(0, 0); - lcd.print(F("Chorus Wavefrm")); + display.setCursor(0, 0); + display.print(F("Chorus Wavefrm")); lcd_active_instance_number(selected_instance_id); UI_update_instance_icons(); @@ -1416,20 +1416,20 @@ void UI_func_chorus_waveform(uint8_t param) } #endif - lcd.setCursor(0, 1); + display.setCursor(0, 1); switch (configuration.fx.chorus_waveform[selected_instance_id]) { case 0: chorus_modulator[selected_instance_id]->begin(WAVEFORM_TRIANGLE); - lcd.print(F("[TRIANGLE]")); + display.print(F("[TRIANGLE]")); break; case 1: chorus_modulator[selected_instance_id]->begin(WAVEFORM_SINE); - lcd.print(F("[SINE ]")); + display.print(F("[SINE ]")); break; default: chorus_modulator[selected_instance_id]->begin(WAVEFORM_TRIANGLE); - lcd.print(F("[TRIANGLE]")); + display.print(F("[TRIANGLE]")); break; } } @@ -1977,8 +1977,8 @@ void UI_func_midi_channel(uint8_t param) { encoderDir[ENC_R].reset(); - lcd.setCursor(0, 0); - lcd.print(F("MIDI Channel")); + display.setCursor(0, 0); + display.print(F("MIDI Channel")); lcd_active_instance_number(selected_instance_id); UI_update_instance_icons(); @@ -1999,10 +1999,10 @@ void UI_func_midi_channel(uint8_t param) } #endif - lcd.setCursor(0, 1); + display.setCursor(0, 1); if (configuration.dexed[selected_instance_id].midi_channel == 0) { - lcd.print(F("[OMNI]")); + display.print(F("[OMNI]")); } else { @@ -2035,12 +2035,12 @@ void UI_func_lowest_note(uint8_t param) encoderDir[ENC_R].reset(); getNoteName(note_name, configuration.dexed[selected_instance_id].lowest_note); - lcd.setCursor(0, 0); - lcd.print(F("Lowest Note")); - lcd.setCursor(0, 1); - lcd.print(F("[")); - lcd.print(note_name); - lcd.print(F("]")); + display.setCursor(0, 0); + display.print(F("Lowest Note")); + display.setCursor(0, 1); + display.print(F("[")); + display.print(note_name); + display.print(F("]")); lcd_active_instance_number(selected_instance_id); UI_update_instance_icons(); @@ -2065,8 +2065,8 @@ void UI_func_lowest_note(uint8_t param) } getNoteName(note_name, configuration.dexed[selected_instance_id].lowest_note); - lcd.setCursor(1, 1); - lcd.print(note_name); + display.setCursor(1, 1); + display.print(note_name); } if (LCDML.FUNC_close()) // ****** STABLE END ********* @@ -2085,12 +2085,12 @@ void UI_func_highest_note(uint8_t param) encoderDir[ENC_R].reset(); getNoteName(note_name, configuration.dexed[selected_instance_id].highest_note); - lcd.setCursor(0, 0); - lcd.print(F("Highest Note")); - lcd.setCursor(0, 1); - lcd.print(F("[")); - lcd.print(note_name); - lcd.print(F("]")); + display.setCursor(0, 0); + display.print(F("Highest Note")); + display.setCursor(0, 1); + display.print(F("[")); + display.print(note_name); + display.print(F("]")); lcd_active_instance_number(selected_instance_id); UI_update_instance_icons(); @@ -2115,8 +2115,8 @@ void UI_func_highest_note(uint8_t param) } getNoteName(note_name, configuration.dexed[selected_instance_id].highest_note); - lcd.setCursor(1, 1); - lcd.print(note_name); + display.setCursor(1, 1); + display.print(note_name); } if (LCDML.FUNC_close()) // ****** STABLE END ********* @@ -2185,10 +2185,10 @@ void UI_func_panorama(uint8_t param) if (configuration.sys.mono > 0) { - lcd.setCursor(0, 0); - lcd.print(F("Panorama")); - lcd.setCursor(0, 1); - lcd.print(F("MONO-disabled")); + display.setCursor(0, 0); + display.print(F("Panorama")); + display.setCursor(0, 1); + display.print(F("MONO-disabled")); return; } lcd_special_chars(METERBAR); @@ -2242,22 +2242,22 @@ void UI_func_favorites(uint8_t param) encoderDir[ENC_L].reset(); old_favorites = configuration.sys.favorites; - lcd.setCursor(0, 0); - lcd.print(F("Favorites")); - lcd.setCursor(0, 1); + display.setCursor(0, 0); + display.print(F("Favorites")); + display.setCursor(0, 1); switch (configuration.sys.favorites) { case 0: - lcd.print(F("[ All presets ]")); + display.print(F("[ All presets ]")); break; case 1: - lcd.print(F("[ FAVs. only ]")); + display.print(F("[ FAVs. only ]")); break; case 2: - lcd.print(F("[non-FAVs. only]")); + display.print(F("[non-FAVs. only]")); break; case 3: - lcd.print(F("[random non-FAV]")); + display.print(F("[random non-FAV]")); break; } } @@ -2269,20 +2269,20 @@ void UI_func_favorites(uint8_t param) else if (LCDML.BT_checkUp()) configuration.sys.favorites = constrain(configuration.sys.favorites - 1, 0, 3); - lcd.setCursor(0, 1); + display.setCursor(0, 1); switch (configuration.sys.favorites) { case 0: - lcd.print(F("[ All presets ]")); + display.print(F("[ All presets ]")); break; case 1: - lcd.print(F("[ FAVs. only ]")); + display.print(F("[ FAVs. only ]")); break; case 2: - lcd.print(F("[non-FAVs. only]")); + display.print(F("[non-FAVs. only]")); break; case 3: - lcd.print(F("[random non-FAV]")); + display.print(F("[random non-FAV]")); break; } } @@ -2305,8 +2305,8 @@ void UI_func_epiano_midi_channel(uint8_t param) { encoderDir[ENC_R].reset(); - lcd.setCursor(0, 0); - lcd.print(F("EP MIDI Channel")); + display.setCursor(0, 0); + display.print(F("EP MIDI Channel")); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -2316,10 +2316,10 @@ void UI_func_epiano_midi_channel(uint8_t param) else if (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) configuration.epiano.midi_channel = constrain(configuration.epiano.midi_channel - ENCODER[ENC_R].speed(), EP_MIDI_CHANNEL_MIN, EP_MIDI_CHANNEL_MAX); - lcd.setCursor(0, 1); + display.setCursor(0, 1); if (configuration.epiano.midi_channel == 0) { - lcd.print(F("[OMNI]")); + display.print(F("[OMNI]")); } else { @@ -2343,12 +2343,12 @@ void UI_func_epiano_lowest_note(uint8_t param) encoderDir[ENC_R].reset(); getNoteName(note_name, configuration.epiano.lowest_note); - lcd.setCursor(0, 0); - lcd.print(F("EP Lowest Note")); - lcd.setCursor(0, 1); - lcd.print(F("[")); - lcd.print(note_name); - lcd.print(F("]")); + display.setCursor(0, 0); + display.print(F("EP Lowest Note")); + display.setCursor(0, 1); + display.print(F("[")); + display.print(note_name); + display.print(F("]")); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -2362,8 +2362,8 @@ void UI_func_epiano_lowest_note(uint8_t param) } getNoteName(note_name, configuration.epiano.lowest_note); - lcd.setCursor(1, 1); - lcd.print(note_name); + display.setCursor(1, 1); + display.print(note_name); } if (LCDML.FUNC_close()) // ****** STABLE END ********* @@ -2382,12 +2382,12 @@ void UI_func_epiano_highest_note(uint8_t param) encoderDir[ENC_R].reset(); getNoteName(note_name, configuration.dexed[selected_instance_id].highest_note); - lcd.setCursor(0, 0); - lcd.print(F("EP Highest Note")); - lcd.setCursor(0, 1); - lcd.print(F("[")); - lcd.print(note_name); - lcd.print(F("]")); + display.setCursor(0, 0); + display.print(F("EP Highest Note")); + display.setCursor(0, 1); + display.print(F("[")); + display.print(note_name); + display.print(F("]")); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -2401,8 +2401,8 @@ void UI_func_epiano_highest_note(uint8_t param) } getNoteName(note_name, configuration.epiano.highest_note); - lcd.setCursor(1, 1); - lcd.print(note_name); + display.setCursor(1, 1); + display.print(note_name); } if (LCDML.FUNC_close()) // ****** STABLE END ********* @@ -2422,8 +2422,8 @@ void UI_func_epiano_sound_intensity(uint8_t param) #if defined(USE_EPIANO) lcd_display_bar_int("EP Level", configuration.epiano.sound_intensity, 1.0, EP_SOUND_INTENSITY_MIN, EP_SOUND_INTENSITY_MAX, 3, false, false, true); #else - lcd.clear(); - lcd.print("EP Disabled"); + display.clear(); + display.print("EP Disabled"); #endif } @@ -2466,10 +2466,10 @@ void UI_func_epiano_panorama(uint8_t param) if (configuration.sys.mono > 0) { - lcd.setCursor(0, 0); - lcd.print(F("EP Panorama")); - lcd.setCursor(0, 1); - lcd.print(F("MONO-disabled")); + display.setCursor(0, 0); + display.print(F("EP Panorama")); + display.setCursor(0, 1); + display.print(F("MONO-disabled")); return; } @@ -3090,8 +3090,8 @@ void UI_func_epiano_chorus_waveform(uint8_t param) { encoderDir[ENC_R].reset(); - lcd.setCursor(0, 0); - lcd.print(F("EP Ch. Wavefrm")); + display.setCursor(0, 0); + display.print(F("EP Ch. Wavefrm")); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -3101,26 +3101,26 @@ void UI_func_epiano_chorus_waveform(uint8_t param) else if (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) configuration.fx.ep_chorus_waveform = constrain(configuration.fx.ep_chorus_waveform - 1, EP_CHORUS_WAVEFORM_MIN, EP_CHORUS_WAVEFORM_MAX); - lcd.setCursor(0, 1); + display.setCursor(0, 1); switch (configuration.fx.ep_chorus_waveform) { case 0: #if defined(USE_EPIANO) ep_chorus_modulator.begin(WAVEFORM_TRIANGLE); #endif - lcd.print(F("[TRIANGLE]")); + display.print(F("[TRIANGLE]")); break; case 1: #if defined(USE_EPIANO) ep_chorus_modulator.begin(WAVEFORM_SINE); #endif - lcd.print(F("[SINE ]")); + display.print(F("[SINE ]")); break; default: #if defined(USE_EPIANO) ep_chorus_modulator.begin(WAVEFORM_TRIANGLE); #endif - lcd.print(F("[TRIANGLE]")); + display.print(F("[TRIANGLE]")); break; } } @@ -3214,25 +3214,25 @@ void UI_func_stereo_mono(uint8_t param) encoderDir[ENC_R].reset(); old_mono = configuration.sys.mono; - lcd.setCursor(0, 0); - lcd.print(F("Stereo/Mono")); - lcd.setCursor(0, 1); + display.setCursor(0, 0); + display.print(F("Stereo/Mono")); + display.setCursor(0, 1); switch (configuration.sys.mono) { case 0: - lcd.print(F("[STEREO]")); + display.print(F("[STEREO]")); stereo2mono.stereo(true); break; case 1: - lcd.print(F("[MONO ]")); + display.print(F("[MONO ]")); stereo2mono.stereo(false); break; case 2: - lcd.print(F("[MONO-R]")); + display.print(F("[MONO-R]")); stereo2mono.stereo(false); break; case 3: - lcd.print(F("[MONO-L]")); + display.print(F("[MONO-L]")); stereo2mono.stereo(false); break; } @@ -3245,23 +3245,23 @@ void UI_func_stereo_mono(uint8_t param) else if (LCDML.BT_checkUp()) configuration.sys.mono = constrain(configuration.sys.mono - 1, MONO_MIN, MONO_MAX); - lcd.setCursor(0, 1); + display.setCursor(0, 1); switch (configuration.sys.mono) { case 0: - lcd.print(F("[STEREO]")); + display.print(F("[STEREO]")); stereo2mono.stereo(true); break; case 1: - lcd.print(F("[MONO ]")); + display.print(F("[MONO ]")); stereo2mono.stereo(false); break; case 2: - lcd.print(F("[MONO-R]")); + display.print(F("[MONO-R]")); stereo2mono.stereo(false); break; case 3: - lcd.print(F("[MONO-L]")); + display.print(F("[MONO-L]")); stereo2mono.stereo(false); break; } @@ -3355,8 +3355,8 @@ void UI_func_mono_poly(uint8_t param) { encoderDir[ENC_R].reset(); - lcd.setCursor(0, 0); - lcd.print(F("Mono/Poly")); + display.setCursor(0, 0); + display.print(F("Mono/Poly")); lcd_active_instance_number(selected_instance_id); UI_update_instance_icons(); @@ -3385,14 +3385,14 @@ void UI_func_mono_poly(uint8_t param) #endif } - lcd.setCursor(0, 1); + display.setCursor(0, 1); switch (configuration.dexed[selected_instance_id].monopoly) { case 1: - lcd.print(F("[MONOPHONIC]")); + display.print(F("[MONOPHONIC]")); break; case 0: - lcd.print(F("[POLYPHONIC]")); + display.print(F("[POLYPHONIC]")); break; } @@ -3409,8 +3409,8 @@ void UI_func_note_refresh(uint8_t param) { encoderDir[ENC_R].reset(); - lcd.setCursor(0, 0); - lcd.print(F("Note Refresh")); + display.setCursor(0, 0); + display.print(F("Note Refresh")); lcd_active_instance_number(selected_instance_id); UI_update_instance_icons(); @@ -3436,14 +3436,14 @@ void UI_func_note_refresh(uint8_t param) MicroDexed[selected_instance_id]->setRefreshMode(configuration.dexed[selected_instance_id].note_refresh); - lcd.setCursor(0, 1); + display.setCursor(0, 1); switch (configuration.dexed[selected_instance_id].note_refresh) { case 0: - lcd.print(F("[NORMAL ]")); + display.print(F("[NORMAL ]")); break; case 1: - lcd.print(F("[RETRIGGERED]")); + display.print(F("[RETRIGGERED]")); break; } } @@ -3593,8 +3593,8 @@ void UI_func_mw_assign(uint8_t param) { encoderDir[ENC_R].reset(); - lcd.setCursor(0, 0); - lcd.print(F("MW Assign")); + display.setCursor(0, 0); + display.print(F("MW Assign")); lcd_active_instance_number(selected_instance_id); UI_update_instance_icons(); @@ -3621,32 +3621,32 @@ void UI_func_mw_assign(uint8_t param) MicroDexed[selected_instance_id]->setMWController(configuration.dexed[selected_instance_id].mw_range, configuration.dexed[selected_instance_id].mw_assign, configuration.dexed[selected_instance_id].mw_mode); send_sysex_param(configuration.dexed[selected_instance_id].midi_channel, 71, configuration.dexed[selected_instance_id].mw_assign, 2); - lcd.setCursor(0, 1); + display.setCursor(0, 1); switch (configuration.dexed[selected_instance_id].mw_assign) { case 0: - lcd.print(F("[ NONE ]")); + display.print(F("[ NONE ]")); break; case 1: - lcd.print(F("[PTCH ]")); + display.print(F("[PTCH ]")); break; case 2: - lcd.print(F("[ AMP ]")); + display.print(F("[ AMP ]")); break; case 3: - lcd.print(F("[PTCH AMP ]")); + display.print(F("[PTCH AMP ]")); break; case 4: - lcd.print(F("[ EG]")); + display.print(F("[ EG]")); break; case 5: - lcd.print(F("[PTCH EG]")); + display.print(F("[PTCH EG]")); break; case 6: - lcd.print(F("[ AMP EG]")); + display.print(F("[ AMP EG]")); break; case 7: - lcd.print(F("[PTCH AMP EG]")); + display.print(F("[PTCH AMP EG]")); break; } } @@ -3664,8 +3664,8 @@ void UI_func_mw_mode(uint8_t param) { encoderDir[ENC_R].reset(); - lcd.setCursor(0, 0); - lcd.print(F("MW Mode")); + display.setCursor(0, 0); + display.print(F("MW Mode")); lcd_active_instance_number(selected_instance_id); UI_update_instance_icons(); @@ -3692,17 +3692,17 @@ void UI_func_mw_mode(uint8_t param) MicroDexed[selected_instance_id]->setMWController(configuration.dexed[selected_instance_id].mw_range, configuration.dexed[selected_instance_id].mw_assign, configuration.dexed[selected_instance_id].mw_mode); MicroDexed[selected_instance_id]->ControllersRefresh(); - lcd.setCursor(0, 1); + display.setCursor(0, 1); switch (configuration.dexed[selected_instance_id].mw_mode) { case 0: - lcd.print(F("[LINEAR ]")); + display.print(F("[LINEAR ]")); break; case 1: - lcd.print(F("[REVERSE LIN.]")); + display.print(F("[REVERSE LIN.]")); break; case 2: - lcd.print(F("[DIRECT ]")); + display.print(F("[DIRECT ]")); break; } } @@ -3764,8 +3764,8 @@ void UI_func_fc_assign(uint8_t param) { encoderDir[ENC_R].reset(); - lcd.setCursor(0, 0); - lcd.print(F("FC Assign")); + display.setCursor(0, 0); + display.print(F("FC Assign")); lcd_active_instance_number(selected_instance_id); UI_update_instance_icons(); @@ -3792,32 +3792,32 @@ void UI_func_fc_assign(uint8_t param) MicroDexed[selected_instance_id]->setFCController(configuration.dexed[selected_instance_id].fc_range, configuration.dexed[selected_instance_id].fc_assign, configuration.dexed[selected_instance_id].fc_mode); send_sysex_param(configuration.dexed[selected_instance_id].midi_channel, 73, configuration.dexed[selected_instance_id].fc_assign, 2); - lcd.setCursor(0, 1); + display.setCursor(0, 1); switch (configuration.dexed[selected_instance_id].fc_assign) { case 0: - lcd.print(F("[ NONE ]")); + display.print(F("[ NONE ]")); break; case 1: - lcd.print(F("[PTCH ]")); + display.print(F("[PTCH ]")); break; case 2: - lcd.print(F("[ AMP ]")); + display.print(F("[ AMP ]")); break; case 3: - lcd.print(F("[PTCH AMP ]")); + display.print(F("[PTCH AMP ]")); break; case 4: - lcd.print(F("[ EG]")); + display.print(F("[ EG]")); break; case 5: - lcd.print(F("[PTCH EG]")); + display.print(F("[PTCH EG]")); break; case 6: - lcd.print(F("[ AMP EG]")); + display.print(F("[ AMP EG]")); break; case 7: - lcd.print(F("[PTCH AMP EG]")); + display.print(F("[PTCH AMP EG]")); break; } } @@ -3835,8 +3835,8 @@ void UI_func_fc_mode(uint8_t param) { encoderDir[ENC_R].reset(); - lcd.setCursor(0, 0); - lcd.print(F("FC Mode")); + display.setCursor(0, 0); + display.print(F("FC Mode")); lcd_active_instance_number(selected_instance_id); UI_update_instance_icons(); @@ -3863,17 +3863,17 @@ void UI_func_fc_mode(uint8_t param) MicroDexed[selected_instance_id]->setFCController(configuration.dexed[selected_instance_id].fc_range, configuration.dexed[selected_instance_id].fc_assign, configuration.dexed[selected_instance_id].fc_mode); MicroDexed[selected_instance_id]->ControllersRefresh(); - lcd.setCursor(0, 1); + display.setCursor(0, 1); switch (configuration.dexed[selected_instance_id].fc_mode) { case 0: - lcd.print(F("[LINEAR ]")); + display.print(F("[LINEAR ]")); break; case 1: - lcd.print(F("[REVERSE LIN.]")); + display.print(F("[REVERSE LIN.]")); break; case 2: - lcd.print(F("[DIRECT ]")); + display.print(F("[DIRECT ]")); break; } } @@ -3935,8 +3935,8 @@ void UI_func_bc_assign(uint8_t param) { encoderDir[ENC_R].reset(); - lcd.setCursor(0, 0); - lcd.print(F("BC Assign")); + display.setCursor(0, 0); + display.print(F("BC Assign")); lcd_active_instance_number(selected_instance_id); UI_update_instance_icons(); @@ -3963,32 +3963,32 @@ void UI_func_bc_assign(uint8_t param) MicroDexed[selected_instance_id]->setBCController(configuration.dexed[selected_instance_id].bc_range, configuration.dexed[selected_instance_id].bc_assign, configuration.dexed[selected_instance_id].bc_mode); send_sysex_param(configuration.dexed[selected_instance_id].midi_channel, 75, configuration.dexed[selected_instance_id].bc_assign, 2); - lcd.setCursor(0, 1); + display.setCursor(0, 1); switch (configuration.dexed[selected_instance_id].bc_assign) { case 0: - lcd.print(F("[ NONE ]")); + display.print(F("[ NONE ]")); break; case 1: - lcd.print(F("[PTCH ]")); + display.print(F("[PTCH ]")); break; case 2: - lcd.print(F("[ AMP ]")); + display.print(F("[ AMP ]")); break; case 3: - lcd.print(F("[PTCH AMP ]")); + display.print(F("[PTCH AMP ]")); break; case 4: - lcd.print(F("[ EG]")); + display.print(F("[ EG]")); break; case 5: - lcd.print(F("[PTCH EG]")); + display.print(F("[PTCH EG]")); break; case 6: - lcd.print(F("[ AMP EG]")); + display.print(F("[ AMP EG]")); break; case 7: - lcd.print(F("[PTCH AMP EG]")); + display.print(F("[PTCH AMP EG]")); break; } } @@ -4006,8 +4006,8 @@ void UI_func_bc_mode(uint8_t param) { encoderDir[ENC_R].reset(); - lcd.setCursor(0, 0); - lcd.print(F("BC Mode")); + display.setCursor(0, 0); + display.print(F("BC Mode")); lcd_active_instance_number(selected_instance_id); UI_update_instance_icons(); @@ -4034,17 +4034,17 @@ void UI_func_bc_mode(uint8_t param) MicroDexed[selected_instance_id]->setBCController(configuration.dexed[selected_instance_id].bc_range, configuration.dexed[selected_instance_id].bc_assign, configuration.dexed[selected_instance_id].bc_mode); MicroDexed[selected_instance_id]->ControllersRefresh(); - lcd.setCursor(0, 1); + display.setCursor(0, 1); switch (configuration.dexed[selected_instance_id].bc_mode) { case 0: - lcd.print(F("[LINEAR ]")); + display.print(F("[LINEAR ]")); break; case 1: - lcd.print(F("[REVERSE LIN.]")); + display.print(F("[REVERSE LIN.]")); break; case 2: - lcd.print(F("[DIRECT ]")); + display.print(F("[DIRECT ]")); break; } } @@ -4106,8 +4106,8 @@ void UI_func_at_assign(uint8_t param) { encoderDir[ENC_R].reset(); - lcd.setCursor(0, 0); - lcd.print(F("AT Assign")); + display.setCursor(0, 0); + display.print(F("AT Assign")); lcd_active_instance_number(selected_instance_id); UI_update_instance_icons(); @@ -4134,32 +4134,32 @@ void UI_func_at_assign(uint8_t param) MicroDexed[selected_instance_id]->setATController(configuration.dexed[selected_instance_id].at_range, configuration.dexed[selected_instance_id].at_assign, configuration.dexed[selected_instance_id].at_mode); send_sysex_param(configuration.dexed[selected_instance_id].midi_channel, 77, configuration.dexed[selected_instance_id].at_assign, 2); - lcd.setCursor(0, 1); + display.setCursor(0, 1); switch (configuration.dexed[selected_instance_id].at_assign) { case 0: - lcd.print(F("[ NONE ]")); + display.print(F("[ NONE ]")); break; case 1: - lcd.print(F("[PTCH ]")); + display.print(F("[PTCH ]")); break; case 2: - lcd.print(F("[ AMP ]")); + display.print(F("[ AMP ]")); break; case 3: - lcd.print(F("[PTCH AMP ]")); + display.print(F("[PTCH AMP ]")); break; case 4: - lcd.print(F("[ EG]")); + display.print(F("[ EG]")); break; case 5: - lcd.print(F("[PTCH EG]")); + display.print(F("[PTCH EG]")); break; case 6: - lcd.print(F("[ AMP EG]")); + display.print(F("[ AMP EG]")); break; case 7: - lcd.print(F("[PTCH AMP EG]")); + display.print(F("[PTCH AMP EG]")); break; } } @@ -4177,8 +4177,8 @@ void UI_func_at_mode(uint8_t param) { encoderDir[ENC_R].reset(); - lcd.setCursor(0, 0); - lcd.print(F("AT Mode")); + display.setCursor(0, 0); + display.print(F("AT Mode")); lcd_active_instance_number(selected_instance_id); UI_update_instance_icons(); @@ -4205,17 +4205,17 @@ void UI_func_at_mode(uint8_t param) MicroDexed[selected_instance_id]->setATController(configuration.dexed[selected_instance_id].at_range, configuration.dexed[selected_instance_id].at_assign, configuration.dexed[selected_instance_id].at_mode); MicroDexed[selected_instance_id]->ControllersRefresh(); - lcd.setCursor(0, 1); + display.setCursor(0, 1); switch (configuration.dexed[selected_instance_id].at_mode) { case 0: - lcd.print(F("[LINEAR ]")); + display.print(F("[LINEAR ]")); break; case 1: - lcd.print(F("[REVERSE LIN.]")); + display.print(F("[REVERSE LIN.]")); break; case 2: - lcd.print(F("[DIRECT ]")); + display.print(F("[DIRECT ]")); break; } } @@ -4233,8 +4233,8 @@ void UI_func_portamento_mode(uint8_t param) { encoderDir[ENC_R].reset(); - lcd.setCursor(0, 0); - lcd.print(F("Port. Mode")); + display.setCursor(0, 0); + display.print(F("Port. Mode")); lcd_active_instance_number(selected_instance_id); UI_update_instance_icons(); @@ -4261,20 +4261,20 @@ void UI_func_portamento_mode(uint8_t param) MicroDexed[selected_instance_id]->setPortamentoMode(configuration.dexed[selected_instance_id].portamento_mode, configuration.dexed[selected_instance_id].portamento_glissando, configuration.dexed[selected_instance_id].portamento_time); send_sysex_param(configuration.dexed[selected_instance_id].midi_channel, 67, configuration.dexed[selected_instance_id].portamento_mode, 2); - lcd.setCursor(0, 1); + display.setCursor(0, 1); switch (configuration.dexed[selected_instance_id].portamento_mode) { case 0: if (configuration.dexed[selected_instance_id].monopoly == 1) - lcd.print(F("[RETAIN ]")); + display.print(F("[RETAIN ]")); else - lcd.print(F("[FINGERED]")); + display.print(F("[FINGERED]")); break; case 1: if (configuration.dexed[selected_instance_id].monopoly == 1) - lcd.print(F("[FOLLOW ]")); + display.print(F("[FOLLOW ]")); else - lcd.print(F("[FULL ]")); + display.print(F("[FULL ]")); break; } } @@ -4292,8 +4292,8 @@ void UI_func_portamento_glissando(uint8_t param) { encoderDir[ENC_R].reset(); - lcd.setCursor(0, 0); - lcd.print(F("Port. Gliss.")); + display.setCursor(0, 0); + display.print(F("Port. Gliss.")); lcd_active_instance_number(selected_instance_id); UI_update_instance_icons(); @@ -4320,14 +4320,14 @@ void UI_func_portamento_glissando(uint8_t param) MicroDexed[selected_instance_id]->setPortamentoMode(configuration.dexed[selected_instance_id].portamento_mode, configuration.dexed[selected_instance_id].portamento_glissando, configuration.dexed[selected_instance_id].portamento_time); send_sysex_param(configuration.dexed[selected_instance_id].midi_channel, 68, configuration.dexed[selected_instance_id].portamento_glissando, 2); - lcd.setCursor(0, 1); + display.setCursor(0, 1); switch (configuration.dexed[selected_instance_id].portamento_glissando) { case 0: - lcd.print(F("[OFF]")); + display.print(F("[OFF]")); break; case 1: - lcd.print(F("[ON ]")); + display.print(F("[ON ]")); break; } } @@ -4393,16 +4393,16 @@ void UI_handle_OP(uint8_t param) { encoderDir[ENC_R].reset(); - lcd.setCursor(0, 0); - lcd.print(F("OP Enable")); - lcd.setCursor(0, 1); + display.setCursor(0, 0); + display.print(F("OP Enable")); + display.setCursor(0, 1); for (uint8_t i = 2; i < 8; i++) - lcd.write(i); + display.write(i); UI_update_instance_icons(); - lcd.setCursor(op_selected, 1); - lcd.blink(); + display.setCursor(op_selected, 1); + display.blink(); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -4443,7 +4443,7 @@ void UI_handle_OP(uint8_t param) lcd_OP_active_instance_number(selected_instance_id, configuration.dexed[selected_instance_id].op_enabled); } - lcd.setCursor(op_selected, 1); + display.setCursor(op_selected, 1); MicroDexed[selected_instance_id]->setOPAll(configuration.dexed[selected_instance_id].op_enabled); MicroDexed[selected_instance_id]->doRefreshVoice(); @@ -4452,8 +4452,8 @@ void UI_handle_OP(uint8_t param) if (LCDML.FUNC_close()) // ****** STABLE END ********* { - lcd.noBlink(); - lcd.noCursor(); + display.noBlink(); + display.noCursor(); lcd_special_chars(SCROLLBAR); encoderDir[ENC_R].reset(); } @@ -4466,12 +4466,12 @@ void UI_func_drum_reverb_send(uint8_t param) { encoderDir[ENC_R].reset(); temp_int = (int)(drum_config[activesample].reverb_send * 100); - lcd.setCursor(0, 0); - lcd.print("Drum Rev. Send"); - lcd.setCursor(1, 1); + display.setCursor(0, 0); + display.print("Drum Rev. Send"); + display.setCursor(1, 1); sprintf(displayname, "%02d", activesample); - lcd.print(displayname); - lcd.show(4, 5, 6, basename(drum_config[activesample].name)); + display.print(displayname); + display.show(4, 5, 6, basename(drum_config[activesample].name)); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { @@ -4512,33 +4512,33 @@ void UI_func_drum_reverb_send(uint8_t param) } } if (menu_select_toggle == false) { - lcd.setCursor(11, 1); - lcd.print(" "); - lcd.setCursor(15, 1); - lcd.print(" "); - lcd.setCursor(0, 1); - lcd.print("["); - lcd.setCursor(3, 1); - lcd.print("]"); - lcd.setCursor(1, 1); + display.setCursor(11, 1); + display.print(" "); + display.setCursor(15, 1); + display.print(" "); + display.setCursor(0, 1); + display.print("["); + display.setCursor(3, 1); + display.print("]"); + display.setCursor(1, 1); sprintf(displayname, "%02d", activesample); - lcd.print(displayname); - lcd.show(4, 5, 6, basename(drum_config[activesample].name)); + display.print(displayname); + display.show(4, 5, 6, basename(drum_config[activesample].name)); sprintf(displayname, "%03d", (int)(drum_config[activesample].reverb_send * 100) ); - lcd.setCursor(12, 1); - lcd.print(displayname); + display.setCursor(12, 1); + display.print(displayname); } else { - lcd.setCursor(0, 1); - lcd.print(" "); - lcd.setCursor(3, 1); - lcd.print(" "); - lcd.setCursor(11, 1); - lcd.print("["); - lcd.setCursor(15, 1); - lcd.print("]"); + display.setCursor(0, 1); + display.print(" "); + display.setCursor(3, 1); + display.print(" "); + display.setCursor(11, 1); + display.print("["); + display.setCursor(15, 1); + display.print("]"); sprintf(displayname, "%03d", temp_int); - lcd.setCursor(12, 1); - lcd.print(displayname); + display.setCursor(12, 1); + display.print(displayname); drum_config[activesample].reverb_send = mapfloat(temp_int, 0, 100, 0.0, 1.0); } } @@ -4553,8 +4553,8 @@ void UI_func_drum_midi_channel(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { encoderDir[ENC_R].reset(); - lcd.setCursor(0, 0); - lcd.print(F("MIDI Channel")); + display.setCursor(0, 0); + display.print(F("MIDI Channel")); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { @@ -4563,10 +4563,10 @@ void UI_func_drum_midi_channel(uint8_t param) else if (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) drum_midi_channel = constrain(drum_midi_channel - ENCODER[ENC_R].speed(), MIDI_CHANNEL_MIN, MIDI_CHANNEL_MAX); - lcd.setCursor(0, 1); + display.setCursor(0, 1); if (drum_midi_channel == 0) { - lcd.print(F("[OMNI]")); + display.print(F("[OMNI]")); } else { @@ -4584,8 +4584,8 @@ void UI_func_drums_main_volume(uint8_t param) { encoderDir[ENC_R].reset(); temp_int = mapfloat(seq.drums_volume, 0.0, VOL_MAX_FLOAT, 0, 100); - lcd.setCursor(0, 0); - lcd.print(" Drums M.Volume "); + display.setCursor(0, 0); + display.print(" Drums M.Volume "); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { @@ -4600,11 +4600,11 @@ void UI_func_drums_main_volume(uint8_t param) temp_int = constrain(temp_int - ENCODER[ENC_R].speed(), 0, 100); } } - lcd.setCursor(5, 1); + display.setCursor(5, 1); sprintf(displayname, "%03d", temp_int); - lcd.print(displayname); - lcd.setCursor(8, 1); - lcd.print("/100"); + display.print(displayname); + display.setCursor(8, 1); + display.print("/100"); master_mixer_r.gain (MASTER_MIX_CH_DRUMS, volume_transform(mapfloat(temp_int, 0, 100, 0.0, VOL_MAX_FLOAT))); master_mixer_l.gain (MASTER_MIX_CH_DRUMS, volume_transform(mapfloat(temp_int, 0, 100, 0.0, VOL_MAX_FLOAT))); seq.drums_volume = mapfloat(temp_int, 0, 100, 0.0, VOL_MAX_FLOAT); @@ -4621,13 +4621,13 @@ void UI_func_drum_tune_offset(uint8_t param) { encoderDir[ENC_R].reset(); temp_int = (int)(drum_config[activesample].p_offset * 200); - lcd.setCursor(0, 0); - lcd.print("DrumSmp. Tune"); - lcd.setCursor(1, 1); - lcd.setCursor(1, 1); + display.setCursor(0, 0); + display.print("DrumSmp. Tune"); + display.setCursor(1, 1); + display.setCursor(1, 1); sprintf(displayname, "%02d", activesample); - lcd.print(displayname); - lcd.show(1, 4, 7, basename(drum_config[activesample].name)); + display.print(displayname); + display.show(1, 4, 7, basename(drum_config[activesample].name)); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -4667,34 +4667,34 @@ void UI_func_drum_tune_offset(uint8_t param) } } if (menu_select_toggle == false) { - lcd.setCursor(11, 1); - lcd.print(" "); - lcd.setCursor(15, 1); - lcd.print(" "); - lcd.setCursor(0, 1); - lcd.print("["); - lcd.setCursor(3, 1); - lcd.print("]"); - lcd.setCursor(1, 1); + display.setCursor(11, 1); + display.print(" "); + display.setCursor(15, 1); + display.print(" "); + display.setCursor(0, 1); + display.print("["); + display.setCursor(3, 1); + display.print("]"); + display.setCursor(1, 1); sprintf(displayname, "%02d", activesample); - lcd.print(displayname); - lcd.show(1, 4, 7, basename(drum_config[activesample].name)); + display.print(displayname); + display.show(1, 4, 7, basename(drum_config[activesample].name)); sprintf(displayname, "%03d", (int)(drum_config[activesample].p_offset * 200) ); - lcd.setCursor(12, 1); - lcd.print(displayname); + display.setCursor(12, 1); + display.print(displayname); } else { temp_float = mapfloat(temp_int, 0, 400, 0.0, 2.0); - lcd.setCursor(0, 1); - lcd.print(" "); - lcd.setCursor(3, 1); - lcd.print(" "); - lcd.setCursor(11, 1); - lcd.print("["); - lcd.setCursor(15, 1); - lcd.print("]"); + display.setCursor(0, 1); + display.print(" "); + display.setCursor(3, 1); + display.print(" "); + display.setCursor(11, 1); + display.print("["); + display.setCursor(15, 1); + display.print("]"); sprintf(displayname, "%03d", temp_int); - lcd.setCursor(12, 1); - lcd.print(displayname); + display.setCursor(12, 1); + display.print(displayname); drum_config[activesample].p_offset = temp_float; } } @@ -4710,13 +4710,13 @@ void UI_func_drum_pitch(uint8_t param) { encoderDir[ENC_R].reset(); temp_int = (int)(drum_config[activesample].pitch * 200); - lcd.setCursor(0, 0); - lcd.print("DrumSmp. Pitch"); - lcd.setCursor(1, 1); - lcd.setCursor(1, 1); + display.setCursor(0, 0); + display.print("DrumSmp. Pitch"); + display.setCursor(1, 1); + display.setCursor(1, 1); sprintf(displayname, "%02d", activesample); - lcd.print(displayname); - lcd.show(1, 4, 7, basename(drum_config[activesample].name)); + display.print(displayname); + display.show(1, 4, 7, basename(drum_config[activesample].name)); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -4756,34 +4756,34 @@ void UI_func_drum_pitch(uint8_t param) } } if (menu_select_toggle == false) { - lcd.setCursor(11, 1); - lcd.print(" "); - lcd.setCursor(15, 1); - lcd.print(" "); - lcd.setCursor(0, 1); - lcd.print("["); - lcd.setCursor(3, 1); - lcd.print("]"); - lcd.setCursor(1, 1); + display.setCursor(11, 1); + display.print(" "); + display.setCursor(15, 1); + display.print(" "); + display.setCursor(0, 1); + display.print("["); + display.setCursor(3, 1); + display.print("]"); + display.setCursor(1, 1); sprintf(displayname, "%02d", activesample); - lcd.print(displayname); - lcd.show(1, 4, 7, basename(drum_config[activesample].name)); + display.print(displayname); + display.show(1, 4, 7, basename(drum_config[activesample].name)); sprintf(displayname, "%03d", (int)(drum_config[activesample].pitch * 200) ); - lcd.setCursor(12, 1); - lcd.print(displayname); + display.setCursor(12, 1); + display.print(displayname); } else { temp_float = mapfloat(temp_int, 0, 400, 0.0, 2.0); - lcd.setCursor(0, 1); - lcd.print(" "); - lcd.setCursor(3, 1); - lcd.print(" "); - lcd.setCursor(11, 1); - lcd.print("["); - lcd.setCursor(15, 1); - lcd.print("]"); + display.setCursor(0, 1); + display.print(" "); + display.setCursor(3, 1); + display.print(" "); + display.setCursor(11, 1); + display.print("["); + display.setCursor(15, 1); + display.print("]"); sprintf(displayname, "%03d", temp_int); - lcd.setCursor(12, 1); - lcd.print(displayname); + display.setCursor(12, 1); + display.print(displayname); drum_config[activesample].pitch = temp_float; } } @@ -4799,13 +4799,13 @@ void UI_func_drum_volume(uint8_t param) { encoderDir[ENC_R].reset(); temp_int = (int)(drum_config[activesample].vol_max * 100); - lcd.setCursor(0, 0); - lcd.print("DrumSmp. Volume"); - lcd.setCursor(1, 1); - lcd.setCursor(1, 1); + display.setCursor(0, 0); + display.print("DrumSmp. Volume"); + display.setCursor(1, 1); + display.setCursor(1, 1); sprintf(displayname, "%02d", activesample); - lcd.print(displayname); - lcd.show(1, 4, 7, basename(drum_config[activesample].name)); + display.print(displayname); + display.show(1, 4, 7, basename(drum_config[activesample].name)); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -4847,34 +4847,34 @@ void UI_func_drum_volume(uint8_t param) } } if (menu_select_toggle == false) { - lcd.setCursor(11, 1); - lcd.print(" "); - lcd.setCursor(15, 1); - lcd.print(" "); - lcd.setCursor(0, 1); - lcd.print("["); - lcd.setCursor(3, 1); - lcd.print("]"); - lcd.setCursor(1, 1); + display.setCursor(11, 1); + display.print(" "); + display.setCursor(15, 1); + display.print(" "); + display.setCursor(0, 1); + display.print("["); + display.setCursor(3, 1); + display.print("]"); + display.setCursor(1, 1); sprintf(displayname, "%02d", activesample); - lcd.print(displayname); - lcd.show(1, 4, 7, basename(drum_config[activesample].name)); + display.print(displayname); + display.show(1, 4, 7, basename(drum_config[activesample].name)); sprintf(displayname, "%03d", (int)(drum_config[activesample].vol_max * 100) ); - lcd.setCursor(12, 1); - lcd.print(displayname); + display.setCursor(12, 1); + display.print(displayname); } else { temp_float = mapfloat(temp_int, 0, 100, 0.0, 1.0); - lcd.setCursor(0, 1); - lcd.print(" "); - lcd.setCursor(3, 1); - lcd.print(" "); - lcd.setCursor(11, 1); - lcd.print("["); - lcd.setCursor(15, 1); - lcd.print("]"); + display.setCursor(0, 1); + display.print(" "); + display.setCursor(3, 1); + display.print(" "); + display.setCursor(11, 1); + display.print("["); + display.setCursor(15, 1); + display.print("]"); sprintf(displayname, "%03d", temp_int); - lcd.setCursor(12, 1); - lcd.print(displayname); + display.setCursor(12, 1); + display.print(displayname); drum_config[activesample].vol_max = temp_float; } } @@ -4890,17 +4890,17 @@ void UI_func_arp_shift(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { encoderDir[ENC_R].reset(); - lcd.setCursor(0, 0); - lcd.print("Arp/Chord Transp"); - lcd.setCursor(0, 1); - lcd.print("Oct"); - lcd.setCursor(4, 1); - sprintf(displayname, "%02d", seq.seq_oct_shift); - lcd.print(displayname); - lcd.setCursor(8, 1); - lcd.print("Shift"); - lcd.setCursor(14, 1); - lcd.print(seq.seq_element_shift); + display.setCursor(0, 0); + display.print("Arp/Chord Transp"); + display.setCursor(0, 1); + display.print("Oct"); + display.setCursor(4, 1); + sprintf(displayname, "%02d", seq.oct_shift); + display.print(displayname); + display.setCursor(8, 1); + display.print("Shift"); + display.setCursor(14, 1); + display.print(seq.element_shift); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { @@ -4909,11 +4909,11 @@ void UI_func_arp_shift(uint8_t param) { if (LCDML.BT_checkDown()) { - seq.seq_oct_shift = constrain(seq.seq_oct_shift + ENCODER[ENC_R].speed(), -2, 2); + seq.oct_shift = constrain(seq.oct_shift + ENCODER[ENC_R].speed(), -2, 2); } else if (LCDML.BT_checkUp()) { - seq.seq_oct_shift = constrain(seq.seq_oct_shift - ENCODER[ENC_R].speed(), -2, 2); + seq.oct_shift = constrain(seq.oct_shift - ENCODER[ENC_R].speed(), -2, 2); } } } else { @@ -4921,11 +4921,11 @@ void UI_func_arp_shift(uint8_t param) { if (LCDML.BT_checkDown()) { - seq.seq_element_shift = constrain(seq.seq_element_shift + ENCODER[ENC_R].speed(), 0, 6); + seq.element_shift = constrain(seq.element_shift + ENCODER[ENC_R].speed(), 0, 6); } else if (LCDML.BT_checkUp()) { - seq.seq_element_shift = constrain(seq.seq_element_shift - ENCODER[ENC_R].speed(), 0, 6); + seq.element_shift = constrain(seq.element_shift - ENCODER[ENC_R].speed(), 0, 6); } } } @@ -4934,29 +4934,29 @@ void UI_func_arp_shift(uint8_t param) menu_select_toggle = !menu_select_toggle; } if (menu_select_toggle == false) - { lcd.setCursor(13, 1); - lcd.print(" "); - lcd.setCursor(15, 1); - lcd.print(" "); - lcd.setCursor(3, 1); - lcd.print("["); - lcd.setCursor(6, 1); - lcd.print("]"); - lcd.setCursor(4, 1); - sprintf(displayname, "%02d", seq.seq_oct_shift); - lcd.print(displayname); + { display.setCursor(13, 1); + display.print(" "); + display.setCursor(15, 1); + display.print(" "); + display.setCursor(3, 1); + display.print("["); + display.setCursor(6, 1); + display.print("]"); + display.setCursor(4, 1); + sprintf(displayname, "%02d", seq.oct_shift); + display.print(displayname); } else { - lcd.setCursor(3, 1); - lcd.print(" "); - lcd.setCursor(6, 1); - lcd.print(" "); - lcd.setCursor(13, 1); - lcd.print("["); - lcd.setCursor(15, 1); - lcd.print("]"); - lcd.setCursor(14, 1); - lcd.print(seq.seq_element_shift); + display.setCursor(3, 1); + display.print(" "); + display.setCursor(6, 1); + display.print(" "); + display.setCursor(13, 1); + display.print("["); + display.setCursor(15, 1); + display.print("]"); + display.setCursor(14, 1); + display.print(seq.element_shift); } } @@ -4973,12 +4973,12 @@ void UI_func_drum_pan(uint8_t param) { encoderDir[ENC_R].reset(); temp_int = mapfloat(drum_config[activesample].pan, -1.0, 1.0, -99, 99); - lcd.setCursor(0, 0); - lcd.print("DrmSmp. Panorama"); - lcd.setCursor(1, 1); + display.setCursor(0, 0); + display.print("DrmSmp. Panorama"); + display.setCursor(1, 1); sprintf(displayname, "%02d", activesample); - lcd.print(displayname); - lcd.show(1, 4, 6, basename(drum_config[activesample].name)); + display.print(displayname); + display.show(1, 4, 6, basename(drum_config[activesample].name)); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { @@ -5018,44 +5018,44 @@ void UI_func_drum_pan(uint8_t param) } } if (menu_select_toggle == false) { - lcd.setCursor(11, 1); - lcd.print(" "); - lcd.setCursor(15, 1); - lcd.print(" "); - lcd.setCursor(0, 1); - lcd.print("["); - lcd.setCursor(3, 1); - lcd.print("]"); - lcd.setCursor(1, 1); + display.setCursor(11, 1); + display.print(" "); + display.setCursor(15, 1); + display.print(" "); + display.setCursor(0, 1); + display.print("["); + display.setCursor(3, 1); + display.print("]"); + display.setCursor(1, 1); sprintf(displayname, "%02d", activesample); - lcd.print(displayname); - lcd.show(1, 4, 6, basename(drum_config[activesample].name)); + display.print(displayname); + display.show(1, 4, 6, basename(drum_config[activesample].name)); } else { - lcd.setCursor(0, 1); - lcd.print(" "); - lcd.setCursor(3, 1); - lcd.print(" "); - lcd.setCursor(11, 1); - lcd.print("["); - lcd.setCursor(15, 1); - lcd.print("]"); + display.setCursor(0, 1); + display.print(" "); + display.setCursor(3, 1); + display.print(" "); + display.setCursor(11, 1); + display.print("["); + display.setCursor(15, 1); + display.print("]"); drum_config[activesample].pan = mapfloat(temp_int, -99, 99, -1.0, 1.0); } temp_int = mapfloat(drum_config[activesample].pan, -1.0, 1.0, -99, 99); - lcd.setCursor(12, 1); + display.setCursor(12, 1); if (temp_int > 1) { - lcd.print("R"); + display.print("R"); } else if (temp_int < 0) { - lcd.print("L"); + display.print("L"); } else { - lcd.print("C"); + display.print("C"); } sprintf(displayname, "%02d", abs(temp_int)); - lcd.setCursor(13, 1); - lcd.print( displayname); + display.setCursor(13, 1); + display.print( displayname); } if (LCDML.FUNC_close()) // ****** STABLE END ********* { @@ -5084,11 +5084,11 @@ const char* seq_find_shortname(uint8_t sstep) { const char* shortname; bool found = false; - if (seq.seq_content_type[seq.seq_active_track] == 0 && seq.seq_vel[seq.seq_active_track][sstep] < 210) //is Drumtrack and not a pitched sample + if (seq.content_type[seq.active_track] == 0 && seq.vel[seq.active_track][sstep] < 210) //is Drumtrack and not a pitched sample { for (uint8_t d = 0; d < NUM_DRUMSET_CONFIG - 1; d++) { - if (seq.seq_data[seq.seq_active_track][sstep] == drum_config[d].midinote) + if (seq.data[seq.active_track][sstep] == drum_config[d].midinote) { shortname = drum_config[d].shortname; found = true; @@ -5098,9 +5098,9 @@ const char* seq_find_shortname(uint8_t sstep) if (found == false) shortname = "-"; } else { - if (seq.seq_data[seq.seq_active_track][sstep] > 0 && seq.seq_data[seq.seq_active_track][sstep] != 130) - shortname = noteNames[seq.seq_data[seq.seq_active_track][sstep] % 12]; - else if (seq.seq_data[seq.seq_active_track][sstep] == 130) shortname = "~"; // note has tie/latch + if (seq.data[seq.active_track][sstep] > 0 && seq.data[seq.active_track][sstep] != 130) + shortname = noteNames[seq.data[seq.active_track][sstep] % 12]; + else if (seq.data[seq.active_track][sstep] == 130) shortname = "~"; // note has tie/latch else shortname = "-"; } @@ -5109,37 +5109,37 @@ const char* seq_find_shortname(uint8_t sstep) void seq_printAllSeqSteps() { - lcd.setCursor(0, 1); + display.setCursor(0, 1); for (uint8_t i = 0; i < 16; i++) { - lcd.print(seq_find_shortname(i)[0]); + display.print(seq_find_shortname(i)[0]); } } #ifdef TESTDISPLAY20x4 void seq_printVelGraphBar() { - lcd.setCursor(0, 2); + display.setCursor(0, 2); for (uint8_t i = 0; i < 16; i++) { - if (seq.seq_vel[seq.seq_active_track][i] == 0) - lcd.print(" "); - else if (seq.seq_vel[seq.seq_active_track][i] > 0 && seq.seq_vel[seq.seq_active_track][i] <= 20) - lcd.write(1); - else if (seq.seq_vel[seq.seq_active_track][i] > 21 && seq.seq_vel[seq.seq_active_track][i] <= 40) - lcd.write(2); - else if (seq.seq_vel[seq.seq_active_track][i] > 41 && seq.seq_vel[seq.seq_active_track][i] <= 60) - lcd.write(3); - else if (seq.seq_vel[seq.seq_active_track][i] > 61 && seq.seq_vel[seq.seq_active_track][i] <= 80) - lcd.write(4); - else if (seq.seq_vel[seq.seq_active_track][i] > 81 && seq.seq_vel[seq.seq_active_track][i] <= 90) - lcd.write(5); - else if (seq.seq_vel[seq.seq_active_track][i] > 91 && seq.seq_vel[seq.seq_active_track][i] <= 105) - lcd.write(6); - else if (seq.seq_vel[seq.seq_active_track][i] > 105 && seq.seq_vel[seq.seq_active_track][i] <= 128) - lcd.write(7); + if (seq.vel[seq.active_track][i] == 0) + display.print(" "); + else if (seq.vel[seq.active_track][i] > 0 && seq.vel[seq.active_track][i] <= 20) + display.write(1); + else if (seq.vel[seq.active_track][i] > 21 && seq.vel[seq.active_track][i] <= 40) + display.write(2); + else if (seq.vel[seq.active_track][i] > 41 && seq.vel[seq.active_track][i] <= 60) + display.write(3); + else if (seq.vel[seq.active_track][i] > 61 && seq.vel[seq.active_track][i] <= 80) + display.write(4); + else if (seq.vel[seq.active_track][i] > 81 && seq.vel[seq.active_track][i] <= 90) + display.write(5); + else if (seq.vel[seq.active_track][i] > 91 && seq.vel[seq.active_track][i] <= 105) + display.write(6); + else if (seq.vel[seq.active_track][i] > 105 && seq.vel[seq.active_track][i] <= 128) + display.write(7); else - lcd.print("C"); + display.print("C"); } } #endif @@ -5149,12 +5149,12 @@ void UI_func_seq_display_style(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { encoderDir[ENC_R].reset(); - lcd.setCursor(0, 0); - lcd.print("Seq. Disp. Style"); - lcd.setCursor(0, 1); - lcd.print("Pat."); - lcd.setCursor(9, 1); - lcd.print("="); + display.setCursor(0, 0); + display.print("Seq. Disp. Style"); + display.setCursor(0, 1); + display.print("Pat."); + display.setCursor(9, 1); + display.print("="); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { @@ -5163,11 +5163,11 @@ void UI_func_seq_display_style(uint8_t param) { if (LCDML.BT_checkDown()) { - seq.seq_active_track = constrain(seq.seq_active_track + ENCODER[ENC_R].speed(), 0, NUM_SEQ_PATTERN - 1); + seq.active_track = constrain(seq.active_track + ENCODER[ENC_R].speed(), 0, NUM_SEQ_PATTERN - 1); } else if (LCDML.BT_checkUp()) { - seq.seq_active_track = constrain(seq.seq_active_track - ENCODER[ENC_R].speed(), 0, NUM_SEQ_PATTERN - 1); + seq.active_track = constrain(seq.active_track - ENCODER[ENC_R].speed(), 0, NUM_SEQ_PATTERN - 1); } } } else { @@ -5175,11 +5175,11 @@ void UI_func_seq_display_style(uint8_t param) { if (LCDML.BT_checkDown()) { - seq.seq_content_type[seq.seq_active_track] = constrain(seq.seq_content_type[seq.seq_active_track] + ENCODER[ENC_R].speed(), 0, 2); + seq.content_type[seq.active_track] = constrain(seq.content_type[seq.active_track] + ENCODER[ENC_R].speed(), 0, 2); } else if (LCDML.BT_checkUp()) { - seq.seq_content_type[seq.seq_active_track] = constrain(seq.seq_content_type[seq.seq_active_track] - ENCODER[ENC_R].speed(), 0, 2); + seq.content_type[seq.active_track] = constrain(seq.content_type[seq.active_track] - ENCODER[ENC_R].speed(), 0, 2); } } } @@ -5188,33 +5188,33 @@ void UI_func_seq_display_style(uint8_t param) menu_select_toggle = !menu_select_toggle; } if (menu_select_toggle == false) { - lcd.setCursor(10, 1); - lcd.print(" "); - lcd.setCursor(15, 1); - lcd.print(" "); - lcd.setCursor(4, 1); - lcd.print("["); - if (seq.seq_active_track < 10) - lcd.print ("0"); - lcd.print(seq.seq_active_track); - lcd.print("]"); + display.setCursor(10, 1); + display.print(" "); + display.setCursor(15, 1); + display.print(" "); + display.setCursor(4, 1); + display.print("["); + if (seq.active_track < 10) + display.print ("0"); + display.print(seq.active_track); + display.print("]"); } else { - lcd.setCursor(4, 1); - lcd.print(" "); - lcd.setCursor(7, 1); - lcd.print(" "); - lcd.setCursor(10, 1); - lcd.print("["); - lcd.setCursor(15, 1); - lcd.print("]"); - } - lcd.setCursor(11, 1); - if (seq.seq_content_type[seq.seq_active_track] == 0) - lcd.print("Drum"); - else if (seq.seq_content_type[seq.seq_active_track] == 1) - lcd.print("Inst"); + display.setCursor(4, 1); + display.print(" "); + display.setCursor(7, 1); + display.print(" "); + display.setCursor(10, 1); + display.print("["); + display.setCursor(15, 1); + display.print("]"); + } + display.setCursor(11, 1); + if (seq.content_type[seq.active_track] == 0) + display.print("Drum"); + else if (seq.content_type[seq.active_track] == 1) + display.print("Inst"); else - lcd.print("Chrd"); + display.print("Chrd"); } if (LCDML.FUNC_close()) // ****** STABLE END ********* { @@ -5231,36 +5231,36 @@ void UI_func_seq_live_transpose_oct(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { encoderDir[ENC_R].reset(); - getNoteName(note_name, seq.seq_transpose); - getNoteName(note_name2, seq.seq_transpose + 12); - lcd.setCursor(0, 0); - lcd.print(F("Live Transp.Oct.")); - lcd.setCursor(0, 1); - lcd.print(F("[")); - lcd.print(note_name); - lcd.print(F("] - ")); - lcd.print(("[")); - lcd.print(note_name2); - lcd.print(("]")); + getNoteName(note_name, seq.transpose); + getNoteName(note_name2, seq.transpose + 12); + display.setCursor(0, 0); + display.print(F("Live Transp.Oct.")); + display.setCursor(0, 1); + display.print(F("[")); + display.print(note_name); + display.print(F("] - ")); + display.print(("[")); + display.print(note_name2); + display.print(("]")); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) { if (LCDML.BT_checkDown()) - seq.seq_transpose = constrain(seq.seq_transpose + ENCODER[ENC_R].speed(), 24, 60); + seq.transpose = constrain(seq.transpose + ENCODER[ENC_R].speed(), 24, 60); else if (LCDML.BT_checkUp()) - seq.seq_transpose = constrain(seq.seq_transpose - ENCODER[ENC_R].speed(), 24, 60); - } - getNoteName(note_name, seq.seq_transpose); - getNoteName(note_name2, seq.seq_transpose + 12); - lcd.setCursor(0, 1); - lcd.print(F("[")); - lcd.print(note_name); - lcd.print(F("] - ")); - lcd.print(("[")); - lcd.print(note_name2); - lcd.print(("]")); + seq.transpose = constrain(seq.transpose - ENCODER[ENC_R].speed(), 24, 60); + } + getNoteName(note_name, seq.transpose); + getNoteName(note_name2, seq.transpose + 12); + display.setCursor(0, 1); + display.print(F("[")); + display.print(note_name); + display.print(F("] - ")); + display.print(("[")); + display.print(note_name2); + display.print(("]")); } if (LCDML.FUNC_close()) // ****** STABLE END ********* { @@ -5274,25 +5274,25 @@ void UI_func_seq_chord_keys_ammount(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { encoderDir[ENC_R].reset(); - lcd.setCursor(0, 0); - lcd.print("ChordTrack Keys:"); - lcd.setCursor(8, 1); - lcd.print("Keys"); + display.setCursor(0, 0); + display.print("ChordTrack Keys:"); + display.setCursor(8, 1); + display.print("Keys"); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) { if (LCDML.BT_checkDown()) - seq.seq_chord_key_ammount = constrain(seq.seq_chord_key_ammount + ENCODER[ENC_R].speed(), 1, 7); + seq.chord_key_ammount = constrain(seq.chord_key_ammount + ENCODER[ENC_R].speed(), 1, 7); else if (LCDML.BT_checkUp()) - seq.seq_chord_key_ammount = constrain(seq.seq_chord_key_ammount - ENCODER[ENC_R].speed(), 1, 7); + seq.chord_key_ammount = constrain(seq.chord_key_ammount - ENCODER[ENC_R].speed(), 1, 7); } - lcd.setCursor(4, 1); - lcd.print("["); - sprintf(displayname, "%02d", seq.seq_chord_key_ammount); - lcd.print(displayname); - lcd.print("]"); + display.setCursor(4, 1); + display.print("["); + sprintf(displayname, "%02d", seq.chord_key_ammount); + display.print(displayname); + display.print("]"); } if (LCDML.FUNC_close()) // ****** STABLE END ********* { @@ -5305,22 +5305,22 @@ void UI_func_seq_lenght(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { encoderDir[ENC_R].reset(); - lcd.setCursor(0, 0); - lcd.print(" Seq. lenght "); + display.setCursor(0, 0); + display.print(" Seq. lenght "); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) { if (LCDML.BT_checkDown()) - seq.seq_chain_lenght = constrain(seq.seq_chain_lenght + ENCODER[ENC_R].speed(), 0, 3); + seq.chain_lenght = constrain(seq.chain_lenght + ENCODER[ENC_R].speed(), 0, 3); else if (LCDML.BT_checkUp()) - seq.seq_chain_lenght = constrain(seq.seq_chain_lenght - ENCODER[ENC_R].speed(), 0, 3); + seq.chain_lenght = constrain(seq.chain_lenght - ENCODER[ENC_R].speed(), 0, 3); } - lcd.setCursor(3, 1); - lcd.print((seq.seq_chain_lenght + 1) * 16 ); - lcd.setCursor(7, 1); - lcd.print("Steps"); + display.setCursor(3, 1); + display.print((seq.chain_lenght + 1) * 16 ); + display.setCursor(7, 1); + display.print("Steps"); } if (LCDML.FUNC_close()) // ****** STABLE END ********* { @@ -5334,42 +5334,42 @@ void UI_func_seq_tempo(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { encoderDir[ENC_R].reset(); - lcd.setCursor(0, 0); - lcd.print(" Seq. Tempo "); - lcd.setCursor(5, 1); - lcd.print("BPM"); - lcd.setCursor(14, 1); - lcd.print("ms"); + display.setCursor(0, 0); + display.print(" Seq. Tempo "); + display.setCursor(5, 1); + display.print("BPM"); + display.setCursor(14, 1); + display.print("ms"); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) { if (LCDML.BT_checkDown()) - seq.seq_bpm = constrain(seq.seq_bpm + ENCODER[ENC_R].speed(), 50, 190); + seq.bpm = constrain(seq.bpm + ENCODER[ENC_R].speed(), 50, 190); else if (LCDML.BT_checkUp()) - seq.seq_bpm = constrain(seq.seq_bpm - ENCODER[ENC_R].speed(), 50, 190); - } - seq.seq_tempo_ms = 60000000 / seq.seq_bpm / 4; - lcd.setCursor(0, 1); - sprintf(tmp, "[%3d]", seq.seq_bpm); - lcd.print(tmp); - lcd.setCursor(11, 1); - sprintf(tmp, "%3d", seq.seq_tempo_ms / 1000); - lcd.print(tmp); + seq.bpm = constrain(seq.bpm - ENCODER[ENC_R].speed(), 50, 190); + } + seq.tempo_ms = 60000000 / seq.bpm / 4; + display.setCursor(0, 1); + sprintf(tmp, "[%3d]", seq.bpm); + display.print(tmp); + display.setCursor(11, 1); + sprintf(tmp, "%3d", seq.tempo_ms / 1000); + display.print(tmp); #ifdef USE_FX for (uint8_t i = 0; i < MAX_DEXED; i++) { if (configuration.fx.delay_sync[i] > 0) { - uint16_t midi_sync_delay_time = uint16_t(60000.0 * midi_ticks_factor[configuration.fx.delay_sync[i]] / seq.seq_bpm); + uint16_t midi_sync_delay_time = uint16_t(60000.0 * midi_ticks_factor[configuration.fx.delay_sync[i]] / seq.bpm); delay_fx[i]->delay(0, constrain(midi_sync_delay_time, DELAY_TIME_MIN, DELAY_TIME_MAX * 10)); } } #endif //sequencer_timer.stop(); #ifdef USE_SEQUENCER - sequencer_timer.begin(sequencer, seq.seq_tempo_ms / 2); + sequencer_timer.begin(sequencer, seq.tempo_ms / 2); #endif } if (LCDML.FUNC_close()) // ****** STABLE END ********* @@ -5385,19 +5385,19 @@ void UI_func_seq_vel_editor(uint8_t param) { // setup function encoderDir[ENC_R].reset(); - lcd.setCursor(0, 0); - lcd.print("V:"); - sprintf(tmp, "%03d", seq.seq_vel[seq.seq_active_track][seq.seq_menu - 1]); - lcd.setCursor(2, 0); - lcd.print(tmp); - lcd.setCursor(12, 0); - lcd.print("["); - lcd.setCursor(13, 0); - if (seq.seq_active_track < 10) - lcd.print("0"); - lcd.print(seq.seq_active_track); - lcd.setCursor(15, 0); - lcd.print("]"); + display.setCursor(0, 0); + display.print("V:"); + sprintf(tmp, "%03d", seq.vel[seq.active_track][seq.menu - 1]); + display.setCursor(2, 0); + display.print(tmp); + display.setCursor(12, 0); + display.print("["); + display.setCursor(13, 0); + if (seq.active_track < 10) + display.print("0"); + display.print(seq.active_track); + display.setCursor(15, 0); + display.print("]"); seq_printAllSeqSteps(); } @@ -5408,9 +5408,9 @@ void UI_func_seq_vel_editor(uint8_t param) if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) - seq.seq_menu = constrain(seq.seq_menu + 1, 0, 16); + seq.menu = constrain(seq.menu + 1, 0, 16); else if (LCDML.BT_checkUp()) - seq.seq_menu = constrain(seq.seq_menu - 1, 0, 16); + seq.menu = constrain(seq.menu - 1, 0, 16); } } else if (seq_active_function == 0) @@ -5418,33 +5418,33 @@ void UI_func_seq_vel_editor(uint8_t param) if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) - seq.seq_active_track = constrain(seq.seq_active_track + 1, 0, NUM_SEQ_PATTERN - 1); + seq.active_track = constrain(seq.active_track + 1, 0, NUM_SEQ_PATTERN - 1); else if (LCDML.BT_checkUp()) - seq.seq_active_track = constrain(seq.seq_active_track - 1, 0, NUM_SEQ_PATTERN - 1); + seq.active_track = constrain(seq.active_track - 1, 0, NUM_SEQ_PATTERN - 1); } } - if ( seq.seq_data[seq.seq_active_track][seq.seq_menu - 1] > 0 ) + if ( seq.data[seq.active_track][seq.menu - 1] > 0 ) { - if (seq.seq_vel[seq.seq_active_track][seq.seq_menu - 1] < 210) //it is a normal sample + if (seq.vel[seq.active_track][seq.menu - 1] < 210) //it is a normal sample { - if (seq_active_function == 1 && seq.seq_content_type[seq.seq_active_track] < 2 ) + if (seq_active_function == 1 && seq.content_type[seq.active_track] < 2 ) { //if is Drum or normal Instrument Track if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) - seq.seq_vel[seq.seq_active_track][seq.seq_menu - 1] = constrain(seq.seq_vel[seq.seq_active_track][seq.seq_menu - 1] + 1, 0, 127); + seq.vel[seq.active_track][seq.menu - 1] = constrain(seq.vel[seq.active_track][seq.menu - 1] + 1, 0, 127); else if (LCDML.BT_checkUp()) - seq.seq_vel[seq.seq_active_track][seq.seq_menu - 1] = constrain(seq.seq_vel[seq.seq_active_track][seq.seq_menu - 1] - 1, 0, 127); + seq.vel[seq.active_track][seq.menu - 1] = constrain(seq.vel[seq.active_track][seq.menu - 1] - 1, 0, 127); } } - else if (seq_active_function == 1 && seq.seq_content_type[seq.seq_active_track] > 1 ) + else if (seq_active_function == 1 && seq.content_type[seq.active_track] > 1 ) { //is in Chord or Arp Mode if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) - seq.seq_vel[seq.seq_active_track][seq.seq_menu - 1] = constrain(seq.seq_vel[seq.seq_active_track][seq.seq_menu - 1] + 1, 200, 205); + seq.vel[seq.active_track][seq.menu - 1] = constrain(seq.vel[seq.active_track][seq.menu - 1] + 1, 200, 205); else if (LCDML.BT_checkUp()) - seq.seq_vel[seq.seq_active_track][seq.seq_menu - 1] = constrain(seq.seq_vel[seq.seq_active_track][seq.seq_menu - 1] - 1, 200, 205); + seq.vel[seq.active_track][seq.menu - 1] = constrain(seq.vel[seq.active_track][seq.menu - 1] - 1, 200, 205); } } } @@ -5454,22 +5454,22 @@ void UI_func_seq_vel_editor(uint8_t param) if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) - seq.seq_vel[seq.seq_active_track][seq.seq_menu - 1] = constrain(seq.seq_vel[seq.seq_active_track][seq.seq_menu - 1] + 1, 210, 215); + seq.vel[seq.active_track][seq.menu - 1] = constrain(seq.vel[seq.active_track][seq.menu - 1] + 1, 210, 215); else if (LCDML.BT_checkUp()) - seq.seq_vel[seq.seq_active_track][seq.seq_menu - 1] = constrain(seq.seq_vel[seq.seq_active_track][seq.seq_menu - 1] - 1, 210, 215); + seq.vel[seq.active_track][seq.menu - 1] = constrain(seq.vel[seq.active_track][seq.menu - 1] - 1, 210, 215); } } } if (LCDML.BT_checkEnter()) //handle button presses during menu >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> { - if ( seq.seq_menu == 0 && seq_active_function == 99) + if ( seq.menu == 0 && seq_active_function == 99) { seq_active_function = 0; - } else if ( seq.seq_menu == 0 && seq_active_function == 0) + } else if ( seq.menu == 0 && seq_active_function == 0) { seq_active_function = 99; } - else if (seq.seq_menu > 0 && seq_active_function == 99) + else if (seq.menu > 0 && seq_active_function == 99) { seq_active_function = 1; } @@ -5477,139 +5477,139 @@ void UI_func_seq_vel_editor(uint8_t param) seq_active_function = 99; } //button check end <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< - if ( seq.seq_content_type[seq.seq_active_track] > 1 && seq.seq_vel[seq.seq_active_track][seq.seq_menu - 1] < 200) seq.seq_vel[seq.seq_active_track][seq.seq_menu - 1] = 200; + if ( seq.content_type[seq.active_track] > 1 && seq.vel[seq.active_track][seq.menu - 1] < 200) seq.vel[seq.active_track][seq.menu - 1] = 200; if (seq_active_function == 0) { - lcd.setCursor(0, 0); - if (seq.seq_content_type[seq.seq_active_track] == 0) - lcd.print("Drum Track "); - else if (seq.seq_content_type[seq.seq_active_track] == 1) - lcd.print("Instr. Track "); + display.setCursor(0, 0); + if (seq.content_type[seq.active_track] == 0) + display.print("Drum Track "); + else if (seq.content_type[seq.active_track] == 1) + display.print("Instr. Track "); else - lcd.print("Chord Track "); + display.print("Chord Track "); } - if (seq.seq_menu > 0 && seq.seq_content_type[seq.seq_active_track] == 0) + if (seq.menu > 0 && seq.content_type[seq.active_track] == 0) { - lcd.setCursor(0, 0); - if (seq.seq_vel[seq.seq_active_track][seq.seq_menu - 1] < 210 && seq.seq_vel[seq.seq_active_track][seq.seq_menu - 1] > 0) //it is a normal sample + display.setCursor(0, 0); + if (seq.vel[seq.active_track][seq.menu - 1] < 210 && seq.vel[seq.active_track][seq.menu - 1] > 0) //it is a normal sample { - lcd.print("V:"); - sprintf(tmp, "%03d", seq.seq_vel[seq.seq_active_track][seq.seq_menu - 1]); - lcd.setCursor(2, 0); - lcd.print(tmp); + display.print("V:"); + sprintf(tmp, "%03d", seq.vel[seq.active_track][seq.menu - 1]); + display.setCursor(2, 0); + display.print(tmp); } else { // else it is a live-pitched sample - if (seq.seq_vel[seq.seq_active_track][seq.seq_menu - 1] > 0) { - lcd.setCursor(0, 0); - lcd.print("Smp:["); - lcd.setCursor(12, 0); - lcd.print("]"); - lcd.show(0, 5, 7, basename(drum_config[seq.seq_vel[seq.seq_active_track][seq.seq_menu - 1] - 210].name)); + if (seq.vel[seq.active_track][seq.menu - 1] > 0) { + display.setCursor(0, 0); + display.print("Smp:["); + display.setCursor(12, 0); + display.print("]"); + display.show(0, 5, 7, basename(drum_config[seq.vel[seq.active_track][seq.menu - 1] - 210].name)); } } } - if (seq.seq_menu == 0) { - lcd.setCursor(12, 0); - lcd.print("["); - if (seq.seq_active_track < 10) - lcd.print("0"); - lcd.print(seq.seq_active_track); - lcd.print("]"); - lcd.setCursor(0, 1); + if (seq.menu == 0) { + display.setCursor(12, 0); + display.print("["); + if (seq.active_track < 10) + display.print("0"); + display.print(seq.active_track); + display.print("]"); + display.setCursor(0, 1); seq_printAllSeqSteps(); - } else if (seq.seq_menu == 1) { - lcd.setCursor(12, 0); - lcd.print(" "); - lcd.setCursor(15, 0); - lcd.print(" "); - lcd.setCursor(0, 1); - lcd.write(219); // cursor symbol - lcd.setCursor(1, 1); - lcd.print(seq_find_shortname(1)[0] ); - if (seq.seq_vel[seq.seq_active_track][seq.seq_menu - 1] < 210 && seq.seq_content_type[seq.seq_active_track] < 2) //it is a normal sample - { - sprintf(tmp, "%03d", seq.seq_vel[seq.seq_active_track][seq.seq_menu - 1]); - lcd.setCursor(2, 0); - lcd.print(tmp); - } - } else if (seq.seq_menu > 1) - { - lcd.setCursor(seq.seq_menu - 1, 1); - lcd.write(219); // cursor symbol - lcd.setCursor(seq.seq_menu - 2, 1); - lcd.print(seq_find_shortname(seq.seq_menu - 2)[0] ); - if (seq.seq_menu < 16) { - lcd.setCursor(seq.seq_menu , 1); - lcd.print(seq_find_shortname(seq.seq_menu)[0] ); - } - } - if (seq.seq_menu > 0) { - lcd.setCursor(4, 0); - if (seq.seq_data[seq.seq_active_track][seq.seq_menu - 1] > 0) - { - if (seq.seq_content_type[seq.seq_active_track] == 0) //is Drumtrack + } else if (seq.menu == 1) { + display.setCursor(12, 0); + display.print(" "); + display.setCursor(15, 0); + display.print(" "); + display.setCursor(0, 1); + display.write(219); // cursor symbol + display.setCursor(1, 1); + display.print(seq_find_shortname(1)[0] ); + if (seq.vel[seq.active_track][seq.menu - 1] < 210 && seq.content_type[seq.active_track] < 2) //it is a normal sample + { + sprintf(tmp, "%03d", seq.vel[seq.active_track][seq.menu - 1]); + display.setCursor(2, 0); + display.print(tmp); + } + } else if (seq.menu > 1) + { + display.setCursor(seq.menu - 1, 1); + display.write(219); // cursor symbol + display.setCursor(seq.menu - 2, 1); + display.print(seq_find_shortname(seq.menu - 2)[0] ); + if (seq.menu < 16) { + display.setCursor(seq.menu , 1); + display.print(seq_find_shortname(seq.menu)[0] ); + } + } + if (seq.menu > 0) { + display.setCursor(4, 0); + if (seq.data[seq.active_track][seq.menu - 1] > 0) + { + if (seq.content_type[seq.active_track] == 0) //is Drumtrack { - lcd.setCursor(0, 0); - if (seq.seq_vel[seq.seq_active_track][seq.seq_menu - 1] < 210) //it is a normal sample + display.setCursor(0, 0); + if (seq.vel[seq.active_track][seq.menu - 1] < 210) //it is a normal sample { - lcd.print("V:"); - sprintf(tmp, "%03d", seq.seq_vel[seq.seq_active_track][seq.seq_menu - 1]); - lcd.print(tmp); - //lcd.setCursor(7, 0); - //lcd.print(" "); - lcd.show(0, 6, 5, seq_find_drum_name_from_note( seq.seq_data[seq.seq_active_track][seq.seq_menu - 1]) ); + display.print("V:"); + sprintf(tmp, "%03d", seq.vel[seq.active_track][seq.menu - 1]); + display.print(tmp); + //display.setCursor(7, 0); + //display.print(" "); + display.show(0, 6, 5, seq_find_drum_name_from_note( seq.data[seq.active_track][seq.menu - 1]) ); } else { // else it is a live-pitched sample - lcd.setCursor(0, 0); - lcd.print("Smp:["); - lcd.setCursor(12, 0); - lcd.print("]"); - lcd.setCursor(1, 0); - lcd.show(0, 5, 7, basename(drum_config[seq.seq_vel[seq.seq_active_track][seq.seq_menu - 1] - 210].name)); + display.setCursor(0, 0); + display.print("Smp:["); + display.setCursor(12, 0); + display.print("]"); + display.setCursor(1, 0); + display.show(0, 5, 7, basename(drum_config[seq.vel[seq.active_track][seq.menu - 1] - 210].name)); } } else { - if ( seq.seq_data[seq.seq_active_track][seq.seq_menu - 1] != 130 ) //note not latched + if ( seq.data[seq.active_track][seq.menu - 1] != 130 ) //note not latched { - if (seq.seq_content_type[seq.seq_active_track] < 2) + if (seq.content_type[seq.active_track] < 2) { - lcd.setCursor(0, 0); - lcd.print("Vel:"); - sprintf(tmp, "%03d", seq.seq_vel[seq.seq_active_track][seq.seq_menu - 1]); - lcd.setCursor(4, 0); - lcd.print(tmp); - lcd.print(" "); + display.setCursor(0, 0); + display.print("Vel:"); + sprintf(tmp, "%03d", seq.vel[seq.active_track][seq.menu - 1]); + display.setCursor(4, 0); + display.print(tmp); + display.print(" "); } - lcd.setCursor(8, 0); - lcd.print(noteNames[seq.seq_data[seq.seq_active_track][seq.seq_menu - 1] % 12 ][0] ); - if (noteNames[seq.seq_data[seq.seq_active_track][seq.seq_menu - 1] % 12 ][1] != '\0' ) { - lcd.print(noteNames[seq.seq_data[seq.seq_active_track][seq.seq_menu - 1] % 12 ][1] ); + display.setCursor(8, 0); + display.print(noteNames[seq.data[seq.active_track][seq.menu - 1] % 12 ][0] ); + if (noteNames[seq.data[seq.active_track][seq.menu - 1] % 12 ][1] != '\0' ) { + display.print(noteNames[seq.data[seq.active_track][seq.menu - 1] % 12 ][1] ); } - lcd.print( (seq.seq_data[seq.seq_active_track][seq.seq_menu - 1] / 12) - 1); - lcd.print(" "); + display.print( (seq.data[seq.active_track][seq.menu - 1] / 12) - 1); + display.print(" "); } else { //note is latched - lcd.setCursor(0, 0); - lcd.print("latched note "); + display.setCursor(0, 0); + display.print("latched note "); } - if (seq.seq_content_type[seq.seq_active_track] > 1) + if (seq.content_type[seq.active_track] > 1) { - lcd.setCursor(0, 0); - if (seq.seq_vel[seq.seq_active_track][seq.seq_menu - 1] == 200) lcd.print("Major " ); - else if (seq.seq_vel[seq.seq_active_track][seq.seq_menu - 1] == 201) lcd.print("Minor " ); - else if (seq.seq_vel[seq.seq_active_track][seq.seq_menu - 1] == 202) lcd.print("Seven " ); - else if (seq.seq_vel[seq.seq_active_track][seq.seq_menu - 1] == 203) lcd.print("Aug " ); - else if (seq.seq_vel[seq.seq_active_track][seq.seq_menu - 1] == 204) lcd.print("Dim " ); - else if (seq.seq_vel[seq.seq_active_track][seq.seq_menu - 1] == 205) lcd.print("Major7 " ); + display.setCursor(0, 0); + if (seq.vel[seq.active_track][seq.menu - 1] == 200) display.print("Major " ); + else if (seq.vel[seq.active_track][seq.menu - 1] == 201) display.print("Minor " ); + else if (seq.vel[seq.active_track][seq.menu - 1] == 202) display.print("Seven " ); + else if (seq.vel[seq.active_track][seq.menu - 1] == 203) display.print("Aug " ); + else if (seq.vel[seq.active_track][seq.menu - 1] == 204) display.print("Dim " ); + else if (seq.vel[seq.active_track][seq.menu - 1] == 205) display.print("Major7 " ); } } } else { - lcd.setCursor(0, 0); - lcd.print(" "); + display.setCursor(0, 0); + display.print(" "); } } } @@ -5621,76 +5621,76 @@ void UI_func_seq_vel_editor(uint8_t param) void seq_clear_active_pattern() { - memset(seq.seq_data[seq.seq_active_track], 0, sizeof(seq.seq_data[seq.seq_active_track])); - memset(seq.seq_vel[seq.seq_active_track], 0, sizeof(seq.seq_vel[seq.seq_active_track])); + memset(seq.data[seq.active_track], 0, sizeof(seq.data[seq.active_track])); + memset(seq.vel[seq.active_track], 0, sizeof(seq.vel[seq.active_track])); } void seq_clear_all_patterns() { for (uint8_t i = 0; i < NUM_SEQ_PATTERN - 1; i++) { - memset(seq.seq_data[i], 0, sizeof(seq.seq_data[i])); - memset(seq.seq_vel[i], 0, sizeof(seq.seq_vel[i])); + memset(seq.data[i], 0, sizeof(seq.data[i])); + memset(seq.vel[i], 0, sizeof(seq.vel[i])); } } void seq_refresh_display_play_status() { - if (seq.seq_running == false && seq.seq_recording == false) + if (seq.running == false && seq.recording == false) { - lcd.createChar(0, (uint8_t*)special_chars[19]); //play symbol + display.createChar(0, (uint8_t*)special_chars[19]); //play symbol #ifdef TESTDISPLAY20x4 - lcd.setCursor(14, 0); + display.setCursor(14, 0); #else - lcd.setCursor(10, 0); + display.setCursor(10, 0); #endif - lcd.write(0); - } else if (seq.seq_running == true && seq.seq_recording == false) + display.write(0); + } else if (seq.running == true && seq.recording == false) { - seq.seq_note_in = 0; - lcd.createChar(0, (uint8_t*)special_chars[20]); //record symbol + seq.note_in = 0; + display.createChar(0, (uint8_t*)special_chars[20]); //record symbol #ifdef TESTDISPLAY20x4 - lcd.setCursor(14, 0); + display.setCursor(14, 0); #else - lcd.setCursor(10, 0); + display.setCursor(10, 0); #endif - lcd.write(0); - } else if (seq.seq_running == true && seq.seq_recording == true) + display.write(0); + } else if (seq.running == true && seq.recording == true) { - seq.seq_note_in = 0; - lcd.createChar(0, (uint8_t*)special_chars[21]); //stop symbol + seq.note_in = 0; + display.createChar(0, (uint8_t*)special_chars[21]); //stop symbol #ifdef TESTDISPLAY20x4 - lcd.setCursor(14, 0); + display.setCursor(14, 0); #else - lcd.setCursor(10, 0); + display.setCursor(10, 0); #endif - lcd.write(0); + display.write(0); } } void arp_refresh_display_play_status() { - if (seq.seq_running == false ) + if (seq.running == false ) { - lcd.createChar(0, (uint8_t*)special_chars[19]); //play symbol - lcd.setCursor(13, 0); - lcd.write(0); - } else if (seq.seq_running == true ) + display.createChar(0, (uint8_t*)special_chars[19]); //play symbol + display.setCursor(13, 0); + display.write(0); + } else if (seq.running == true ) { - seq.seq_note_in = 0; - lcd.createChar(0, (uint8_t*)special_chars[21]); //stop symbol - lcd.setCursor(13, 0); - lcd.write(0); + seq.note_in = 0; + display.createChar(0, (uint8_t*)special_chars[21]); //stop symbol + display.setCursor(13, 0); + display.write(0); } } void seq_print_current_note() { - lcd.print(noteNames[seq.seq_data[seq.seq_active_track][seq.seq_menu - 3] % 12 ][0] ); - if (noteNames[seq.seq_data[seq.seq_active_track][seq.seq_menu - 3] % 12 ][1] != '\0' ) + display.print(noteNames[seq.data[seq.active_track][seq.menu - 3] % 12 ][0] ); + if (noteNames[seq.data[seq.active_track][seq.menu - 3] % 12 ][1] != '\0' ) { - lcd.print(noteNames[seq.seq_data[seq.seq_active_track][seq.seq_menu - 3] % 12 ][1] ); + display.print(noteNames[seq.data[seq.active_track][seq.menu - 3] % 12 ][1] ); } - lcd.print( (seq.seq_data[seq.seq_active_track][seq.seq_menu - 3] / 12) - 1); - lcd.print(" "); + display.print( (seq.data[seq.active_track][seq.menu - 3] / 12) - 1); + display.print(" "); } void check_variable_samples_basespeed() { @@ -5705,28 +5705,28 @@ void UI_func_seq_pattern_editor(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { check_variable_samples_basespeed(); - lcd.createChar(0, (uint8_t*)special_chars[19]); //play symbol + record symbol switching + display.createChar(0, (uint8_t*)special_chars[19]); //play symbol + record symbol switching #ifdef TESTDISPLAY20x4 - lcd.createChar(1, (uint8_t*)special_chars[9]); //bar graph - lcd.createChar(2, (uint8_t*)special_chars[10]); //bar graph - lcd.createChar(3, (uint8_t*)special_chars[11]); //bar graph - lcd.createChar(4, (uint8_t*)special_chars[12]); //bar graph - lcd.createChar(5, (uint8_t*)special_chars[13]); //bar graph - lcd.createChar(6, (uint8_t*)special_chars[14]); //bar graph - lcd.createChar(7, (uint8_t*)special_chars[15]); //bar graph + display.createChar(1, (uint8_t*)special_chars[9]); //bar graph + display.createChar(2, (uint8_t*)special_chars[10]); //bar graph + display.createChar(3, (uint8_t*)special_chars[11]); //bar graph + display.createChar(4, (uint8_t*)special_chars[12]); //bar graph + display.createChar(5, (uint8_t*)special_chars[13]); //bar graph + display.createChar(6, (uint8_t*)special_chars[14]); //bar graph + display.createChar(7, (uint8_t*)special_chars[15]); //bar graph #endif - temp_int = seq.seq_data[seq.seq_active_track][0]; + temp_int = seq.data[seq.active_track][0]; encoderDir[ENC_R].reset(); - seq.seq_note_in = 0; + seq.note_in = 0; // setup function seq_refresh_display_play_status(); #ifdef TESTDISPLAY20x4 - lcd.setCursor(17, 0); + display.setCursor(17, 0); #else - lcd.setCursor(13, 0); + display.setCursor(13, 0); #endif - if (seq.seq_active_track < 10)lcd.print("0"); - lcd.print(seq.seq_active_track); + if (seq.active_track < 10)display.print("0"); + display.print(seq.active_track); seq_printAllSeqSteps(); #ifdef TESTDISPLAY20x4 seq_printVelGraphBar(); @@ -5738,35 +5738,35 @@ void UI_func_seq_pattern_editor(uint8_t param) if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) { - seq.seq_data[seq.seq_active_track][seq.seq_menu - 3] = constrain(seq.seq_data[seq.seq_active_track][seq.seq_menu - 3] + 1, 1, 108); + seq.data[seq.active_track][seq.menu - 3] = constrain(seq.data[seq.active_track][seq.menu - 3] + 1, 1, 108); } else if (LCDML.BT_checkUp()) { - seq.seq_data[seq.seq_active_track][seq.seq_menu - 3] = constrain(seq.seq_data[seq.seq_active_track][seq.seq_menu - 3] - 1, 1, 108); + seq.data[seq.active_track][seq.menu - 3] = constrain(seq.data[seq.active_track][seq.menu - 3] - 1, 1, 108); } } } - else if (seq.seq_menu == 33) { // is in sub-function - fill pattern + else if (seq.menu == 33) { // is in sub-function - fill pattern seq_active_function = 95; if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) { - seq.seq_temp_active_menu = constrain(seq.seq_temp_active_menu + 1, 0, 3); + seq.temp_active_menu = constrain(seq.temp_active_menu + 1, 0, 3); } else if (LCDML.BT_checkUp()) { - seq.seq_temp_active_menu = constrain(seq.seq_temp_active_menu - 1, 0, 3); + seq.temp_active_menu = constrain(seq.temp_active_menu - 1, 0, 3); } } } - else if (seq.seq_menu == 32) { // is in sub-function - fill pattern + else if (seq.menu == 32) { // is in sub-function - fill pattern seq_active_function = 97; - if (seq.seq_content_type[seq.seq_active_track] == 0) { + if (seq.content_type[seq.active_track] == 0) { if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) { - seq.seq_temp_select_menu = constrain(seq.seq_temp_select_menu + 1, 0, NUM_DRUMSET_CONFIG - 1); + seq.temp_select_menu = constrain(seq.temp_select_menu + 1, 0, NUM_DRUMSET_CONFIG - 1); } else if (LCDML.BT_checkUp()) { - seq.seq_temp_select_menu = constrain(seq.seq_temp_select_menu - 1, 0, NUM_DRUMSET_CONFIG - 1); + seq.temp_select_menu = constrain(seq.temp_select_menu - 1, 0, NUM_DRUMSET_CONFIG - 1); } } } @@ -5775,30 +5775,30 @@ void UI_func_seq_pattern_editor(uint8_t param) if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) - seq.seq_temp_select_menu = constrain(seq.seq_temp_select_menu + 1, 0, 108 ); + seq.temp_select_menu = constrain(seq.temp_select_menu + 1, 0, 108 ); else if (LCDML.BT_checkUp()) - seq.seq_temp_select_menu = constrain(seq.seq_temp_select_menu - 1, 0, 108 ); + seq.temp_select_menu = constrain(seq.temp_select_menu - 1, 0, 108 ); } } } - else if (seq.seq_menu == 30 || seq.seq_menu == 31 ) { // is in sub-function - swap pattern or copy pattern + else if (seq.menu == 30 || seq.menu == 31 ) { // is in sub-function - swap pattern or copy pattern seq_active_function = 98; if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) { temp_int = constrain(temp_int + 1, 0, NUM_SEQ_PATTERN - 1); - if (temp_int == seq.seq_active_track)temp_int++; + if (temp_int == seq.active_track)temp_int++; if (temp_int > NUM_SEQ_PATTERN - 1)temp_int = 0; } else if (LCDML.BT_checkUp()) { temp_int = constrain(temp_int - 1, 0, NUM_SEQ_PATTERN - 1); - if (temp_int == seq.seq_active_track)temp_int--; + if (temp_int == seq.active_track)temp_int--; if (temp_int < 0)temp_int = NUM_SEQ_PATTERN - 1; } } } - else if (seq.seq_menu == 34) { // is in transpose edit + else if (seq.menu == 34) { // is in transpose edit seq_active_function = 94; if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { @@ -5817,13 +5817,13 @@ void UI_func_seq_pattern_editor(uint8_t param) if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) - seq.seq_menu = constrain(seq.seq_menu + 1, 0, 18); + seq.menu = constrain(seq.menu + 1, 0, 18); else if (LCDML.BT_checkUp()) - seq.seq_menu = constrain(seq.seq_menu - 1, 0, 18); + seq.menu = constrain(seq.menu - 1, 0, 18); } } else if (seq_active_function == 0 ) { - if (seq.seq_content_type[seq.seq_active_track] == 0) // is in Drumedit mode + if (seq.content_type[seq.active_track] == 0) // is in Drumedit mode { if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { @@ -5848,238 +5848,238 @@ void UI_func_seq_pattern_editor(uint8_t param) if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) - seq.seq_active_track = constrain(seq.seq_active_track + 1, 0, NUM_SEQ_PATTERN - 1); + seq.active_track = constrain(seq.active_track + 1, 0, NUM_SEQ_PATTERN - 1); else if (LCDML.BT_checkUp()) - seq.seq_active_track = constrain(seq.seq_active_track - 1, 0, NUM_SEQ_PATTERN - 1); + seq.active_track = constrain(seq.active_track - 1, 0, NUM_SEQ_PATTERN - 1); - lcd.setCursor(1, 0); - if (seq.seq_content_type[seq.seq_active_track] == 0) lcd.print("Drum "); else if (seq.seq_content_type[seq.seq_active_track] == 1) lcd.print("Instr "); else if (seq.seq_content_type[seq.seq_active_track] == 2) lcd.print("Chord "); else lcd.print("Arp "); + display.setCursor(1, 0); + if (seq.content_type[seq.active_track] == 0) display.print("Drum "); else if (seq.content_type[seq.active_track] == 1) display.print("Instr "); else if (seq.content_type[seq.active_track] == 2) display.print("Chord "); else display.print("Arp "); } } if (LCDML.BT_checkEnter()) //handle button presses during menu >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> { - if (seq.seq_menu > 2 && seq.seq_menu < 19 && seq.seq_vel[seq.seq_active_track][seq.seq_menu - 3] > 209 && seq_active_function != 40 && activesample != NUM_DRUMSET_CONFIG - 1) //edit pitch of sample + if (seq.menu > 2 && seq.menu < 19 && seq.vel[seq.active_track][seq.menu - 3] > 209 && seq_active_function != 40 && activesample != NUM_DRUMSET_CONFIG - 1) //edit pitch of sample { seq_active_function = 40; } else if ( seq_active_function == 40 ) // get out of pitch edit for samples { - lcd.setCursor(8, 0); - lcd.print(" "); + display.setCursor(8, 0); + display.print(" "); seq_active_function = 0; activesample = 0; seq_refresh_display_play_status(); seq_printAllSeqSteps(); - } else if (seq.seq_menu == 34 ) //transpose pattern + } else if (seq.menu == 34 ) //transpose pattern { - seq.seq_menu = 0; + seq.menu = 0; seq_active_function = 0; activesample = 0; - temp_int = seq.seq_data[seq.seq_active_track][0]; - lcd.setCursor(8, 0); - lcd.print(" "); - lcd.setCursor(12, 0); - lcd.print(" "); - lcd.setCursor(13, 0); - if (seq.seq_active_track < 10)lcd.print("0"); - lcd.print(seq.seq_active_track); + temp_int = seq.data[seq.active_track][0]; + display.setCursor(8, 0); + display.print(" "); + display.setCursor(12, 0); + display.print(" "); + display.setCursor(13, 0); + if (seq.active_track < 10)display.print("0"); + display.print(seq.active_track); seq_refresh_display_play_status(); seq_printAllSeqSteps(); } - else if (seq.seq_menu == 32 && seq_active_function == 97) //fill pattern every 1/4, 1/8, 1/16 step with active sample/note step 1 + else if (seq.menu == 32 && seq_active_function == 97) //fill pattern every 1/4, 1/8, 1/16 step with active sample/note step 1 { seq_active_function = 96; - seq.seq_menu = 33; - } else if (seq.seq_menu == 33 && seq_active_function == 95) //fill pattern every 1/4, 1/8, 1/16 step with active sample/note step 2 + seq.menu = 33; + } else if (seq.menu == 33 && seq_active_function == 95) //fill pattern every 1/4, 1/8, 1/16 step with active sample/note step 2 { - if (seq.seq_content_type[seq.seq_active_track] == 0) { //Drumtrack + if (seq.content_type[seq.active_track] == 0) { //Drumtrack for (uint8_t i = 0; i < 16; i++) { - seq.seq_data[seq.seq_active_track][i] = drum_config[seq.seq_temp_select_menu].midinote; - seq.seq_vel[seq.seq_active_track][i] = 120; - if (seq.seq_temp_active_menu == 0) i = i + 3; else if (seq.seq_temp_active_menu == 1) i = i + 1; + seq.data[seq.active_track][i] = drum_config[seq.temp_select_menu].midinote; + seq.vel[seq.active_track][i] = 120; + if (seq.temp_active_menu == 0) i = i + 3; else if (seq.temp_active_menu == 1) i = i + 1; } } else { //Inst. Track for (uint8_t i = 0; i < 16; i++) { - seq.seq_data[seq.seq_active_track][i] = seq.seq_temp_select_menu; - seq.seq_vel[seq.seq_active_track][i] = 120; - if (seq.seq_temp_active_menu == 0) i = i + 3; else if (seq.seq_temp_active_menu == 1) i = i + 1; + seq.data[seq.active_track][i] = seq.temp_select_menu; + seq.vel[seq.active_track][i] = 120; + if (seq.temp_active_menu == 0) i = i + 3; else if (seq.temp_active_menu == 1) i = i + 1; } } - seq.seq_menu = 0; + seq.menu = 0; seq_active_function = 0; activesample = 0; - temp_int = seq.seq_data[seq.seq_active_track][0]; - lcd.setCursor(8, 0); - lcd.print(" "); + temp_int = seq.data[seq.active_track][0]; + display.setCursor(8, 0); + display.print(" "); seq_refresh_display_play_status(); seq_printAllSeqSteps(); - } else if (seq.seq_menu == 31 && seq_active_function != 40) //copy patterns + } else if (seq.menu == 31 && seq_active_function != 40) //copy patterns { - memcpy( seq.seq_data[temp_int], seq.seq_data[seq.seq_active_track], sizeof(seq.seq_data[0])); - memcpy( seq.seq_vel[temp_int], seq.seq_vel[seq.seq_active_track], sizeof(seq.seq_vel[0])); - seq.seq_content_type[temp_int] = seq.seq_content_type[seq.seq_active_track]; - seq.seq_menu = 0; + memcpy( seq.data[temp_int], seq.data[seq.active_track], sizeof(seq.data[0])); + memcpy( seq.vel[temp_int], seq.vel[seq.active_track], sizeof(seq.vel[0])); + seq.content_type[temp_int] = seq.content_type[seq.active_track]; + seq.menu = 0; seq_active_function = 0; activesample = 0; - temp_int = seq.seq_data[seq.seq_active_track][0]; - lcd.setCursor(8, 0); - lcd.print(" "); + temp_int = seq.data[seq.active_track][0]; + display.setCursor(8, 0); + display.print(" "); seq_refresh_display_play_status(); seq_printAllSeqSteps(); - } else if (seq.seq_menu == 30 && seq_active_function != 40) //swap patterns + } else if (seq.menu == 30 && seq_active_function != 40) //swap patterns { uint8_t data_temp[1][16]; uint8_t vel_temp[1][16]; uint8_t content_type_temp; - memcpy( data_temp[0], seq.seq_data[seq.seq_active_track], sizeof(data_temp[0])); - memcpy( vel_temp[0], seq.seq_vel[seq.seq_active_track], sizeof(vel_temp[0])); - content_type_temp = seq.seq_content_type[seq.seq_active_track]; - memcpy( seq.seq_data[seq.seq_active_track], seq.seq_data[temp_int], sizeof(data_temp[0])); - memcpy( seq.seq_vel[seq.seq_active_track], seq.seq_vel[temp_int], sizeof(vel_temp[0])); - seq.seq_content_type[seq.seq_active_track] = seq.seq_content_type[temp_int]; - memcpy( seq.seq_data[temp_int], data_temp[0], sizeof(data_temp[0])); - memcpy( seq.seq_vel[temp_int], vel_temp[0], sizeof(vel_temp[0])); - seq.seq_content_type[temp_int] = content_type_temp; - seq.seq_menu = 0; + memcpy( data_temp[0], seq.data[seq.active_track], sizeof(data_temp[0])); + memcpy( vel_temp[0], seq.vel[seq.active_track], sizeof(vel_temp[0])); + content_type_temp = seq.content_type[seq.active_track]; + memcpy( seq.data[seq.active_track], seq.data[temp_int], sizeof(data_temp[0])); + memcpy( seq.vel[seq.active_track], seq.vel[temp_int], sizeof(vel_temp[0])); + seq.content_type[seq.active_track] = seq.content_type[temp_int]; + memcpy( seq.data[temp_int], data_temp[0], sizeof(data_temp[0])); + memcpy( seq.vel[temp_int], vel_temp[0], sizeof(vel_temp[0])); + seq.content_type[temp_int] = content_type_temp; + seq.menu = 0; seq_active_function = 0; activesample = 0; - lcd.setCursor(8, 0); - lcd.print(" "); - temp_int = seq.seq_data[seq.seq_active_track][0]; + display.setCursor(8, 0); + display.print(" "); + temp_int = seq.data[seq.active_track][0]; seq_refresh_display_play_status(); seq_printAllSeqSteps(); } - if ( seq.seq_menu == 0 && seq_active_function == 99) + if ( seq.menu == 0 && seq_active_function == 99) { seq_active_function = 0; - } else if ( seq.seq_menu == 0 && seq_active_function == 0) + } else if ( seq.menu == 0 && seq_active_function == 0) { - if ( (seq.seq_content_type[seq.seq_active_track] == 0 && activesample == NUM_DRUMSET_CONFIG + 5) || (seq.seq_content_type[seq.seq_active_track] > 0 && temp_int == 116) ) + if ( (seq.content_type[seq.active_track] == 0 && activesample == NUM_DRUMSET_CONFIG + 5) || (seq.content_type[seq.active_track] > 0 && temp_int == 116) ) { //transpose pattern - lcd.setCursor(0, 0); - lcd.print("Transpose:[ 00]"); + display.setCursor(0, 0); + display.print("Transpose:[ 00]"); for (uint8_t i = 0; i < 16; i++) { - seq.seq_data_buffer[i] = seq.seq_data[seq.seq_active_track][i]; + seq.data_buffer[i] = seq.data[seq.active_track][i]; } - seq.seq_menu = 34; + seq.menu = 34; temp_int = 0; - seq.seq_temp_select_menu = 0; - seq.seq_temp_active_menu = 0; + seq.temp_select_menu = 0; + seq.temp_active_menu = 0; } - if ( (seq.seq_content_type[seq.seq_active_track] == 0 && activesample == NUM_DRUMSET_CONFIG + 4) || (seq.seq_content_type[seq.seq_active_track] > 0 && temp_int == 115) ) + if ( (seq.content_type[seq.active_track] == 0 && activesample == NUM_DRUMSET_CONFIG + 4) || (seq.content_type[seq.active_track] > 0 && temp_int == 115) ) { //fill patterns - lcd.setCursor(0, 0); - lcd.print("Fill Pattern:"); - lcd.setCursor(9, 1); - lcd.print(" "); - seq.seq_menu = 32; - seq.seq_temp_select_menu = 0; - seq.seq_temp_active_menu = 0; + display.setCursor(0, 0); + display.print("Fill Pattern:"); + display.setCursor(9, 1); + display.print(" "); + seq.menu = 32; + seq.temp_select_menu = 0; + seq.temp_active_menu = 0; } - else if ( (seq.seq_content_type[seq.seq_active_track] == 0 && activesample == NUM_DRUMSET_CONFIG + 3) || (seq.seq_content_type[seq.seq_active_track] > 0 && temp_int == 114) ) + else if ( (seq.content_type[seq.active_track] == 0 && activesample == NUM_DRUMSET_CONFIG + 3) || (seq.content_type[seq.active_track] > 0 && temp_int == 114) ) { //swap patterns: Active pattern <-> destination pattern - lcd.setCursor(0, 0); - lcd.print("SwapPattern:"); - temp_int = seq.seq_active_track + 1; + display.setCursor(0, 0); + display.print("SwapPattern:"); + temp_int = seq.active_track + 1; if (temp_int > NUM_SEQ_PATTERN - 1)temp_int = 0; - seq.seq_menu = 30; - } else if ( ( seq.seq_content_type[seq.seq_active_track] == 0 && activesample == NUM_DRUMSET_CONFIG + 2) || ( seq.seq_content_type[seq.seq_active_track] > 0 && temp_int == 113) ) + seq.menu = 30; + } else if ( ( seq.content_type[seq.active_track] == 0 && activesample == NUM_DRUMSET_CONFIG + 2) || ( seq.content_type[seq.active_track] > 0 && temp_int == 113) ) { //copy pattern - lcd.setCursor(0, 0); - lcd.print("Copy Pattern:"); - temp_int = seq.seq_active_track + 1; + display.setCursor(0, 0); + display.print("Copy Pattern:"); + temp_int = seq.active_track + 1; if (temp_int > NUM_SEQ_PATTERN - 1)temp_int = 0; - seq.seq_menu = 31; - } else if ( (seq.seq_content_type[seq.seq_active_track] == 0 && activesample == NUM_DRUMSET_CONFIG + 1) || (seq.seq_content_type[seq.seq_active_track] > 0 && temp_int == 112) ) + seq.menu = 31; + } else if ( (seq.content_type[seq.active_track] == 0 && activesample == NUM_DRUMSET_CONFIG + 1) || (seq.content_type[seq.active_track] > 0 && temp_int == 112) ) { //clear all patterns seq_clear_all_patterns(); seq_printAllSeqSteps(); - } else if ( (seq.seq_content_type[seq.seq_active_track] == 0 && activesample == NUM_DRUMSET_CONFIG) || (seq.seq_content_type[seq.seq_active_track] > 0 && temp_int == 111) ) + } else if ( (seq.content_type[seq.active_track] == 0 && activesample == NUM_DRUMSET_CONFIG) || (seq.content_type[seq.active_track] > 0 && temp_int == 111) ) { //clear pattern seq_clear_active_pattern(); seq_printAllSeqSteps(); } seq_active_function = 99; } - if ( seq.seq_menu == 1 && seq_active_function != 40) + if ( seq.menu == 1 && seq_active_function != 40) { - if (seq.seq_running == false && seq.seq_recording == false) + if (seq.running == false && seq.recording == false) { handleStart(); - } else if (seq.seq_running == true && seq.seq_recording == false) + } else if (seq.running == true && seq.recording == false) { - seq.seq_running = true; - seq.seq_recording = true; - seq.seq_note_in = 0; - } else if (seq.seq_running == true && seq.seq_recording == true) + seq.running = true; + seq.recording = true; + seq.note_in = 0; + } else if (seq.running == true && seq.recording == true) { handleStop(); } - } else if ( seq.seq_menu == 2 && seq_active_function != 40) + } else if ( seq.menu == 2 && seq_active_function != 40) { if (seq_active_function != 2) seq_active_function = 2; else seq_active_function = 99; - if (seq.seq_content_type[seq.seq_active_track] == 0) + if (seq.content_type[seq.active_track] == 0) { if (activesample < NUM_DRUMSET_CONFIG - 1) - lcd.show(0, 1, 6, basename(drum_config[activesample].name)); + display.show(0, 1, 6, basename(drum_config[activesample].name)); } else { if (temp_int < 109) { - lcd.setCursor(3, 0); - lcd.print(" "); - lcd.setCursor(1, 0); - lcd.print(noteNames[temp_int % 12 ]); - lcd.print( (temp_int / 12) - 1); + display.setCursor(3, 0); + display.print(" "); + display.setCursor(1, 0); + display.print(noteNames[temp_int % 12 ]); + display.print( (temp_int / 12) - 1); } } - } else if (seq.seq_menu > 2 && seq.seq_menu < 30 && seq_active_function != 40) + } else if (seq.menu > 2 && seq.menu < 30 && seq_active_function != 40) { if (seq_active_function == 99) { - if (seq.seq_content_type[seq.seq_active_track] == 0) + if (seq.content_type[seq.active_track] == 0) { //Drumtrack if ( drum_config[activesample].midinote > 209 ) //it is a pitched sample { - seq.seq_vel[seq.seq_active_track][seq.seq_menu - 3] = drum_config[activesample].midinote; - //seq.seq_data[seq.seq_active_track][seq.seq_menu - 3] = MIDI_C4; + seq.vel[seq.active_track][seq.menu - 3] = drum_config[activesample].midinote; + //seq.data[seq.active_track][seq.menu - 3] = MIDI_C4; } else // if (activesample == NUM_DRUMSET_CONFIG - 1) //user selected EMPTY note for pitched sample // { - // seq.seq_data[seq.seq_active_track][seq.seq_menu - 3] = 0; - // seq.seq_vel[seq.seq_active_track][seq.seq_menu - 3] = 0; + // seq.data[seq.active_track][seq.menu - 3] = 0; + // seq.vel[seq.active_track][seq.menu - 3] = 0; // } // else //check if note is already there, if not -> insert it, else remove it from grid. - if (seq.seq_data[seq.seq_active_track][seq.seq_menu - 3] == drum_config[activesample].midinote) + if (seq.data[seq.active_track][seq.menu - 3] == drum_config[activesample].midinote) { - seq.seq_data[seq.seq_active_track][seq.seq_menu - 3] = 0; - seq.seq_vel[seq.seq_active_track][seq.seq_menu - 3] = 0; + seq.data[seq.active_track][seq.menu - 3] = 0; + seq.vel[seq.active_track][seq.menu - 3] = 0; } else { - seq.seq_data[seq.seq_active_track][seq.seq_menu - 3] = drum_config[activesample].midinote; - seq.seq_vel[seq.seq_active_track][seq.seq_menu - 3] = 120; + seq.data[seq.active_track][seq.menu - 3] = drum_config[activesample].midinote; + seq.vel[seq.active_track][seq.menu - 3] = 120; } } else { //Inst. Track - if (temp_int == 109 || seq.seq_data[seq.seq_active_track][seq.seq_menu - 3] == temp_int ) + if (temp_int == 109 || seq.data[seq.active_track][seq.menu - 3] == temp_int ) { //clear note - seq.seq_data[seq.seq_active_track][seq.seq_menu - 3] = 0; - seq.seq_vel[seq.seq_active_track][seq.seq_menu - 3] = 0; + seq.data[seq.active_track][seq.menu - 3] = 0; + seq.vel[seq.active_track][seq.menu - 3] = 0; } else if (temp_int == 110) { //latch note - seq.seq_data[seq.seq_active_track][seq.seq_menu - 3] = 130; - //seq.seq_vel[seq.seq_active_track][seq.seq_menu - 3] = 0; + seq.data[seq.active_track][seq.menu - 3] = 130; + //seq.vel[seq.active_track][seq.menu - 3] = 0; } else { - seq.seq_data[seq.seq_active_track][seq.seq_menu - 3] = temp_int; - seq.seq_vel[seq.seq_active_track][seq.seq_menu - 3] = 120; + seq.data[seq.active_track][seq.menu - 3] = temp_int; + seq.vel[seq.active_track][seq.menu - 3] = 120; } } } @@ -6089,334 +6089,334 @@ void UI_func_seq_pattern_editor(uint8_t param) } //button check end <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< - if (seq.seq_menu == 34 && seq_active_function == 94) + if (seq.menu == 34 && seq_active_function == 94) { //transpose char displayname[4] = {0, 0, 0, 0}; - lcd.setCursor(10, 0); - lcd.print("["); - lcd.setCursor(11, 0); + display.setCursor(10, 0); + display.print("["); + display.setCursor(11, 0); if (temp_int > 0) { - lcd.print("+"); + display.print("+"); } else if (temp_int < 0) { - lcd.print("-"); + display.print("-"); } else { - lcd.print(" "); + display.print(" "); } sprintf(displayname, "%02d", abs(temp_int)); - lcd.print( displayname); - lcd.print("]"); + display.print( displayname); + display.print("]"); for (uint8_t i = 0; i < 16; i++) { - if (seq.seq_content_type[seq.seq_active_track] == 0) { //drums - if (seq.seq_data_buffer[i] != 0 && seq.seq_data_buffer[i] + temp_int >= 0 && seq.seq_data_buffer[i] + temp_int < 254 - && seq.seq_vel[seq.seq_active_track][i] >= 210 ) // pitched drums only - seq.seq_data[seq.seq_active_track][i] = seq.seq_data_buffer[i] + temp_int; + if (seq.content_type[seq.active_track] == 0) { //drums + if (seq.data_buffer[i] != 0 && seq.data_buffer[i] + temp_int >= 0 && seq.data_buffer[i] + temp_int < 254 + && seq.vel[seq.active_track][i] >= 210 ) // pitched drums only + seq.data[seq.active_track][i] = seq.data_buffer[i] + temp_int; } else //instruments - if (seq.seq_content_type[seq.seq_active_track] > 0) { - if (seq.seq_data_buffer[i] != 0 && seq.seq_data_buffer[i] != 130 && seq.seq_data_buffer[i] + temp_int > 0 && seq.seq_data_buffer[i] + temp_int < 254) - seq.seq_data[seq.seq_active_track][i] = seq.seq_data_buffer[i] + temp_int; + if (seq.content_type[seq.active_track] > 0) { + if (seq.data_buffer[i] != 0 && seq.data_buffer[i] != 130 && seq.data_buffer[i] + temp_int > 0 && seq.data_buffer[i] + temp_int < 254) + seq.data[seq.active_track][i] = seq.data_buffer[i] + temp_int; } } seq_printAllSeqSteps(); } - else if (seq.seq_menu == 33) + else if (seq.menu == 33) { //fill pattern 2nd parameter - lcd.setCursor(4, 1); - lcd.print(" "); - lcd.setCursor(9, 1); - lcd.print(" "); - lcd.setCursor(10, 1); - lcd.print("["); - lcd.setCursor(15, 1); - lcd.print("]"); - lcd.setCursor(11, 1); - if (seq.seq_temp_active_menu == 0) lcd.print(" 1/4"); - else if (seq.seq_temp_active_menu == 1) lcd.print(" 1/8"); - else if (seq.seq_temp_active_menu == 2) lcd.print("1/16"); - } else if (seq.seq_menu == 32 ) { //fill pattern - if (seq.seq_content_type[seq.seq_active_track] == 0) { //drum - lcd.setCursor(0, 1); - lcd.print("with"); - lcd.setCursor(4, 1); - lcd.print("["); - lcd.setCursor(9, 1); - lcd.print("]"); - lcd.show(1, 5, 4, basename(drum_config[seq.seq_temp_select_menu].name)); - lcd.setCursor(11, 1); - if (seq.seq_temp_active_menu == 0) lcd.print(" 1/4"); - else if (seq.seq_temp_active_menu == 1) lcd.print(" 1/8"); - else if (seq.seq_temp_active_menu == 2) lcd.print("1/16"); + display.setCursor(4, 1); + display.print(" "); + display.setCursor(9, 1); + display.print(" "); + display.setCursor(10, 1); + display.print("["); + display.setCursor(15, 1); + display.print("]"); + display.setCursor(11, 1); + if (seq.temp_active_menu == 0) display.print(" 1/4"); + else if (seq.temp_active_menu == 1) display.print(" 1/8"); + else if (seq.temp_active_menu == 2) display.print("1/16"); + } else if (seq.menu == 32 ) { //fill pattern + if (seq.content_type[seq.active_track] == 0) { //drum + display.setCursor(0, 1); + display.print("with"); + display.setCursor(4, 1); + display.print("["); + display.setCursor(9, 1); + display.print("]"); + display.show(1, 5, 4, basename(drum_config[seq.temp_select_menu].name)); + display.setCursor(11, 1); + if (seq.temp_active_menu == 0) display.print(" 1/4"); + else if (seq.temp_active_menu == 1) display.print(" 1/8"); + else if (seq.temp_active_menu == 2) display.print("1/16"); } else { //inst - lcd.setCursor(0, 1); - lcd.print("with"); - lcd.setCursor(4, 1); - lcd.print("["); - lcd.setCursor(5, 1); - lcd.print(noteNames[seq.seq_temp_select_menu % 12 ]); - lcd.print( (seq.seq_temp_select_menu / 12) - 1); - lcd.print(" "); - lcd.setCursor(9, 1); - lcd.print("]"); - lcd.setCursor(11, 1); - if (seq.seq_temp_active_menu == 0) lcd.print(" 1/4"); - else if (seq.seq_temp_active_menu == 1) lcd.print(" 1/8"); - else if (seq.seq_temp_active_menu == 2) lcd.print("1/16"); - } - } else if (seq.seq_menu == 31) { //copy pattern - lcd.setCursor(12, 0); - lcd.print("["); - lcd.setCursor(15, 0); - lcd.print("]"); - lcd.setCursor(0, 1); - lcd.print(" to:[ ]"); - lcd.setCursor(13, 1); - if (temp_int < 10) lcd.print("0"); - lcd.print(temp_int); - } else if (seq.seq_menu == 30) { //swap pattern - lcd.setCursor(12, 0); - lcd.print("["); - lcd.setCursor(15, 0); - lcd.print("]"); - lcd.setCursor(0, 1); - lcd.print(" with:[ ]"); - lcd.setCursor(13, 1); - if (temp_int < 10) lcd.print("0"); - lcd.print(temp_int); - } else if (seq.seq_menu == 0) { + display.setCursor(0, 1); + display.print("with"); + display.setCursor(4, 1); + display.print("["); + display.setCursor(5, 1); + display.print(noteNames[seq.temp_select_menu % 12 ]); + display.print( (seq.temp_select_menu / 12) - 1); + display.print(" "); + display.setCursor(9, 1); + display.print("]"); + display.setCursor(11, 1); + if (seq.temp_active_menu == 0) display.print(" 1/4"); + else if (seq.temp_active_menu == 1) display.print(" 1/8"); + else if (seq.temp_active_menu == 2) display.print("1/16"); + } + } else if (seq.menu == 31) { //copy pattern + display.setCursor(12, 0); + display.print("["); + display.setCursor(15, 0); + display.print("]"); + display.setCursor(0, 1); + display.print(" to:[ ]"); + display.setCursor(13, 1); + if (temp_int < 10) display.print("0"); + display.print(temp_int); + } else if (seq.menu == 30) { //swap pattern + display.setCursor(12, 0); + display.print("["); + display.setCursor(15, 0); + display.print("]"); + display.setCursor(0, 1); + display.print(" with:[ ]"); + display.setCursor(13, 1); + if (temp_int < 10) display.print("0"); + display.print(temp_int); + } else if (seq.menu == 0) { #ifdef TESTDISPLAY20x4 - lcd.setCursor(13, 0); - lcd.print(" "); - lcd.setCursor(15, 0); - lcd.print(" "); + display.setCursor(13, 0); + display.print(" "); + display.setCursor(15, 0); + display.print(" "); #else - lcd.setCursor(9, 0); - lcd.print(" "); - lcd.setCursor(11, 0); - lcd.print(" "); + display.setCursor(9, 0); + display.print(" "); + display.setCursor(11, 0); + display.print(" "); #endif - lcd.setCursor(0, 0); - lcd.print("["); - if (seq.seq_content_type[seq.seq_active_track] == 0) //Drum Mode + display.setCursor(0, 0); + display.print("["); + if (seq.content_type[seq.active_track] == 0) //Drum Mode { if (activesample < NUM_DRUMSET_CONFIG - 1) { - lcd.show(0, 1, 6, basename(drum_config[activesample].name)); + display.show(0, 1, 6, basename(drum_config[activesample].name)); } else if (activesample == NUM_DRUMSET_CONFIG - 1) { - lcd.setCursor(1, 0); - lcd.print("EMPTY "); + display.setCursor(1, 0); + display.print("EMPTY "); } else if (activesample == NUM_DRUMSET_CONFIG ) { - lcd.setCursor(1, 0); - lcd.print("ClrPat"); + display.setCursor(1, 0); + display.print("ClrPat"); } else if (activesample == NUM_DRUMSET_CONFIG + 1) { - lcd.setCursor(1, 0); - lcd.print("ClrAll"); + display.setCursor(1, 0); + display.print("ClrAll"); } else if (activesample == NUM_DRUMSET_CONFIG + 2) { - lcd.setCursor(1, 0); - lcd.print("Copy P"); + display.setCursor(1, 0); + display.print("Copy P"); } else if (activesample == NUM_DRUMSET_CONFIG + 3) { - lcd.setCursor(1, 0); - lcd.print("Swap P"); + display.setCursor(1, 0); + display.print("Swap P"); } else if (activesample == NUM_DRUMSET_CONFIG + 4) { - lcd.setCursor(1, 0); - lcd.print("Fill P"); + display.setCursor(1, 0); + display.print("Fill P"); } else if (activesample == NUM_DRUMSET_CONFIG + 5) { - lcd.setCursor(1, 0); - lcd.print("Transp"); + display.setCursor(1, 0); + display.print("Transp"); } - lcd.setCursor(7, 0); - lcd.print("]"); + display.setCursor(7, 0); + display.print("]"); } else //Inst. Mode { if (temp_int < 109) { - lcd.setCursor(3, 0); - lcd.print(" "); - lcd.setCursor(1, 0); - lcd.print(noteNames[temp_int % 12 ]); - lcd.print( (temp_int / 12) - 1); + display.setCursor(3, 0); + display.print(" "); + display.setCursor(1, 0); + display.print(noteNames[temp_int % 12 ]); + display.print( (temp_int / 12) - 1); } else if (temp_int == 109) { - lcd.setCursor(1, 0); - lcd.print("EMPTY "); + display.setCursor(1, 0); + display.print("EMPTY "); } else if (temp_int == 110) { - lcd.setCursor(1, 0); - lcd.print("LATCH "); + display.setCursor(1, 0); + display.print("LATCH "); } else if (temp_int == 111) { - lcd.setCursor(1, 0); - lcd.print("ClrPat"); + display.setCursor(1, 0); + display.print("ClrPat"); } else if (temp_int == 112) { - lcd.setCursor(1, 0); - lcd.print("ClrAll"); + display.setCursor(1, 0); + display.print("ClrAll"); } else if (temp_int == 113) { - lcd.setCursor(1, 0); - lcd.print("Copy P"); + display.setCursor(1, 0); + display.print("Copy P"); } else if (temp_int == 114) { - lcd.setCursor(1, 0); - lcd.print("Swap P"); + display.setCursor(1, 0); + display.print("Swap P"); } else if (temp_int == 115) { - lcd.setCursor(1, 0); - lcd.print("Fill P"); + display.setCursor(1, 0); + display.print("Fill P"); } else if (temp_int == 116) { - lcd.setCursor(1, 0); - lcd.print("Transp"); + display.setCursor(1, 0); + display.print("Transp"); } - lcd.setCursor(7, 0); - lcd.print("]"); + display.setCursor(7, 0); + display.print("]"); } } - else if (seq.seq_menu == 1) { - lcd.setCursor(0, 0); - lcd.print(" "); - lcd.setCursor(7, 0); - lcd.print(" "); + else if (seq.menu == 1) { + display.setCursor(0, 0); + display.print(" "); + display.setCursor(7, 0); + display.print(" "); #ifdef TESTDISPLAY20x4 - lcd.setCursor(16, 0); - lcd.print(" "); - lcd.setCursor(19, 0); - lcd.print(" "); + display.setCursor(16, 0); + display.print(" "); + display.setCursor(19, 0); + display.print(" "); #else - lcd.setCursor(12, 0); - lcd.print(" "); - lcd.setCursor(15, 0); - lcd.print(" "); + display.setCursor(12, 0); + display.print(" "); + display.setCursor(15, 0); + display.print(" "); #endif #ifdef TESTDISPLAY20x4 - lcd.setCursor(13, 0); - lcd.print("["); + display.setCursor(13, 0); + display.print("["); seq_refresh_display_play_status(); - lcd.setCursor(15, 0); - lcd.print("]"); + display.setCursor(15, 0); + display.print("]"); #else - lcd.setCursor(9, 0); - lcd.print("["); + display.setCursor(9, 0); + display.print("["); seq_refresh_display_play_status(); - lcd.setCursor(11, 0); - lcd.print("]"); + display.setCursor(11, 0); + display.print("]"); #endif } - if (seq.seq_menu == 2) { + if (seq.menu == 2) { #ifdef TESTDISPLAY20x4 - lcd.setCursor(13, 0); - lcd.print(" "); - lcd.setCursor(15, 0); - lcd.print(" "); - lcd.setCursor(16, 0); - lcd.print("["); - lcd.setCursor(17, 0); - if (seq.seq_active_track < 10) lcd.print("0"); - lcd.print(seq.seq_active_track); - lcd.setCursor(19, 0); - lcd.print("]"); + display.setCursor(13, 0); + display.print(" "); + display.setCursor(15, 0); + display.print(" "); + display.setCursor(16, 0); + display.print("["); + display.setCursor(17, 0); + if (seq.active_track < 10) display.print("0"); + display.print(seq.active_track); + display.setCursor(19, 0); + display.print("]"); #else - lcd.setCursor(9, 0); - lcd.print(" "); - lcd.setCursor(11, 0); - lcd.print(" "); - lcd.setCursor(12, 0); - lcd.print("["); - lcd.setCursor(13, 0); - if (seq.seq_active_track < 10) lcd.print("0"); - lcd.print(seq.seq_active_track); - lcd.setCursor(15, 0); - lcd.print("]"); - if (seq.seq_content_type[seq.seq_active_track] == 0) //Drum Mode - { - lcd.setCursor(0, 0); - lcd.print(" "); - lcd.show(0, 1, 6, basename(drum_config[activesample].name)); - lcd.print(" "); - } -#endif - lcd.setCursor(0, 1); + display.setCursor(9, 0); + display.print(" "); + display.setCursor(11, 0); + display.print(" "); + display.setCursor(12, 0); + display.print("["); + display.setCursor(13, 0); + if (seq.active_track < 10) display.print("0"); + display.print(seq.active_track); + display.setCursor(15, 0); + display.print("]"); + if (seq.content_type[seq.active_track] == 0) //Drum Mode + { + display.setCursor(0, 0); + display.print(" "); + display.show(0, 1, 6, basename(drum_config[activesample].name)); + display.print(" "); + } +#endif + display.setCursor(0, 1); seq_printAllSeqSteps(); #ifdef TESTDISPLAY20x4 seq_printVelGraphBar(); #endif } - if (seq.seq_menu == 3) { + if (seq.menu == 3) { #ifdef TESTDISPLAY20x4 - lcd.setCursor(16, 0); - lcd.print(" "); - lcd.setCursor(19, 0); - lcd.print(" "); + display.setCursor(16, 0); + display.print(" "); + display.setCursor(19, 0); + display.print(" "); #else - lcd.setCursor(12, 0); - lcd.print(" "); - lcd.setCursor(15, 0); - lcd.print(" "); + display.setCursor(12, 0); + display.print(" "); + display.setCursor(15, 0); + display.print(" "); #endif - // lcd.setCursor(0, 1); - // lcd.print("_"); - // lcd.setCursor(1, 1); - // lcd.print(seq_find_shortname(1)[0]); + // display.setCursor(0, 1); + // display.print("_"); + // display.setCursor(1, 1); + // display.print(seq_find_shortname(1)[0]); } - if (seq.seq_menu > 2 && seq.seq_menu < 19 && seq_active_function != 40) + if (seq.menu > 2 && seq.menu < 19 && seq_active_function != 40) { - if (seq.seq_menu == 3) - lcd.setCursor(0, 1); + if (seq.menu == 3) + display.setCursor(0, 1); else - lcd.setCursor(seq.seq_menu - 3, 1); - lcd.write(219); // cursor symbol + display.setCursor(seq.menu - 3, 1); + display.write(219); // cursor symbol - if (seq.seq_menu > 3) + if (seq.menu > 3) { - lcd.setCursor(seq.seq_menu - 4, 1); + display.setCursor(seq.menu - 4, 1); - lcd.print(seq_find_shortname(seq.seq_menu - 4)[0]); + display.print(seq_find_shortname(seq.menu - 4)[0]); } - if (seq.seq_menu < 18) + if (seq.menu < 18) { - lcd.setCursor(seq.seq_menu - 2, 1); - lcd.print(seq_find_shortname(seq.seq_menu - 2)[0]); + display.setCursor(seq.menu - 2, 1); + display.print(seq_find_shortname(seq.menu - 2)[0]); } - if (seq.seq_vel[seq.seq_active_track][seq.seq_menu - 3] > 209 && activesample != NUM_DRUMSET_CONFIG - 1 ) //is pitched sample and selected item is not set to EMPTY + if (seq.vel[seq.active_track][seq.menu - 3] > 209 && activesample != NUM_DRUMSET_CONFIG - 1 ) //is pitched sample and selected item is not set to EMPTY { - lcd.setCursor(0, 0); - lcd.print("[EDIT "); + display.setCursor(0, 0); + display.print("[EDIT "); seq_print_current_note(); - lcd.setCursor(8, 0); - lcd.print("?]"); + display.setCursor(8, 0); + display.print("?]"); } else //print current sample name on active step if not empty - if (seq.seq_data[seq.seq_active_track][seq.seq_menu - 3] > 0) + if (seq.data[seq.active_track][seq.menu - 3] > 0) { - lcd.setCursor(0, 0); - lcd.print(" "); - lcd.show(0, 1, 6, seq_find_drum_name_from_note( seq.seq_data[seq.seq_active_track][seq.seq_menu - 3]) ); - lcd.print(" "); + display.setCursor(0, 0); + display.print(" "); + display.show(0, 1, 6, seq_find_drum_name_from_note( seq.data[seq.active_track][seq.menu - 3]) ); + display.print(" "); } else { //if step empty, print selected, active sample - if (seq.seq_data[seq.seq_active_track][seq.seq_menu - 3] == 0) - lcd.setCursor(0, 0); - lcd.print(" "); - lcd.show(0, 1, 6, basename(drum_config[activesample].name)); - lcd.print(" "); + if (seq.data[seq.active_track][seq.menu - 3] == 0) + display.setCursor(0, 0); + display.print(" "); + display.show(0, 1, 6, basename(drum_config[activesample].name)); + display.print(" "); } } else if (seq_active_function == 40 && activesample != NUM_DRUMSET_CONFIG - 1) { //is in pitch edit function 40 - lcd.setCursor(1, 0); - lcd.show(0, 1, 4, basename(drum_config[activesample].name)); - lcd.setCursor(5, 0); - lcd.print("-"); - lcd.setCursor(6, 0); + display.setCursor(1, 0); + display.show(0, 1, 4, basename(drum_config[activesample].name)); + display.setCursor(5, 0); + display.print("-"); + display.setCursor(6, 0); seq_print_current_note(); - lcd.setCursor(9, 0); - lcd.print("]"); + display.setCursor(9, 0); + display.print("]"); } } if (LCDML.FUNC_close()) // ****** STABLE END ********* { encoderDir[ENC_R].reset(); - seq.seq_menu = 0; + seq.menu = 0; seq_active_function = 99; lcd_special_chars(SCROLLBAR); } @@ -6427,49 +6427,49 @@ void UI_func_arpeggio(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { encoderDir[ENC_R].reset(); - lcd.createChar(0, (uint8_t*)special_chars[19]); //play symbol - lcd.createChar(2, (uint8_t*)special_chars[21]); //stop symbol - seq.seq_temp_select_menu = 0; - seq.seq_temp_active_menu = 0; - lcd.setCursor( 0, 0); - lcd.print("Len"); - lcd.setCursor(7, 0); - lcd.print( seq.seq_chord_names[seq.arp_chord][0]); - lcd.print( seq.seq_chord_names[seq.arp_chord][1]); - lcd.print( seq.seq_chord_names[seq.arp_chord][2]); - lcd.print( seq.seq_chord_names[seq.arp_chord][3]); - lcd.setCursor( 0, 1); - lcd.print("Style"); - lcd.setCursor( 11, 1); - lcd.print("1/16"); + display.createChar(0, (uint8_t*)special_chars[19]); //play symbol + display.createChar(2, (uint8_t*)special_chars[21]); //stop symbol + seq.temp_select_menu = 0; + seq.temp_active_menu = 0; + display.setCursor( 0, 0); + display.print("Len"); + display.setCursor(7, 0); + display.print( seq.chord_names[seq.arp_chord][0]); + display.print( seq.chord_names[seq.arp_chord][1]); + display.print( seq.chord_names[seq.arp_chord][2]); + display.print( seq.chord_names[seq.arp_chord][3]); + display.setCursor( 0, 1); + display.print("Style"); + display.setCursor( 11, 1); + display.print("1/16"); arp_refresh_display_play_status(); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) { - if (seq.seq_temp_active_menu == 0) + if (seq.temp_active_menu == 0) { if (LCDML.BT_checkDown()) - seq.seq_temp_select_menu = constrain(seq.seq_temp_select_menu + ENCODER[ENC_R].speed(), 0, 3); + seq.temp_select_menu = constrain(seq.temp_select_menu + ENCODER[ENC_R].speed(), 0, 3); else if (LCDML.BT_checkUp()) - seq.seq_temp_select_menu = constrain(seq.seq_temp_select_menu - ENCODER[ENC_R].speed(), 0, 3); + seq.temp_select_menu = constrain(seq.temp_select_menu - ENCODER[ENC_R].speed(), 0, 3); } - else if (seq.seq_temp_active_menu == 1) // Octave setting + else if (seq.temp_active_menu == 1) // Octave setting { if (LCDML.BT_checkDown()) seq.arp_lenght = constrain(seq.arp_lenght + ENCODER[ENC_R].speed(), 0, 9); else if (LCDML.BT_checkUp()) seq.arp_lenght = constrain(seq.arp_lenght - ENCODER[ENC_R].speed(), 0, 9); } - else if (seq.seq_temp_active_menu == 2) // Style setting + else if (seq.temp_active_menu == 2) // Style setting { if (LCDML.BT_checkDown()) seq.arp_style = constrain(seq.arp_style + ENCODER[ENC_R].speed(), 0, 3); else if (LCDML.BT_checkUp()) seq.arp_style = constrain(seq.arp_style - ENCODER[ENC_R].speed(), 0, 3); } - else if (seq.seq_temp_active_menu == 3) // Arp Speed setting + else if (seq.temp_active_menu == 3) // Arp Speed setting { if (LCDML.BT_checkDown()) seq.arp_speed = constrain(seq.arp_speed + ENCODER[ENC_R].speed(), 0, 1); @@ -6479,118 +6479,118 @@ void UI_func_arpeggio(uint8_t param) if (LCDML.BT_checkEnter()) //handle button presses during menu >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> { - if ( seq.seq_temp_select_menu == 0 && seq.seq_temp_active_menu == 0 ) + if ( seq.temp_select_menu == 0 && seq.temp_active_menu == 0 ) { - seq.seq_temp_active_menu = 1; + seq.temp_active_menu = 1; } - else if ( seq.seq_temp_select_menu == 0 && seq.seq_temp_active_menu == 1 ) + else if ( seq.temp_select_menu == 0 && seq.temp_active_menu == 1 ) { - seq.seq_temp_active_menu = 0; + seq.temp_active_menu = 0; } - if ( seq.seq_temp_select_menu == 1 && seq.seq_temp_active_menu == 0 ) + if ( seq.temp_select_menu == 1 && seq.temp_active_menu == 0 ) { - seq.seq_temp_active_menu = 2; + seq.temp_active_menu = 2; } - else if ( seq.seq_temp_select_menu == 1 && seq.seq_temp_active_menu == 2 ) + else if ( seq.temp_select_menu == 1 && seq.temp_active_menu == 2 ) { - seq.seq_temp_active_menu = 0; + seq.temp_active_menu = 0; } - else if ( seq.seq_temp_select_menu == 2 ) + else if ( seq.temp_select_menu == 2 ) { - if (seq.seq_running) { - seq.seq_running = !seq.seq_running; + if (seq.running) { + seq.running = !seq.running; handleStop(); arp_refresh_display_play_status(); - seq.seq_step = 0; + seq.step = 0; seq.arp_octave = 0; seq.arp_step = 0; - seq.seq_chain_active_step = 0; + seq.chain_active_step = 0; } else { - seq.seq_running = !seq.seq_running; + seq.running = !seq.running; arp_refresh_display_play_status(); handleStart(); } } - else if ( seq.seq_temp_select_menu == 3 && seq.seq_temp_active_menu == 0 ) + else if ( seq.temp_select_menu == 3 && seq.temp_active_menu == 0 ) { - seq.seq_temp_active_menu = 3; + seq.temp_active_menu = 3; } - else if ( seq.seq_temp_select_menu == 3 && seq.seq_temp_active_menu == 3 ) + else if ( seq.temp_select_menu == 3 && seq.temp_active_menu == 3 ) { - seq.seq_temp_active_menu = 0; + seq.temp_active_menu = 0; } } } - lcd.setCursor( 4, 0); - if (seq.arp_lenght == 0) lcd.print("A"); else lcd.print(seq.arp_lenght); //play all elements or from 1-xx elements - lcd.setCursor( 6, 1); - lcd.print( seq.arp_style_names[seq.arp_style][0] ); - lcd.print( seq.arp_style_names[seq.arp_style][1] ); - lcd.print( seq.arp_style_names[seq.arp_style][2] ); - lcd.setCursor( 11, 1); - if (seq.arp_speed == 0)lcd.print("1/16"); else if (seq.arp_speed == 1)lcd.print("1/8 "); - - if (seq.seq_temp_select_menu == 0) { - lcd.setCursor( 3, 0); - lcd.print("["); - lcd.setCursor( 5, 0); - lcd.print("]"); - lcd.setCursor( 5, 1); - lcd.print(" "); - lcd.setCursor( 9, 1); - lcd.print(" "); - lcd.setCursor( 13, 1); - lcd.print(" "); - lcd.setCursor( 15, 1); - lcd.print(" "); - } - else if (seq.seq_temp_select_menu == 1) - { - lcd.setCursor( 5, 1); - lcd.print("["); - lcd.setCursor( 9, 1); - lcd.print("]"); - lcd.setCursor( 3, 0); - lcd.print(" "); - lcd.setCursor( 5, 0); - lcd.print(" "); - lcd.setCursor( 13, 0); - lcd.print(" "); - lcd.setCursor( 15, 0); - lcd.print(" "); - } - else if (seq.seq_temp_select_menu == 2) - { - lcd.setCursor( 5, 1); - lcd.print(" "); - lcd.setCursor( 9, 1); - lcd.print(" "); - lcd.setCursor( 13, 0); - lcd.print("["); - lcd.setCursor( 15, 0); - lcd.print("]"); - lcd.setCursor( 10, 1); - lcd.print(" "); - lcd.setCursor( 15, 1); - lcd.print(" "); - } - else if (seq.seq_temp_select_menu == 3) - { - lcd.setCursor( 13, 0); - lcd.print(" "); - lcd.setCursor( 15, 0); - lcd.print(" "); - lcd.setCursor( 10, 1); - lcd.print("["); - lcd.setCursor( 15, 1); - lcd.print("]"); - lcd.setCursor( 3, 0); - lcd.print(" "); - lcd.setCursor( 5, 0); - lcd.print(" "); + display.setCursor( 4, 0); + if (seq.arp_lenght == 0) display.print("A"); else display.print(seq.arp_lenght); //play all elements or from 1-xx elements + display.setCursor( 6, 1); + display.print( seq.arp_style_names[seq.arp_style][0] ); + display.print( seq.arp_style_names[seq.arp_style][1] ); + display.print( seq.arp_style_names[seq.arp_style][2] ); + display.setCursor( 11, 1); + if (seq.arp_speed == 0)display.print("1/16"); else if (seq.arp_speed == 1)display.print("1/8 "); + + if (seq.temp_select_menu == 0) { + display.setCursor( 3, 0); + display.print("["); + display.setCursor( 5, 0); + display.print("]"); + display.setCursor( 5, 1); + display.print(" "); + display.setCursor( 9, 1); + display.print(" "); + display.setCursor( 13, 1); + display.print(" "); + display.setCursor( 15, 1); + display.print(" "); + } + else if (seq.temp_select_menu == 1) + { + display.setCursor( 5, 1); + display.print("["); + display.setCursor( 9, 1); + display.print("]"); + display.setCursor( 3, 0); + display.print(" "); + display.setCursor( 5, 0); + display.print(" "); + display.setCursor( 13, 0); + display.print(" "); + display.setCursor( 15, 0); + display.print(" "); + } + else if (seq.temp_select_menu == 2) + { + display.setCursor( 5, 1); + display.print(" "); + display.setCursor( 9, 1); + display.print(" "); + display.setCursor( 13, 0); + display.print("["); + display.setCursor( 15, 0); + display.print("]"); + display.setCursor( 10, 1); + display.print(" "); + display.setCursor( 15, 1); + display.print(" "); + } + else if (seq.temp_select_menu == 3) + { + display.setCursor( 13, 0); + display.print(" "); + display.setCursor( 15, 0); + display.print(" "); + display.setCursor( 10, 1); + display.print("["); + display.setCursor( 15, 1); + display.print("]"); + display.setCursor( 3, 0); + display.print(" "); + display.setCursor( 5, 0); + display.print(" "); } } if (LCDML.FUNC_close()) // ****** STABLE END ********* @@ -6605,138 +6605,138 @@ void UI_func_seq_pat_chain(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { // setup function - seq.seq_temp_select_menu = 0; - seq.seq_temp_active_menu = 99; - seq.seq_menu = 0; - lcd.setCursor( 0, 0); - lcd.print("ChainStep:"); - lcd.setCursor( 13, 0); - lcd.print(seq.seq_chain_active_chainstep + 1); - lcd.setCursor( 14, 0); - lcd.print("/"); - lcd.setCursor( 15, 0); - lcd.print(seq.seq_chain_lenght + 1); - lcd.setCursor( 0, 1); - lcd.print("T"); - lcd.setCursor(10 , 1); - lcd.print("=P"); + seq.temp_select_menu = 0; + seq.temp_active_menu = 99; + seq.menu = 0; + display.setCursor( 0, 0); + display.print("ChainStep:"); + display.setCursor( 13, 0); + display.print(seq.chain_active_chainstep + 1); + display.setCursor( 14, 0); + display.print("/"); + display.setCursor( 15, 0); + display.print(seq.chain_lenght + 1); + display.setCursor( 0, 1); + display.print("T"); + display.setCursor(10 , 1); + display.print("=P"); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (seq.seq_temp_active_menu == 99) { + if (seq.temp_active_menu == 99) { if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) - seq.seq_menu = constrain(seq.seq_menu + 1, 0, 2); //menu select + seq.menu = constrain(seq.menu + 1, 0, 2); //menu select else if (LCDML.BT_checkUp()) - seq.seq_menu = constrain(seq.seq_menu - 1, 0, 2); + seq.menu = constrain(seq.menu - 1, 0, 2); } } - else if (seq.seq_temp_active_menu == 90) { + else if (seq.temp_active_menu == 90) { if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) - seq.seq_temp_select_menu = constrain(seq.seq_temp_select_menu + 1, 0, NUM_SEQ_TRACKS - 1); + seq.temp_select_menu = constrain(seq.temp_select_menu + 1, 0, NUM_SEQ_TRACKS - 1); else if (LCDML.BT_checkUp()) - seq.seq_temp_select_menu = constrain(seq.seq_temp_select_menu - 1, 0, NUM_SEQ_TRACKS - 1); + seq.temp_select_menu = constrain(seq.temp_select_menu - 1, 0, NUM_SEQ_TRACKS - 1); } - } else if (seq.seq_temp_active_menu == 20) { + } else if (seq.temp_active_menu == 20) { if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) - seq.seq_chain_active_chainstep = constrain(seq.seq_chain_active_chainstep + 1, 0, seq.seq_chain_lenght); + seq.chain_active_chainstep = constrain(seq.chain_active_chainstep + 1, 0, seq.chain_lenght); else if (LCDML.BT_checkUp()) - seq.seq_chain_active_chainstep = constrain(seq.seq_chain_active_chainstep - 1, 0, seq.seq_chain_lenght); + seq.chain_active_chainstep = constrain(seq.chain_active_chainstep - 1, 0, seq.chain_lenght); } } - else if (seq.seq_temp_active_menu == 18) { + else if (seq.temp_active_menu == 18) { if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) { - seq.seq_patternchain[seq.seq_chain_active_chainstep][seq.seq_temp_select_menu] = constrain(seq.seq_patternchain[seq.seq_chain_active_chainstep][seq.seq_temp_select_menu] + 1, 0, NUM_SEQ_PATTERN ); + seq.patternchain[seq.chain_active_chainstep][seq.temp_select_menu] = constrain(seq.patternchain[seq.chain_active_chainstep][seq.temp_select_menu] + 1, 0, NUM_SEQ_PATTERN ); } else if (LCDML.BT_checkUp()) { - seq.seq_patternchain[seq.seq_chain_active_chainstep][seq.seq_temp_select_menu] = constrain(seq.seq_patternchain[seq.seq_chain_active_chainstep][seq.seq_temp_select_menu] - 1, 0, NUM_SEQ_PATTERN ); + seq.patternchain[seq.chain_active_chainstep][seq.temp_select_menu] = constrain(seq.patternchain[seq.chain_active_chainstep][seq.temp_select_menu] - 1, 0, NUM_SEQ_PATTERN ); } } } if (LCDML.BT_checkEnter()) //handle button presses during menu >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> { - if (seq.seq_temp_active_menu == 99 && seq.seq_menu == 0 ) + if (seq.temp_active_menu == 99 && seq.menu == 0 ) { - seq.seq_temp_active_menu = 20; + seq.temp_active_menu = 20; } - else if (seq.seq_temp_active_menu == 99 && seq.seq_menu == 1 ) + else if (seq.temp_active_menu == 99 && seq.menu == 1 ) { - seq.seq_temp_active_menu = 90; + seq.temp_active_menu = 90; } - else if (seq.seq_temp_active_menu == 99 && seq.seq_menu == 2 ) + else if (seq.temp_active_menu == 99 && seq.menu == 2 ) { - seq.seq_temp_active_menu = 18; + seq.temp_active_menu = 18; } else - seq.seq_temp_active_menu = 99; - } - if (seq.seq_menu == 0) // Chainselect modify - { - lcd.setCursor( 12, 1); - lcd.print(" "); - lcd.setCursor( 15, 1); - lcd.print(" "); - lcd.setCursor(1 , 1); - lcd.print(" "); - lcd.setCursor(3 , 1); - lcd.print(" "); - lcd.setCursor( 11, 0); - lcd.print("["); - lcd.setCursor( 13, 0); - lcd.print("]"); - } - else if (seq.seq_menu == 1 ) { - lcd.setCursor( 12, 1); - lcd.print(" "); - lcd.setCursor( 15, 1); - lcd.print(" "); - lcd.setCursor( 11, 0); - lcd.print(" "); - lcd.setCursor( 13, 0); - lcd.print(" "); - lcd.setCursor(1 , 1); - lcd.print("["); - lcd.setCursor(3 , 1); - lcd.print("]"); - } - else if (seq.seq_menu == 2 ) { - lcd.setCursor( 11, 0); - lcd.print(" "); - lcd.setCursor( 13, 0); - lcd.print(" "); - lcd.setCursor(1 , 1); - lcd.print(" "); - lcd.setCursor(3 , 1); - lcd.print(" "); - lcd.setCursor( 12, 1); - lcd.print("["); - lcd.setCursor( 15, 1); - lcd.print("]"); - } - lcd.setCursor( 12, 0); - lcd.print(seq.seq_chain_active_chainstep + 1); - lcd.setCursor(2 , 1); - lcd.print( seq.seq_temp_select_menu + 1); - lcd.setCursor(4 , 1); - if (seq.seq_track_type[seq.seq_temp_select_menu] == 0 ) lcd.print("(Drum)"); - else if (seq.seq_track_type[seq.seq_temp_select_menu] == 1 ) lcd.print("(Inst)"); - else if (seq.seq_track_type[seq.seq_temp_select_menu] == 2 ) lcd.print("(Chrd)"); else lcd.print("(Arp.)"); - lcd.setCursor( 13, 1); - if (seq.seq_patternchain[seq.seq_chain_active_chainstep][seq.seq_temp_select_menu] == NUM_SEQ_PATTERN)lcd.print("--"); //empty pattern + seq.temp_active_menu = 99; + } + if (seq.menu == 0) // Chainselect modify + { + display.setCursor( 12, 1); + display.print(" "); + display.setCursor( 15, 1); + display.print(" "); + display.setCursor(1 , 1); + display.print(" "); + display.setCursor(3 , 1); + display.print(" "); + display.setCursor( 11, 0); + display.print("["); + display.setCursor( 13, 0); + display.print("]"); + } + else if (seq.menu == 1 ) { + display.setCursor( 12, 1); + display.print(" "); + display.setCursor( 15, 1); + display.print(" "); + display.setCursor( 11, 0); + display.print(" "); + display.setCursor( 13, 0); + display.print(" "); + display.setCursor(1 , 1); + display.print("["); + display.setCursor(3 , 1); + display.print("]"); + } + else if (seq.menu == 2 ) { + display.setCursor( 11, 0); + display.print(" "); + display.setCursor( 13, 0); + display.print(" "); + display.setCursor(1 , 1); + display.print(" "); + display.setCursor(3 , 1); + display.print(" "); + display.setCursor( 12, 1); + display.print("["); + display.setCursor( 15, 1); + display.print("]"); + } + display.setCursor( 12, 0); + display.print(seq.chain_active_chainstep + 1); + display.setCursor(2 , 1); + display.print( seq.temp_select_menu + 1); + display.setCursor(4 , 1); + if (seq.track_type[seq.temp_select_menu] == 0 ) display.print("(Drum)"); + else if (seq.track_type[seq.temp_select_menu] == 1 ) display.print("(Inst)"); + else if (seq.track_type[seq.temp_select_menu] == 2 ) display.print("(Chrd)"); else display.print("(Arp.)"); + display.setCursor( 13, 1); + if (seq.patternchain[seq.chain_active_chainstep][seq.temp_select_menu] == NUM_SEQ_PATTERN)display.print("--"); //empty pattern else { - if (seq.seq_patternchain[seq.seq_chain_active_chainstep][seq.seq_temp_select_menu] < 10) - lcd.print("0"); - lcd.print(seq.seq_patternchain[seq.seq_chain_active_chainstep][seq.seq_temp_select_menu] ); + if (seq.patternchain[seq.chain_active_chainstep][seq.temp_select_menu] < 10) + display.print("0"); + display.print(seq.patternchain[seq.chain_active_chainstep][seq.temp_select_menu] ); } } if (LCDML.FUNC_close()) // ****** STABLE END ********* @@ -6751,107 +6751,107 @@ void UI_func_seq_mute_matrix(uint8_t param) // for test display 20x4 if (LCDML.FUNC_setup()) // ****** SETUP ********* { // setup function - seq.seq_temp_active_menu = 99; - seq.seq_temp_select_menu = 1; - seq.seq_menu = 0; + seq.temp_active_menu = 99; + seq.temp_select_menu = 1; + seq.menu = 0; temp_int = 0; //y offset - lcd.setCursor( 0, 0); + display.setCursor( 0, 0); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { uint8_t xscroll; - if (seq.seq_temp_active_menu == 99) { + if (seq.temp_active_menu == 99) { if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) { - seq.seq_temp_select_menu = constrain(seq.seq_temp_select_menu + 1, 0, NUM_SEQ_TRACKS + 1); - if (seq.seq_temp_select_menu == NUM_SEQ_TRACKS + 1 && temp_int != 3) //next chain step + seq.temp_select_menu = constrain(seq.temp_select_menu + 1, 0, NUM_SEQ_TRACKS + 1); + if (seq.temp_select_menu == NUM_SEQ_TRACKS + 1 && temp_int != 3) //next chain step { - lcd.setCursor( 14 , temp_int); - lcd.print(" "); - lcd.setCursor( 18 , temp_int); - lcd.print(" "); - seq.seq_temp_select_menu = 1; + display.setCursor( 14 , temp_int); + display.print(" "); + display.setCursor( 18 , temp_int); + display.print(" "); + seq.temp_select_menu = 1; if (temp_int < 3)temp_int++; } - if (seq.seq_temp_select_menu == NUM_SEQ_TRACKS + 1 && temp_int == 3) - seq.seq_temp_select_menu = NUM_SEQ_TRACKS; + if (seq.temp_select_menu == NUM_SEQ_TRACKS + 1 && temp_int == 3) + seq.temp_select_menu = NUM_SEQ_TRACKS; } else if (LCDML.BT_checkUp()) { - seq.seq_temp_select_menu = constrain(seq.seq_temp_select_menu - 1, 0, NUM_SEQ_TRACKS + 1); - if (seq.seq_temp_select_menu == 0 && temp_int > 0) //prev chain step + seq.temp_select_menu = constrain(seq.temp_select_menu - 1, 0, NUM_SEQ_TRACKS + 1); + if (seq.temp_select_menu == 0 && temp_int > 0) //prev chain step { - lcd.setCursor( 2 , temp_int); - lcd.print(" "); - lcd.setCursor( 6 , temp_int); - lcd.print(" "); - seq.seq_temp_select_menu = NUM_SEQ_TRACKS - 1 ; + display.setCursor( 2 , temp_int); + display.print(" "); + display.setCursor( 6 , temp_int); + display.print(" "); + seq.temp_select_menu = NUM_SEQ_TRACKS - 1 ; if (temp_int >= 0)temp_int = temp_int - 1; - lcd.setCursor( 14 , temp_int); - lcd.print("["); - lcd.setCursor( 18 , temp_int); - lcd.print("]"); + display.setCursor( 14 , temp_int); + display.print("["); + display.setCursor( 18 , temp_int); + display.print("]"); } - else if (seq.seq_temp_select_menu < 1 && temp_int == 0 ) - seq.seq_temp_select_menu = 1; + else if (seq.temp_select_menu < 1 && temp_int == 0 ) + seq.temp_select_menu = 1; } } } if (LCDML.BT_checkEnter()) //handle button presses during menu >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> { - if (seq.seq_patternchain[temp_int][seq.seq_temp_select_menu - 1] < NUM_SEQ_PATTERN) - seq.seq_patternchain[temp_int][seq.seq_temp_select_menu - 1] = seq.seq_patternchain[temp_int][seq.seq_temp_select_menu - 1] + (NUM_SEQ_PATTERN + 10); - else if (seq.seq_patternchain[temp_int][seq.seq_temp_select_menu - 1] > NUM_SEQ_PATTERN && seq.seq_patternchain[temp_int][seq.seq_temp_select_menu - 1] != 99) - seq.seq_patternchain[temp_int][seq.seq_temp_select_menu - 1] = seq.seq_patternchain[temp_int][seq.seq_temp_select_menu - 1] - (NUM_SEQ_PATTERN + 10); - else if (seq.seq_patternchain[temp_int][seq.seq_temp_select_menu - 1] == 99) - seq.seq_patternchain[temp_int][seq.seq_temp_select_menu - 1] = NUM_SEQ_PATTERN - 1; + if (seq.patternchain[temp_int][seq.temp_select_menu - 1] < NUM_SEQ_PATTERN) + seq.patternchain[temp_int][seq.temp_select_menu - 1] = seq.patternchain[temp_int][seq.temp_select_menu - 1] + (NUM_SEQ_PATTERN + 10); + else if (seq.patternchain[temp_int][seq.temp_select_menu - 1] > NUM_SEQ_PATTERN && seq.patternchain[temp_int][seq.temp_select_menu - 1] != 99) + seq.patternchain[temp_int][seq.temp_select_menu - 1] = seq.patternchain[temp_int][seq.temp_select_menu - 1] - (NUM_SEQ_PATTERN + 10); + else if (seq.patternchain[temp_int][seq.temp_select_menu - 1] == 99) + seq.patternchain[temp_int][seq.temp_select_menu - 1] = NUM_SEQ_PATTERN - 1; } - if (seq.seq_temp_select_menu - 1 < 4)xscroll = 0; - else if (seq.seq_temp_select_menu - 1 == 4)xscroll = 1; + if (seq.temp_select_menu - 1 < 4)xscroll = 0; + else if (seq.temp_select_menu - 1 == 4)xscroll = 1; else xscroll = 2; for (uint8_t y = 0; y < 4; y++) { for (uint8_t x = 0; x < NUM_SEQ_TRACKS - 2; x++) { - lcd.setCursor( x * 4 + 3, y); - if (seq.seq_patternchain[y][x + xscroll] < NUM_SEQ_PATTERN ) + display.setCursor( x * 4 + 3, y); + if (seq.patternchain[y][x + xscroll] < NUM_SEQ_PATTERN ) { - if (seq.seq_track_type[x + xscroll ] == 0 ) lcd.print("D"); - else if (seq.seq_track_type[x + xscroll ] == 1 ) lcd.print("I"); - else if (seq.seq_track_type[x + xscroll ] == 2 ) lcd.print("C"); - else lcd.print("A"); - if (seq.seq_patternchain[y][x + xscroll] < 10) - lcd.print("0"); - lcd.print( seq.seq_patternchain[y][x + xscroll] ); + if (seq.track_type[x + xscroll ] == 0 ) display.print("D"); + else if (seq.track_type[x + xscroll ] == 1 ) display.print("I"); + else if (seq.track_type[x + xscroll ] == 2 ) display.print("C"); + else display.print("A"); + if (seq.patternchain[y][x + xscroll] < 10) + display.print("0"); + display.print( seq.patternchain[y][x + xscroll] ); } else - lcd.print("OFF"); + display.print("OFF"); } } if (xscroll == 0) { //print cursor - lcd.setCursor( (seq.seq_temp_select_menu - 1) * 4 + 2, temp_int); - lcd.print("["); - lcd.setCursor( (seq.seq_temp_select_menu - 1) * 4 + 6, temp_int); - lcd.print("]"); - if ((seq.seq_temp_select_menu - 1) > 0) { - lcd.setCursor( (seq.seq_temp_select_menu - 1) * 4 + 2 - 4 , temp_int); - lcd.print(" "); - } - if ((seq.seq_temp_select_menu - 1) < 4) { - lcd.setCursor( (seq.seq_temp_select_menu - 1) * 4 + 6 + 4 , temp_int); - lcd.print(" "); - } - } - lcd.setCursor( 0, 0); - lcd.print("T"); - lcd.print(seq.seq_temp_select_menu); - lcd.setCursor( 0, 1); - lcd.print("S"); - lcd.print(temp_int + 1); // Chain Step + display.setCursor( (seq.temp_select_menu - 1) * 4 + 2, temp_int); + display.print("["); + display.setCursor( (seq.temp_select_menu - 1) * 4 + 6, temp_int); + display.print("]"); + if ((seq.temp_select_menu - 1) > 0) { + display.setCursor( (seq.temp_select_menu - 1) * 4 + 2 - 4 , temp_int); + display.print(" "); + } + if ((seq.temp_select_menu - 1) < 4) { + display.setCursor( (seq.temp_select_menu - 1) * 4 + 6 + 4 , temp_int); + display.print(" "); + } + } + display.setCursor( 0, 0); + display.print("T"); + display.print(seq.temp_select_menu); + display.setCursor( 0, 1); + display.print("S"); + display.print(temp_int + 1); // Chain Step } if (LCDML.FUNC_close()) // ****** STABLE END ********* { @@ -6866,121 +6866,121 @@ void UI_func_seq_mute_matrix(uint8_t param) // for standard display 16x2 if (LCDML.FUNC_setup()) // ****** SETUP ********* { // setup function - seq.seq_temp_active_menu = 99; - seq.seq_temp_select_menu = 1; - seq.seq_menu = 0; + seq.temp_active_menu = 99; + seq.temp_select_menu = 1; + seq.menu = 0; temp_int = 0; //y offset - lcd.setCursor( 0, 0); + display.setCursor( 0, 0); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { uint8_t xscroll; - if (seq.seq_temp_active_menu == 99) { + if (seq.temp_active_menu == 99) { if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) { - seq.seq_temp_select_menu = constrain(seq.seq_temp_select_menu + 1, 0, NUM_SEQ_TRACKS + 1); - if (seq.seq_temp_select_menu == NUM_SEQ_TRACKS + 1 && temp_int != 3) //next chain step + seq.temp_select_menu = constrain(seq.temp_select_menu + 1, 0, NUM_SEQ_TRACKS + 1); + if (seq.temp_select_menu == NUM_SEQ_TRACKS + 1 && temp_int != 3) //next chain step { - lcd.setCursor( 10 , 1); - lcd.print(" "); - lcd.setCursor( 14 , 1); - lcd.print(" "); - seq.seq_temp_select_menu = 1; + display.setCursor( 10 , 1); + display.print(" "); + display.setCursor( 14 , 1); + display.print(" "); + seq.temp_select_menu = 1; if (temp_int < 3)temp_int++; } - if (seq.seq_temp_select_menu == NUM_SEQ_TRACKS + 1 && temp_int == 3) - seq.seq_temp_select_menu = NUM_SEQ_TRACKS; + if (seq.temp_select_menu == NUM_SEQ_TRACKS + 1 && temp_int == 3) + seq.temp_select_menu = NUM_SEQ_TRACKS; } else if (LCDML.BT_checkUp()) { - seq.seq_temp_select_menu = constrain(seq.seq_temp_select_menu - 1, 0, NUM_SEQ_TRACKS + 1); - if (seq.seq_temp_select_menu == 0 && temp_int > 0) //prev chain step + seq.temp_select_menu = constrain(seq.temp_select_menu - 1, 0, NUM_SEQ_TRACKS + 1); + if (seq.temp_select_menu == 0 && temp_int > 0) //prev chain step { - lcd.setCursor( 2 , 1); - lcd.print(" "); - lcd.setCursor( 6 , 1); - lcd.print(" "); - seq.seq_temp_select_menu = NUM_SEQ_TRACKS - 1 ; + display.setCursor( 2 , 1); + display.print(" "); + display.setCursor( 6 , 1); + display.print(" "); + seq.temp_select_menu = NUM_SEQ_TRACKS - 1 ; if (temp_int >= 0)temp_int = temp_int - 1; - lcd.setCursor( 10 , 1); - lcd.print("["); - lcd.setCursor( 14 , 1); - lcd.print("]"); + display.setCursor( 10 , 1); + display.print("["); + display.setCursor( 14 , 1); + display.print("]"); } - else if (seq.seq_temp_select_menu < 1 && temp_int == 0 ) - seq.seq_temp_select_menu = 1; + else if (seq.temp_select_menu < 1 && temp_int == 0 ) + seq.temp_select_menu = 1; } } } if (LCDML.BT_checkEnter()) //handle button presses during menu >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> { - if (seq.seq_patternchain[temp_int][seq.seq_temp_select_menu - 1] < NUM_SEQ_PATTERN) - seq.seq_patternchain[temp_int][seq.seq_temp_select_menu - 1] = seq.seq_patternchain[temp_int][seq.seq_temp_select_menu - 1] + (NUM_SEQ_PATTERN + 10); - else if (seq.seq_patternchain[temp_int][seq.seq_temp_select_menu - 1] > NUM_SEQ_PATTERN && seq.seq_patternchain[temp_int][seq.seq_temp_select_menu - 1] != 99) - seq.seq_patternchain[temp_int][seq.seq_temp_select_menu - 1] = seq.seq_patternchain[temp_int][seq.seq_temp_select_menu - 1] - (NUM_SEQ_PATTERN + 10); - else if (seq.seq_patternchain[temp_int][seq.seq_temp_select_menu - 1] == 99) - seq.seq_patternchain[temp_int][seq.seq_temp_select_menu - 1] = NUM_SEQ_PATTERN - 1; + if (seq.patternchain[temp_int][seq.temp_select_menu - 1] < NUM_SEQ_PATTERN) + seq.patternchain[temp_int][seq.temp_select_menu - 1] = seq.patternchain[temp_int][seq.temp_select_menu - 1] + (NUM_SEQ_PATTERN + 10); + else if (seq.patternchain[temp_int][seq.temp_select_menu - 1] > NUM_SEQ_PATTERN && seq.patternchain[temp_int][seq.temp_select_menu - 1] != 99) + seq.patternchain[temp_int][seq.temp_select_menu - 1] = seq.patternchain[temp_int][seq.temp_select_menu - 1] - (NUM_SEQ_PATTERN + 10); + else if (seq.patternchain[temp_int][seq.temp_select_menu - 1] == 99) + seq.patternchain[temp_int][seq.temp_select_menu - 1] = NUM_SEQ_PATTERN - 1; } - if (seq.seq_temp_select_menu - 1 < 3)xscroll = 0; - else xscroll = seq.seq_temp_select_menu - 3; + if (seq.temp_select_menu - 1 < 3)xscroll = 0; + else xscroll = seq.temp_select_menu - 3; if (xscroll == 0) { //print cursor - lcd.setCursor( (seq.seq_temp_select_menu - 1) * 4 + 2, 1); - lcd.print("["); - lcd.setCursor( (seq.seq_temp_select_menu - 1) * 4 + 6, 1); - lcd.print("]"); - if ((seq.seq_temp_select_menu - 1) > 0) + display.setCursor( (seq.temp_select_menu - 1) * 4 + 2, 1); + display.print("["); + display.setCursor( (seq.temp_select_menu - 1) * 4 + 6, 1); + display.print("]"); + if ((seq.temp_select_menu - 1) > 0) { - lcd.setCursor( (seq.seq_temp_select_menu - 1) * 4 + 2 - 4 , 1); - lcd.print(" "); + display.setCursor( (seq.temp_select_menu - 1) * 4 + 2 - 4 , 1); + display.print(" "); } - if ((seq.seq_temp_select_menu - 1) < 4) + if ((seq.temp_select_menu - 1) < 4) { - lcd.setCursor( (seq.seq_temp_select_menu - 1) * 4 + 6 + 4 , 1); - lcd.print(" "); + display.setCursor( (seq.temp_select_menu - 1) * 4 + 6 + 4 , 1); + display.print(" "); } - lcd.setCursor( 3, 0); - lcd.print("T1"); - lcd.setCursor( 7, 0); - lcd.print("T2"); - lcd.setCursor( 11, 0); - lcd.print("T3"); + display.setCursor( 3, 0); + display.print("T1"); + display.setCursor( 7, 0); + display.print("T2"); + display.setCursor( 11, 0); + display.print("T3"); } else { - lcd.setCursor( 3, 0); - lcd.print("T"); - lcd.print(seq.seq_temp_select_menu - 2); - lcd.setCursor( 7, 0); - lcd.print("T"); - lcd.print(seq.seq_temp_select_menu - 2 + 1); - lcd.setCursor( 11, 0); - lcd.print("T"); - lcd.print(seq.seq_temp_select_menu - 2 + 2); + display.setCursor( 3, 0); + display.print("T"); + display.print(seq.temp_select_menu - 2); + display.setCursor( 7, 0); + display.print("T"); + display.print(seq.temp_select_menu - 2 + 1); + display.setCursor( 11, 0); + display.print("T"); + display.print(seq.temp_select_menu - 2 + 2); } for (uint8_t x = 0; x < NUM_SEQ_TRACKS - 3; x++) { - lcd.setCursor( x * 4 + 3, 1); - if (seq.seq_patternchain[temp_int][x + xscroll] < NUM_SEQ_PATTERN ) + display.setCursor( x * 4 + 3, 1); + if (seq.patternchain[temp_int][x + xscroll] < NUM_SEQ_PATTERN ) { - if (seq.seq_track_type[x + xscroll] == 0 ) lcd.print("D"); - else if (seq.seq_track_type[x + xscroll ] == 1 ) lcd.print("I"); - else if (seq.seq_track_type[x + xscroll ] == 2 ) lcd.print("C"); - else lcd.print("A"); - if (seq.seq_patternchain[temp_int][x + xscroll] < 10) - lcd.print("0"); - lcd.print( seq.seq_patternchain[temp_int][x + xscroll] ); + if (seq.track_type[x + xscroll] == 0 ) display.print("D"); + else if (seq.track_type[x + xscroll ] == 1 ) display.print("I"); + else if (seq.track_type[x + xscroll ] == 2 ) display.print("C"); + else display.print("A"); + if (seq.patternchain[temp_int][x + xscroll] < 10) + display.print("0"); + display.print( seq.patternchain[temp_int][x + xscroll] ); } else - lcd.print("OFF"); + display.print("OFF"); } - lcd.setCursor( 0, 1); - lcd.print("S"); - lcd.print(temp_int + 1); // Chain Step + display.setCursor( 0, 1); + display.print("S"); + display.print(temp_int + 1); // Chain Step } if (LCDML.FUNC_close()) // ****** STABLE END ********* { @@ -6994,68 +6994,68 @@ void UI_func_seq_track_setup(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { // setup function - seq.seq_temp_active_menu = 99; - seq.seq_temp_select_menu = 0; - lcd.setCursor(0 , 0); - lcd.print("Track Setup"); - lcd.setCursor(0 , 1); - lcd.print("Track "); + seq.temp_active_menu = 99; + seq.temp_select_menu = 0; + display.setCursor(0 , 0); + display.print("Track Setup"); + display.setCursor(0 , 1); + display.print("Track "); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (seq.seq_temp_active_menu == 99) { + if (seq.temp_active_menu == 99) { if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) - seq.seq_temp_select_menu = constrain(seq.seq_temp_select_menu + 1, 0, NUM_SEQ_TRACKS - 1); + seq.temp_select_menu = constrain(seq.temp_select_menu + 1, 0, NUM_SEQ_TRACKS - 1); else if (LCDML.BT_checkUp()) - seq.seq_temp_select_menu = constrain(seq.seq_temp_select_menu - 1, 0, NUM_SEQ_TRACKS - 1); + seq.temp_select_menu = constrain(seq.temp_select_menu - 1, 0, NUM_SEQ_TRACKS - 1); } } else { if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) - seq.seq_track_type[seq.seq_temp_active_menu] = constrain(seq.seq_track_type[seq.seq_temp_active_menu] + 1, 0, 3); + seq.track_type[seq.temp_active_menu] = constrain(seq.track_type[seq.temp_active_menu] + 1, 0, 3); else if (LCDML.BT_checkUp()) - seq.seq_track_type[seq.seq_temp_active_menu] = constrain(seq.seq_track_type[seq.seq_temp_active_menu] - 1, 0, 3); + seq.track_type[seq.temp_active_menu] = constrain(seq.track_type[seq.temp_active_menu] - 1, 0, 3); } } if (LCDML.BT_checkEnter()) //handle button presses during menu >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> { - if (seq.seq_temp_active_menu == 99) { - seq.seq_temp_active_menu = seq.seq_temp_select_menu; + if (seq.temp_active_menu == 99) { + seq.temp_active_menu = seq.temp_select_menu; } else { - seq.seq_temp_active_menu = 99; + seq.temp_active_menu = 99; } } - if (seq.seq_temp_active_menu == 99) + if (seq.temp_active_menu == 99) { - lcd.setCursor(8 , 1); - lcd.print(" "); - lcd.setCursor(15 , 1); - lcd.print(" "); - lcd.setCursor(5 , 1); - lcd.print("["); - lcd.setCursor(6 , 1); - lcd.print(seq.seq_temp_select_menu + 1); - lcd.setCursor(7 , 1); - lcd.print("]"); - lcd.setCursor(9 , 1); + display.setCursor(8 , 1); + display.print(" "); + display.setCursor(15 , 1); + display.print(" "); + display.setCursor(5 , 1); + display.print("["); + display.setCursor(6 , 1); + display.print(seq.temp_select_menu + 1); + display.setCursor(7 , 1); + display.print("]"); + display.setCursor(9 , 1); } else { - lcd.setCursor(5 , 1); - lcd.print(" "); - lcd.setCursor(7 , 1); - lcd.print(" "); - lcd.setCursor(8 , 1); - lcd.print("["); - lcd.setCursor(15 , 1); - lcd.print("]"); - lcd.setCursor(9 , 1); + display.setCursor(5 , 1); + display.print(" "); + display.setCursor(7 , 1); + display.print(" "); + display.setCursor(8 , 1); + display.print("["); + display.setCursor(15 , 1); + display.print("]"); + display.setCursor(9 , 1); } - if (seq.seq_track_type[seq.seq_temp_select_menu] == 0 ) lcd.print("Drums "); else if (seq.seq_track_type[seq.seq_temp_select_menu] == 1 ) lcd.print("Instru"); - else if (seq.seq_track_type[seq.seq_temp_select_menu] == 2 )lcd.print("Chords"); else lcd.print("Arp "); + if (seq.track_type[seq.temp_select_menu] == 0 ) display.print("Drums "); else if (seq.track_type[seq.temp_select_menu] == 1 ) display.print("Instru"); + else if (seq.track_type[seq.temp_select_menu] == 2 )display.print("Chords"); else display.print("Arp "); } if (LCDML.FUNC_close()) // ****** STABLE END ********* { @@ -7068,68 +7068,68 @@ void UI_func_dexed_assign(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { // setup function - seq.seq_temp_active_menu = 99; - seq.seq_temp_select_menu = 0; - lcd.setCursor(0 , 0); - lcd.print("Dexed Assign"); - lcd.setCursor(0 , 1); - lcd.print("Track "); + seq.temp_active_menu = 99; + seq.temp_select_menu = 0; + display.setCursor(0 , 0); + display.print("Dexed Assign"); + display.setCursor(0 , 1); + display.print("Track "); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (seq.seq_temp_active_menu == 99) { + if (seq.temp_active_menu == 99) { if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) - seq.seq_temp_select_menu = constrain(seq.seq_temp_select_menu + 1, 0, NUM_SEQ_TRACKS - 1); + seq.temp_select_menu = constrain(seq.temp_select_menu + 1, 0, NUM_SEQ_TRACKS - 1); else if (LCDML.BT_checkUp()) - seq.seq_temp_select_menu = constrain(seq.seq_temp_select_menu - 1, 0, NUM_SEQ_TRACKS - 1); + seq.temp_select_menu = constrain(seq.temp_select_menu - 1, 0, NUM_SEQ_TRACKS - 1); } } else { if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) - seq.seq_inst_dexed[seq.seq_temp_active_menu] = constrain(seq.seq_inst_dexed[seq.seq_temp_active_menu] + 1, 0, 1); + seq.inst_dexed[seq.temp_active_menu] = constrain(seq.inst_dexed[seq.temp_active_menu] + 1, 0, 1); else if (LCDML.BT_checkUp()) - seq.seq_inst_dexed[seq.seq_temp_active_menu] = constrain(seq.seq_inst_dexed[seq.seq_temp_active_menu] - 1, 0, 1); + seq.inst_dexed[seq.temp_active_menu] = constrain(seq.inst_dexed[seq.temp_active_menu] - 1, 0, 1); } } if (LCDML.BT_checkEnter()) //handle button presses during menu >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> { - if (seq.seq_temp_active_menu == 99) { - seq.seq_temp_active_menu = seq.seq_temp_select_menu; + if (seq.temp_active_menu == 99) { + seq.temp_active_menu = seq.temp_select_menu; } else { - seq.seq_temp_active_menu = 99; + seq.temp_active_menu = 99; } } - if (seq.seq_temp_active_menu == 99) + if (seq.temp_active_menu == 99) { - lcd.setCursor(8 , 1); - lcd.print(" "); - lcd.setCursor(15 , 1); - lcd.print(" "); - lcd.setCursor(5 , 1); - lcd.print("["); - lcd.setCursor(6 , 1); - lcd.print(seq.seq_temp_select_menu + 1); - lcd.setCursor(7 , 1); - lcd.print("]"); - lcd.setCursor(9 , 1); + display.setCursor(8 , 1); + display.print(" "); + display.setCursor(15 , 1); + display.print(" "); + display.setCursor(5 , 1); + display.print("["); + display.setCursor(6 , 1); + display.print(seq.temp_select_menu + 1); + display.setCursor(7 , 1); + display.print("]"); + display.setCursor(9 , 1); } else { - lcd.setCursor(5 , 1); - lcd.print(" "); - lcd.setCursor(7 , 1); - lcd.print(" "); - lcd.setCursor(8 , 1); - lcd.print("["); - lcd.setCursor(15 , 1); - lcd.print("]"); - lcd.setCursor(9 , 1); + display.setCursor(5 , 1); + display.print(" "); + display.setCursor(7 , 1); + display.print(" "); + display.setCursor(8 , 1); + display.print("["); + display.setCursor(15 , 1); + display.print("]"); + display.setCursor(9 , 1); } - if (seq.seq_inst_dexed[seq.seq_temp_select_menu] == 0 ) lcd.print("dexed0"); else if (seq.seq_inst_dexed[seq.seq_temp_select_menu] == 1 ) lcd.print("dexed1"); else lcd.print("??????"); + if (seq.inst_dexed[seq.temp_select_menu] == 0 ) display.print("dexed0"); else if (seq.inst_dexed[seq.temp_select_menu] == 1 ) display.print("dexed1"); else display.print("??????"); } if (LCDML.FUNC_close()) // ****** STABLE END ********* @@ -7144,14 +7144,14 @@ void UI_func_load_performance(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { char tmp[10]; - if (seq.seq_state_last_loadsave != 200)temp_int = seq.seq_state_last_loadsave; else temp_int = param; + if (seq.state_last_loadsave != 200)temp_int = seq.state_last_loadsave; else temp_int = param; mode = 0; encoderDir[ENC_R].reset(); - lcd.setCursor(0, 0); - lcd.print(F("Load Performance ")); - lcd.setCursor(0, 1); + display.setCursor(0, 0); + display.print(F("Load Performance ")); + display.setCursor(0, 1); sprintf(tmp, "[%2d]", param); - lcd.print(tmp); + display.print(tmp); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { @@ -7168,38 +7168,38 @@ void UI_func_load_performance(uint8_t param) else if (LCDML.BT_checkEnter()) { mode = 0xff; - lcd.setCursor(0, 1); + display.setCursor(0, 1); if (load_sd_performance_json(temp_int) == false) - lcd.print("Does not exist."); + display.print("Does not exist."); else { load_sd_performance_json(temp_int); - seq.seq_state_last_loadsave = temp_int; - lcd.print("Done. "); + seq.state_last_loadsave = temp_int; + display.print("Done. "); } delay(MESSAGE_WAIT_TIME); LCDML.FUNC_goBackToMenu(); } } - lcd.setCursor(0, 1); + display.setCursor(0, 1); char tmp[10]; sprintf(tmp, "[%2d]", temp_int); - lcd.print(tmp); + display.print(tmp); if (check_sd_performance_exists(temp_int)) { get_sd_performance_name_json(temp_int); - if ( seq.seq_name_temp[0] != 0 ) - lcd.show(1, 5, 11, seq.seq_name_temp); + if ( seq.name_temp[0] != 0 ) + display.show(1, 5, 11, seq.name_temp); else - lcd.print(" -- DATA --"); + display.print(" -- DATA --"); } - else lcd.print(" "); + else display.print(" "); } if (LCDML.FUNC_close()) // ****** STABLE END ********* { if (mode < 0xff) { - lcd.show(1, 0, 16, "Canceled."); + display.show(1, 0, 16, "Canceled."); delay(MESSAGE_WAIT_TIME); } else @@ -7220,17 +7220,17 @@ void UI_func_save_performance(uint8_t param) { char tmp[CONFIG_FILENAME_LEN]; yesno = false; - if (seq.seq_state_last_loadsave != 200) - temp_int = seq.seq_state_last_loadsave; + if (seq.state_last_loadsave != 200) + temp_int = seq.state_last_loadsave; else temp_int = 0; mode = 0; encoderDir[ENC_R].reset(); - lcd.setCursor(0, 0); - lcd.print(F("Save Performance")); - lcd.setCursor(0, 1); + display.setCursor(0, 0); + display.print(F("Save Performance")); + display.setCursor(0, 1); sprintf(tmp, "[%2d]", temp_int); - lcd.print(tmp); + display.print(tmp); sprintf(tmp, "/%s/%d/%s.json", PERFORMANCE_CONFIG_PATH, temp_int, SEQUENCER_CONFIG_NAME); if (SD.exists(tmp)) overwrite = true; @@ -7239,10 +7239,10 @@ void UI_func_save_performance(uint8_t param) if (check_sd_performance_exists(temp_int)) { get_sd_performance_name_json(temp_int); - if ( seq.seq_name_temp[0] != 0 ) - lcd.show(1, 5, 11, seq.seq_name_temp); + if ( seq.name_temp[0] != 0 ) + display.show(1, 5, 11, seq.name_temp); else - lcd.print(" -- DATA --"); + display.print(" -- DATA --"); } } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -7268,16 +7268,16 @@ void UI_func_save_performance(uint8_t param) if (mode == 0 && overwrite == true) { mode = 1; - lcd.setCursor(0, 1); - lcd.print(F("Overwrite: [ ]")); + display.setCursor(0, 1); + display.print(F("Overwrite: [ ]")); } else { mode = 0xff; if (overwrite == false || yesno == true) { - lcd.show(1, 0, 16, "Done."); - seq.seq_state_last_loadsave = temp_int; + display.show(1, 0, 16, "Done."); + seq.state_last_loadsave = temp_int; delay(MESSAGE_WAIT_TIME); LCDML.FUNC_goBackToMenu(); } @@ -7286,9 +7286,9 @@ void UI_func_save_performance(uint8_t param) char tmp[10]; mode = 0; - lcd.setCursor(0, 1); + display.setCursor(0, 1); sprintf(tmp, "[%2d] ", temp_int); - lcd.print(tmp); + display.print(tmp); } } } @@ -7302,30 +7302,30 @@ void UI_func_save_performance(uint8_t param) else overwrite = false; - lcd.setCursor(0, 1); + display.setCursor(0, 1); sprintf(tmp, "[%2d]", temp_int); - lcd.print(tmp); - lcd.setCursor(5, 1); + display.print(tmp); + display.setCursor(5, 1); if (overwrite == false) { - lcd.print("-- EMPTY --"); + display.print("-- EMPTY --"); } else if (check_sd_performance_exists(temp_int)) { get_sd_performance_name_json(temp_int); - if ( seq.seq_name_temp[0] != 0 ) - lcd.show(1, 5, 11, seq.seq_name_temp); else - lcd.print("-- DATA --"); + if ( seq.name_temp[0] != 0 ) + display.show(1, 5, 11, seq.name_temp); else + display.print("-- DATA --"); } - else lcd.print(" "); + else display.print(" "); } else if (mode < 0xff) { - lcd.setCursor(12, 1); + display.setCursor(12, 1); if (yesno == true) { - lcd.print(F("YES")); + display.print(F("YES")); } else - lcd.print(F("NO ")); + display.print(F("NO ")); } } encoderDir[ENC_R].reset(); @@ -7335,7 +7335,7 @@ void UI_func_save_performance(uint8_t param) { if (mode < 0xff) { - lcd.show(1, 0, 16, "Canceled."); + display.show(1, 0, 16, "Canceled."); delay(MESSAGE_WAIT_TIME); } else @@ -7356,10 +7356,10 @@ void UI_func_information(uint8_t param) generate_version_string(version_string, sizeof(version_string)); // setup function - lcd.setCursor(0, 0); - lcd.print(version_string); - lcd.setCursor(0, 1); - lcd.print(sd_string); + display.setCursor(0, 0); + display.print(version_string); + display.setCursor(0, 1); + display.print(sd_string); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -7381,8 +7381,8 @@ void UI_func_midi_soft_thru(uint8_t param) { encoderDir[ENC_R].reset(); - lcd.setCursor(0, 0); - lcd.print(F("MIDI Soft THRU")); + display.setCursor(0, 0); + display.print(F("MIDI Soft THRU")); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -7395,14 +7395,14 @@ void UI_func_midi_soft_thru(uint8_t param) configuration.sys.soft_midi_thru = constrain(configuration.sys.soft_midi_thru - 1, SOFT_MIDI_THRU_MIN, SOFT_MIDI_THRU_MAX); } - lcd.setCursor(0, 1); + display.setCursor(0, 1); switch (configuration.sys.soft_midi_thru) { case 0: - lcd.print(F("[OFF]")); + display.print(F("[OFF]")); break; case 1: - lcd.print(F("[ON ]")); + display.print(F("[ON ]")); break; } } @@ -7425,8 +7425,8 @@ void UI_func_smart_filter(uint8_t param) { encoderDir[ENC_R].reset(); - lcd.setCursor(0, 0); - lcd.print(F("Drm Smart Filter")); + display.setCursor(0, 0); + display.print(F("Drm Smart Filter")); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { @@ -7437,8 +7437,8 @@ void UI_func_smart_filter(uint8_t param) else if (LCDML.BT_checkUp()) seq.smartfilter = !seq.smartfilter; } - lcd.setCursor(0, 1); - if (seq.smartfilter) lcd.print(F("[ON ]")); else lcd.print(F("[OFF]")); + display.setCursor(0, 1); + if (seq.smartfilter) display.print(F("[ON ]")); else display.print(F("[OFF]")); } if (LCDML.FUNC_close()) // ****** STABLE END ********* { @@ -7490,15 +7490,15 @@ void UI_func_velocity_level(uint8_t param) void UI_update_instance_icons() { #ifdef TESTDISPLAY20x4 - lcd.setCursor(18, 0); - lcd.write(0); //Icon for first instance - lcd.setCursor(19, 0); - lcd.write(1); //Icon for second instance + display.setCursor(18, 0); + display.write(0); //Icon for first instance + display.setCursor(19, 0); + display.write(1); //Icon for second instance #else - lcd.setCursor(14, 0); - lcd.write(0); //Icon for first instance - lcd.setCursor(15, 0); - lcd.write(1); //Icon for second instance + display.setCursor(14, 0); + display.write(0); //Icon for first instance + display.setCursor(15, 0); + display.write(1); //Icon for second instance #endif } @@ -7509,10 +7509,10 @@ void UI_func_voice_select(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { #ifdef TESTDISPLAY20x4 - lcd.setCursor(0, 3); - lcd.print("MENU"); - lcd.setCursor(17, 3); - lcd.print("+/-"); + display.setCursor(0, 3); + display.print("MENU"); + display.setCursor(17, 3); + display.print("+/-"); #endif encoderDir[ENC_R].reset(); @@ -7528,11 +7528,11 @@ void UI_func_voice_select(uint8_t param) UI_update_instance_icons(); - lcd.createChar(2, (uint8_t*)special_chars[18]); // favorites symbol + display.createChar(2, (uint8_t*)special_chars[18]); // favorites symbol #ifdef TEENSY3_6 - lcd.createChar(6, (uint8_t*)special_chars[16]); // MIDI activity note symbol - lcd.createChar(7, (uint8_t*)special_chars[16]); // MIDI activity note symbol + display.createChar(6, (uint8_t*)special_chars[16]); // MIDI activity note symbol + display.createChar(7, (uint8_t*)special_chars[16]); // MIDI activity note symbol #endif } @@ -7760,48 +7760,48 @@ void UI_func_voice_select(uint8_t param) strcpy(voice_name, "*ERROR*"); } - lcd.show(0, 0, 2, configuration.dexed[selected_instance_id].bank); - lcd.show(1, 0, 2, configuration.dexed[selected_instance_id].voice + 1); + display.show(0, 0, 2, configuration.dexed[selected_instance_id].bank); + display.show(1, 0, 2, configuration.dexed[selected_instance_id].voice + 1); #ifdef TESTDISPLAY20x4 string_toupper(bank_name); - lcd.show(0, 4, 8, bank_name); + display.show(0, 4, 8, bank_name); string_toupper(voice_name); - lcd.show(1, 4, 10, voice_name); + display.show(1, 4, 10, voice_name); switch (menu_voice_select) { case MENU_VOICE_BANK: - lcd.show(0, 3, 1, "["); - lcd.show(0, 12, 1, "]"); - lcd.show(1, 3, 1, " "); - lcd.show(1, 14, 1, " "); + display.show(0, 3, 1, "["); + display.show(0, 12, 1, "]"); + display.show(1, 3, 1, " "); + display.show(1, 14, 1, " "); break; case MENU_VOICE_SOUND: - lcd.show(0, 3, 1, " "); - lcd.show(0, 12, 1, " "); - lcd.show(1, 3, 1, "["); - lcd.show(1, 14, 1, "]"); + display.show(0, 3, 1, " "); + display.show(0, 12, 1, " "); + display.show(1, 3, 1, "["); + display.show(1, 14, 1, "]"); break; } #else string_toupper(bank_name); - lcd.show(0, 3, 8, bank_name); - lcd.show(0, 12, 1, " "); //forced because this char does not clear after fav-search (because the bank name is one char to short to do it). + display.show(0, 3, 8, bank_name); + display.show(0, 12, 1, " "); //forced because this char does not clear after fav-search (because the bank name is one char to short to do it). string_toupper(voice_name); - lcd.show(1, 3, 10, voice_name); + display.show(1, 3, 10, voice_name); switch (menu_voice_select) { case MENU_VOICE_BANK: - lcd.show(0, 2, 1, "["); - lcd.show(0, 11, 1, "]"); - lcd.show(1, 2, 1, " "); - lcd.show(1, 13, 1, " "); + display.show(0, 2, 1, "["); + display.show(0, 11, 1, "]"); + display.show(1, 2, 1, " "); + display.show(1, 13, 1, " "); break; case MENU_VOICE_SOUND: - lcd.show(0, 2, 1, " "); - lcd.show(0, 11, 1, " "); - lcd.show(1, 2, 1, "["); - lcd.show(1, 13, 1, "]"); + display.show(0, 2, 1, " "); + display.show(0, 11, 1, " "); + display.show(1, 2, 1, "["); + display.show(1, 13, 1, "]"); break; } #endif @@ -7834,34 +7834,34 @@ void UI_func_volume(uint8_t param) else if (active_perform_page == 2) { // Live Performance Mod - Attack - lcd.setCursor(0, 0); - lcd.print("Live Modify"); - lcd.setCursor(0, 1); - lcd.print("Attack = "); - lcd.setCursor(13, 1); + display.setCursor(0, 0); + display.print("Live Modify"); + display.setCursor(0, 1); + display.print("Attack = "); + display.setCursor(13, 1); sprintf(tmp, "%03d", perform_attack_mod[selected_instance_id]); - lcd.print(tmp); + display.print(tmp); back_from_volume = 0; } else if (active_perform_page == 3) { // Live Performance Mod - Release - lcd.setCursor(0, 0); - lcd.print("Live Modify"); - lcd.setCursor(11, 1); - lcd.print("Release = "); - lcd.setCursor(13, 1); + display.setCursor(0, 0); + display.print("Live Modify"); + display.setCursor(11, 1); + display.print("Release = "); + display.setCursor(13, 1); sprintf(tmp, "%03d", perform_release_mod[selected_instance_id]); - lcd.print(tmp); + display.print(tmp); back_from_volume = 0; } - lcd.setCursor(12, 0); - lcd.print("P"); - lcd.setCursor(13, 0); - lcd.print(active_perform_page); - lcd.setCursor(14, 0); - lcd.print("/3"); + display.setCursor(12, 0); + display.print("P"); + display.setCursor(13, 0); + display.print(active_perform_page); + display.setCursor(14, 0); + display.print("/3"); } @@ -7948,34 +7948,34 @@ void UI_func_volume(uint8_t param) } } - lcd.setCursor(13, 0); - lcd.print(active_perform_page); + display.setCursor(13, 0); + display.print(active_perform_page); if (active_perform_page == 1) { //Master Volume - lcd.setCursor(0, 0); - lcd.print("Master Vol. "); + display.setCursor(0, 0); + display.print("Master Vol. "); lcd_special_chars(BLOCKBAR); lcd_display_bar_int("Master Vol.", configuration.sys.vol, 1.0, VOLUME_MIN, VOLUME_MAX, 3, false, false, false); set_volume(configuration.sys.vol, configuration.sys.mono); } else if (active_perform_page == 2) { //Attack - lcd.setCursor(0, 0); - lcd.print("Live Modify"); - lcd.setCursor(0, 1); - lcd.print("Attack = "); - lcd.setCursor(13, 1); + display.setCursor(0, 0); + display.print("Live Modify"); + display.setCursor(0, 1); + display.print("Attack = "); + display.setCursor(13, 1); sprintf(tmp, "%03d", perform_attack_mod[selected_instance_id]); - lcd.print(tmp); + display.print(tmp); back_from_volume = 0; } else if (active_perform_page == 3) { //Release - lcd.setCursor(0, 0); - lcd.print("Live Modify"); - lcd.setCursor(0, 1); - lcd.print("Release = "); - lcd.setCursor(13, 1); + display.setCursor(0, 0); + display.print("Live Modify"); + display.setCursor(0, 1); + display.print("Release = "); + display.setCursor(13, 1); sprintf(tmp, "%03d", perform_release_mod[selected_instance_id]); - lcd.print(tmp); + display.print(tmp); back_from_volume = 0; } } @@ -8016,20 +8016,20 @@ void UI_func_save_voice(uint8_t param) if (!get_bank_name(configuration.dexed[selected_instance_id].bank, bank_name, sizeof(bank_name))) strcpy(bank_name, "*ERROR*"); - lcd.setCursor(0, 0); - lcd.print(F("Save to Bank")); - lcd.show(1, 0, 2, configuration.dexed[selected_instance_id].bank); - lcd.show(1, 3, 10, bank_name); - lcd.show(1, 2, 1, "["); - lcd.show(1, 13, 1, "]"); + display.setCursor(0, 0); + display.print(F("Save to Bank")); + display.show(1, 0, 2, configuration.dexed[selected_instance_id].bank); + display.show(1, 3, 10, bank_name); + display.show(1, 2, 1, "["); + display.show(1, 13, 1, "]"); #else - lcd.setCursor(0, 0); - lcd.print(F("Save Instance")); + display.setCursor(0, 0); + display.print(F("Save Instance")); lcd_active_instance_number(selected_instance_id); - lcd.setCursor(5, 1); - lcd.write(0); - lcd.setCursor(10, 1); - lcd.write(1); + display.setCursor(5, 1); + display.write(0); + display.setCursor(10, 1); + display.write(1); #endif } @@ -8047,10 +8047,10 @@ void UI_func_save_voice(uint8_t param) selected_instance_id = !selected_instance_id; lcd_active_instance_number(selected_instance_id); - lcd.setCursor(5, 1); - lcd.write(0); - lcd.setCursor(10, 1); - lcd.write(1); + display.setCursor(5, 1); + display.write(0); + display.setCursor(10, 1); + display.write(1); break; case 1: // Bank selection if (LCDML.BT_checkDown()) @@ -8061,8 +8061,8 @@ void UI_func_save_voice(uint8_t param) if (!get_bank_name(configuration.dexed[selected_instance_id].bank, bank_name, sizeof(bank_name))) strcpy(bank_name, "*ERROR*"); - lcd.show(1, 0, 2, configuration.dexed[selected_instance_id].bank); - lcd.show(1, 3, 10, bank_name); + display.show(1, 0, 2, configuration.dexed[selected_instance_id].bank); + display.show(1, 3, 10, bank_name); break; case 2: // Voice selection if (LCDML.BT_checkDown() && configuration.dexed[selected_instance_id].voice < MAX_VOICES - 1) @@ -8075,18 +8075,18 @@ void UI_func_save_voice(uint8_t param) if (!get_voice_by_bank_name(configuration.dexed[selected_instance_id].bank, bank_name, configuration.dexed[selected_instance_id].voice, voice_name, sizeof(voice_name))) strncpy(voice_name, "*ERROR*", sizeof(voice_name)); - lcd.show(1, 0, 2, configuration.dexed[selected_instance_id].voice + 1); - lcd.show(1, 3, 10, voice_name); + display.show(1, 0, 2, configuration.dexed[selected_instance_id].voice + 1); + display.show(1, 3, 10, voice_name); break; case 3: // Yes/No selection yesno = !yesno; if (yesno == true) { - lcd.show(1, 1, 3, "YES"); + display.show(1, 1, 3, "YES"); } else { - lcd.show(1, 1, 3, "NO"); + display.show(1, 1, 3, "NO"); } break; } @@ -8100,12 +8100,12 @@ void UI_func_save_voice(uint8_t param) case 1: if (!get_bank_name(configuration.dexed[selected_instance_id].bank, bank_name, sizeof(bank_name))) strncpy(bank_name, "*ERROR*", sizeof(bank_name)); - lcd.setCursor(0, 0); - lcd.print(F("Save to Bank")); - lcd.show(1, 0, 2, configuration.dexed[selected_instance_id].bank); - lcd.show(1, 3, 10, bank_name); - lcd.show(1, 2, 2, " ["); - lcd.show(1, 14, 1, "]"); + display.setCursor(0, 0); + display.print(F("Save to Bank")); + display.show(1, 0, 2, configuration.dexed[selected_instance_id].bank); + display.show(1, 3, 10, bank_name); + display.show(1, 2, 2, " ["); + display.show(1, 14, 1, "]"); break; case 2: if (!get_bank_name(configuration.dexed[selected_instance_id].bank, bank_name, sizeof(bank_name))) @@ -8113,15 +8113,15 @@ void UI_func_save_voice(uint8_t param) if (!get_voice_by_bank_name(configuration.dexed[selected_instance_id].bank, bank_name, configuration.dexed[selected_instance_id].voice, voice_name, sizeof(voice_name))) strncpy(voice_name, "*ERROR*", sizeof(voice_name)); - lcd.show(0, 0, 16, "Save to Bank"); - lcd.show(0, 13, 2, configuration.dexed[selected_instance_id].bank); - lcd.show(1, 0, 2, configuration.dexed[selected_instance_id].voice + 1); - lcd.show(1, 3, 10, voice_name); + display.show(0, 0, 16, "Save to Bank"); + display.show(0, 13, 2, configuration.dexed[selected_instance_id].bank); + display.show(1, 0, 2, configuration.dexed[selected_instance_id].voice + 1); + display.show(1, 3, 10, voice_name); break; case 3: - lcd.show(0, 0, 16, "Overwrite?"); - lcd.show(1, 0, 15, "[NO"); - lcd.show(1, 4, 1, "]"); + display.show(0, 0, 16, "Overwrite?"); + display.show(1, 0, 15, "[NO"); + display.show(1, 4, 1, "]"); break; default: if (yesno == true) @@ -8137,7 +8137,7 @@ void UI_func_save_voice(uint8_t param) save_sd_voice(configuration.dexed[selected_instance_id].bank, configuration.dexed[selected_instance_id].voice, selected_instance_id); #endif - lcd.show(1, 0, 16, "Done."); + display.show(1, 0, 16, "Done."); delay(MESSAGE_WAIT_TIME); mode = 0xff; @@ -8155,7 +8155,7 @@ void UI_func_save_voice(uint8_t param) if (mode < 0xff) { - lcd.show(1, 0, 16, "Canceled."); + display.show(1, 0, 16, "Canceled."); delay(MESSAGE_WAIT_TIME); } encoderDir[ENC_R].reset(); @@ -8178,16 +8178,16 @@ void UI_func_sysex_receive_bank(uint8_t param) bank_number = configuration.dexed[selected_instance_id].bank; memset(receive_bank_filename, 0, sizeof(receive_bank_filename)); - lcd.setCursor(0, 0); - lcd.print(F("MIDI Recv Bank")); - lcd.setCursor(2, 1); - lcd.print(F("[")); - lcd.setCursor(14, 1); - lcd.print(F("]")); + display.setCursor(0, 0); + display.print(F("MIDI Recv Bank")); + display.setCursor(2, 1); + display.print(F("[")); + display.setCursor(14, 1); + display.print(F("]")); if (!get_bank_name(configuration.dexed[selected_instance_id].bank, receive_bank_filename, sizeof(receive_bank_filename))) strcpy(receive_bank_filename, "*ERROR*"); - lcd.show(1, 0, 2, bank_number); - lcd.show(1, 3, 10, receive_bank_filename); + display.show(1, 0, 2, bank_number); + display.show(1, 3, 10, receive_bank_filename); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -8202,15 +8202,15 @@ void UI_func_sysex_receive_bank(uint8_t param) bank_number = constrain(bank_number + ENCODER[ENC_R].speed(), 0, MAX_BANKS - 1); if (!get_bank_name(bank_number, receive_bank_filename, sizeof(receive_bank_filename))) strcpy(receive_bank_filename, "*ERROR*"); - lcd.show(1, 0, 2, bank_number); - lcd.show(1, 3, 10, receive_bank_filename); + display.show(1, 0, 2, bank_number); + display.show(1, 3, 10, receive_bank_filename); break; case 1: yesno = !yesno; if (yesno) - lcd.show(1, 12, 3, "YES"); + display.show(1, 12, 3, "YES"); else - lcd.show(1, 12, 3, "NO"); + display.show(1, 12, 3, "NO"); break; case 2: ui_select_name_state = UI_select_name(1, 1, receive_bank_filename, BANK_NAME_LEN - 1, false); @@ -8225,15 +8225,15 @@ void UI_func_sysex_receive_bank(uint8_t param) bank_number = constrain(bank_number - ENCODER[ENC_R].speed(), 0, MAX_BANKS - 1); if (!get_bank_name(bank_number, receive_bank_filename, sizeof(receive_bank_filename))) strcpy(receive_bank_filename, "*ERROR*"); - lcd.show(1, 0, 2, bank_number); - lcd.show(1, 3, 10, receive_bank_filename); + display.show(1, 0, 2, bank_number); + display.show(1, 3, 10, receive_bank_filename); break; case 1: yesno = !yesno; if (yesno) - lcd.show(1, 12, 3, "YES"); + display.show(1, 12, 3, "YES"); else - lcd.show(1, 12, 3, "NO"); + display.show(1, 12, 3, "NO"); break; case 2: ui_select_name_state = UI_select_name(1, 1, receive_bank_filename, BANK_NAME_LEN - 1, false); @@ -8250,25 +8250,25 @@ void UI_func_sysex_receive_bank(uint8_t param) yesno = true; strcpy(receive_bank_filename, "NONAME"); mode = 2; - lcd.setCursor(0, 1); - lcd.print(F("[ ] ")); + display.setCursor(0, 1); + display.print(F("[ ] ")); ui_select_name_state = UI_select_name(1, 1, receive_bank_filename, BANK_NAME_LEN - 1, true); - lcd.blink(); + display.blink(); } else { mode = 1; - lcd.setCursor(0, 1); - lcd.print(F("Overwrite: [NO ]")); + display.setCursor(0, 1); + display.print(F("Overwrite: [NO ]")); } } else if (mode == 1 && yesno == true) { mode = 2; - lcd.setCursor(0, 1); - lcd.print(F("[ ] ")); + display.setCursor(0, 1); + display.print(F("[ ] ")); ui_select_name_state = UI_select_name(1, 1, receive_bank_filename, BANK_NAME_LEN - 1, true); - lcd.blink(); + display.blink(); } else if (mode == 2) { @@ -8293,9 +8293,9 @@ void UI_func_sysex_receive_bank(uint8_t param) Serial.println(F(".")); #endif mode = 0xff; - lcd.noBlink(); - lcd.setCursor(0, 1); - lcd.print(F("Waiting... ")); + display.noBlink(); + display.setCursor(0, 1); + display.print(F("Waiting... ")); /// Storing is done in SYSEX code } } @@ -8305,9 +8305,9 @@ void UI_func_sysex_receive_bank(uint8_t param) Serial.println(mode, DEC); memset(receive_bank_filename, 0, sizeof(receive_bank_filename)); mode = 0xff; - lcd.noBlink(); - lcd.setCursor(0, 1); - lcd.print(F("Canceled. ")); + display.noBlink(); + display.setCursor(0, 1); + display.print(F("Canceled. ")); delay(MESSAGE_WAIT_TIME); LCDML.FUNC_goBackToMenu(); } @@ -8320,12 +8320,12 @@ void UI_func_sysex_receive_bank(uint8_t param) encoderDir[ENC_R].reset(); memset(receive_bank_filename, 0, sizeof(receive_bank_filename)); - lcd.noBlink(); + display.noBlink(); if (mode < 0xff) { - lcd.setCursor(0, 1); - lcd.print(F("Canceled. ")); + display.setCursor(0, 1); + display.print(F("Canceled. ")); delay(MESSAGE_WAIT_TIME); } } @@ -8339,27 +8339,27 @@ void UI_func_set_performance_name(uint8_t param) { encoderDir[ENC_R].reset(); mode = 0; - lcd.setCursor(0, 0); - lcd.print(F("Perf. Name")); + display.setCursor(0, 0); + display.print(F("Perf. Name")); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) { - if (mode == 1) ui_select_name_state = UI_select_name(1, 1, seq.seq_name_temp, BANK_NAME_LEN - 1, false); + if (mode == 1) ui_select_name_state = UI_select_name(1, 1, seq.name_temp, BANK_NAME_LEN - 1, false); } else if (LCDML.BT_checkUp()) { - if (mode == 1) ui_select_name_state = UI_select_name(1, 1, seq.seq_name_temp, BANK_NAME_LEN - 1, false); + if (mode == 1) ui_select_name_state = UI_select_name(1, 1, seq.name_temp, BANK_NAME_LEN - 1, false); // if (ui_select_name_state == false) { - // lcd.setCursor(12, 1); - // lcd.print(" "); - // lcd.setCursor(0, 1); - // lcd.print("["); - // lcd.setCursor(11, 1); - // lcd.print("]"); - // lcd.blink(); - // ui_select_name_state = UI_select_name(1, 1, seq.seq_name_temp, BANK_NAME_LEN - 1, true); + // display.setCursor(12, 1); + // display.print(" "); + // display.setCursor(0, 1); + // display.print("["); + // display.setCursor(11, 1); + // display.print("]"); + // display.blink(); + // ui_select_name_state = UI_select_name(1, 1, seq.name_temp, BANK_NAME_LEN - 1, true); // } } } @@ -8368,14 +8368,14 @@ void UI_func_set_performance_name(uint8_t param) if (mode == 1) { - ui_select_name_state = UI_select_name(1, 1, seq.seq_name_temp, BANK_NAME_LEN - 1, false); + ui_select_name_state = UI_select_name(1, 1, seq.name_temp, BANK_NAME_LEN - 1, false); if (ui_select_name_state == true) { - strcpy( seq.seq_name, seq.seq_name_temp); + strcpy( seq.name, seq.name_temp); mode = 0xff; - lcd.noBlink(); - lcd.setCursor(0, 1); - lcd.print(F("OK. ")); + display.noBlink(); + display.setCursor(0, 1); + display.print(F("OK. ")); delay(MESSAGE_WAIT_TIME); LCDML.FUNC_goBackToMenu(); } @@ -8384,17 +8384,17 @@ void UI_func_set_performance_name(uint8_t param) if (mode == 0 ) { mode = 1; - strcpy(seq.seq_name_temp, seq.seq_name); - lcd.setCursor(0, 1); - lcd.print(F("[ ] ")); - ui_select_name_state = UI_select_name(1, 1, seq.seq_name_temp, BANK_NAME_LEN - 1, true); - lcd.blink(); + strcpy(seq.name_temp, seq.name); + display.setCursor(0, 1); + display.print(F("[ ] ")); + ui_select_name_state = UI_select_name(1, 1, seq.name_temp, BANK_NAME_LEN - 1, true); + display.blink(); } } if (LCDML.FUNC_close()) // ****** STABLE END ********* { encoderDir[ENC_R].reset(); - lcd.noBlink(); + display.noBlink(); } } @@ -8407,14 +8407,14 @@ void UI_func_sysex_send_bank(uint8_t param) { encoderDir[ENC_R].reset(); bank_number = configuration.dexed[selected_instance_id].bank; - lcd.setCursor(0, 0); - lcd.print(F("MIDI Send Bank")); + display.setCursor(0, 0); + display.print(F("MIDI Send Bank")); if (!get_bank_name(configuration.dexed[selected_instance_id].bank, bank_name, sizeof(bank_name))) strncpy(bank_name, "*ERROR*", sizeof(bank_name)); - lcd.show(1, 2, 1, "["); - lcd.show(1, 14, 1, "]"); - lcd.show(1, 0, 2, configuration.dexed[selected_instance_id].bank); - lcd.show(1, 3, 10, bank_name); + display.show(1, 2, 1, "["); + display.show(1, 14, 1, "]"); + display.show(1, 0, 2, configuration.dexed[selected_instance_id].bank); + display.show(1, 3, 10, bank_name); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -8432,8 +8432,8 @@ void UI_func_sysex_send_bank(uint8_t param) } if (!get_bank_name(bank_number, bank_name, sizeof(bank_name))) strcpy(bank_name, "*ERROR*"); - lcd.show(1, 0, 2, bank_number); - lcd.show(1, 3, 10, bank_name); + display.show(1, 0, 2, bank_number); + display.show(1, 3, 10, bank_name); } else if (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort()) { @@ -8454,7 +8454,7 @@ void UI_func_sysex_send_bank(uint8_t param) #ifdef DEBUG Serial.println(F("Connot read from SD.")); #endif - lcd.show(1, 0, 16, "Read error."); + display.show(1, 0, 16, "Read error."); bank_number = 0xff; } else @@ -8464,24 +8464,24 @@ void UI_func_sysex_send_bank(uint8_t param) sysex.read(bank_data, 4104); sysex.close(); - lcd.show(1, 0, 16, "Sending Ch"); + display.show(1, 0, 16, "Sending Ch"); if (configuration.dexed[selected_instance_id].midi_channel == MIDI_CHANNEL_OMNI) { - lcd.show(1, 11, 2, "01"); + display.show(1, 11, 2, "01"); send_sysex_bank(1, bank_data); } else { - lcd.show(1, 11, 2, configuration.dexed[selected_instance_id].midi_channel + 1); + display.show(1, 11, 2, configuration.dexed[selected_instance_id].midi_channel + 1); send_sysex_bank(configuration.dexed[selected_instance_id].midi_channel, bank_data); } - lcd.show(1, 0, 16, "Done."); + display.show(1, 0, 16, "Done."); bank_number = 0xff; } } else { - lcd.show(1, 0, 16, "No bank."); + display.show(1, 0, 16, "No bank."); bank_number = 0xff; } @@ -8496,8 +8496,8 @@ void UI_func_sysex_send_bank(uint8_t param) if (bank_number < 0xff) { - lcd.setCursor(0, 1); - lcd.print(F("Canceled. ")); + display.setCursor(0, 1); + display.print(F("Canceled. ")); delay(MESSAGE_WAIT_TIME); } } @@ -8521,12 +8521,12 @@ void UI_func_sysex_send_voice(uint8_t param) if (!get_bank_name(bank_number, bank_name, sizeof(bank_name))) strcpy(bank_name, "*ERROR*"); - lcd.setCursor(0, 0); - lcd.print(F("MIDI Send Voice")); - lcd.show(1, 0, 2, bank_number); - lcd.show(1, 3, 10, bank_name); - lcd.show(1, 2, 1, "["); - lcd.show(1, 13, 1, "]"); + display.setCursor(0, 0); + display.print(F("MIDI Send Voice")); + display.show(1, 0, 2, bank_number); + display.show(1, 3, 10, bank_name); + display.show(1, 2, 1, "["); + display.show(1, 13, 1, "]"); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -8547,8 +8547,8 @@ void UI_func_sysex_send_voice(uint8_t param) if (!get_bank_name(bank_number, bank_name, sizeof(bank_name))) strcpy(bank_name, "*ERROR*"); - lcd.show(1, 0, 2, bank_number); - lcd.show(1, 3, 10, bank_name); + display.show(1, 0, 2, bank_number); + display.show(1, 3, 10, bank_name); break; case 1: // Voice selection if (LCDML.BT_checkDown() && voice_number < MAX_VOICES - 1) @@ -8560,8 +8560,8 @@ void UI_func_sysex_send_voice(uint8_t param) if (!get_voice_by_bank_name(bank_number, bank_name, voice_number, voice_name, sizeof(voice_name))) strncpy(voice_name, "*ERROR*", sizeof(voice_name)); - lcd.show(1, 0, 2, voice_number + 1); - lcd.show(1, 3, 10, voice_name); + display.show(1, 0, 2, voice_number + 1); + display.show(1, 3, 10, voice_name); break; } } @@ -8577,8 +8577,8 @@ void UI_func_sysex_send_voice(uint8_t param) if (!get_voice_by_bank_name(bank_number, bank_name, voice_number, voice_name, sizeof(voice_name))) strncpy(voice_name, "*ERROR*", sizeof(voice_name)); - lcd.show(1, 0, 2, voice_number + 1); - lcd.show(1, 3, 10, voice_name); + display.show(1, 0, 2, voice_number + 1); + display.show(1, 3, 10, voice_name); break; case 2: File sysex; @@ -8600,7 +8600,7 @@ void UI_func_sysex_send_voice(uint8_t param) #ifdef DEBUG Serial.println(F("Connot read from SD.")); #endif - lcd.show(1, 0, 16, "Read error."); + display.show(1, 0, 16, "Read error."); bank_number = 0xff; } else @@ -8613,19 +8613,19 @@ void UI_func_sysex_send_voice(uint8_t param) MicroDexed[selected_instance_id]->decodeVoice(voice_data, encoded_voice_data); - lcd.show(1, 0, 16, "Sending Ch"); + display.show(1, 0, 16, "Sending Ch"); if (configuration.dexed[selected_instance_id].midi_channel == MIDI_CHANNEL_OMNI) { - lcd.show(1, 11, 2, "01"); + display.show(1, 11, 2, "01"); send_sysex_voice(1, voice_data); } else { - lcd.show(1, 11, 2, configuration.dexed[selected_instance_id].midi_channel + 1); + display.show(1, 11, 2, configuration.dexed[selected_instance_id].midi_channel + 1); send_sysex_voice(configuration.dexed[selected_instance_id].midi_channel, voice_data); } delay(MESSAGE_WAIT_TIME); - lcd.show(1, 0, 16, "Done."); + display.show(1, 0, 16, "Done."); sysex.close(); bank_number = 0xff; @@ -8633,7 +8633,7 @@ void UI_func_sysex_send_voice(uint8_t param) } else { - lcd.show(1, 0, 16, "No voice."); + display.show(1, 0, 16, "No voice."); bank_number = 0xff; } @@ -8650,7 +8650,7 @@ void UI_func_sysex_send_voice(uint8_t param) { if (mode < 0xff) { - lcd.show(1, 0, 16, "Canceled."); + display.show(1, 0, 16, "Canceled."); delay(MESSAGE_WAIT_TIME); } encoderDir[ENC_R].reset(); @@ -8663,10 +8663,10 @@ void UI_func_eq_1(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { encoderDir[ENC_R].reset(); - lcd.setCursor(0, 0); - lcd.print(F("EQ Low-Cut")); - lcd.setCursor(0, 1); - lcd.print(F("Not implemented.")); + display.setCursor(0, 0); + display.print(F("EQ Low-Cut")); + display.setCursor(0, 1); + display.print(F("Not implemented.")); } #else if (LCDML.FUNC_setup()) // ****** SETUP ********* @@ -8711,10 +8711,10 @@ void UI_func_eq_2(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { encoderDir[ENC_R].reset(); - lcd.setCursor(0, 0); - lcd.print(F("EQ 120Hz")); - lcd.setCursor(0, 1); - lcd.print(F("Not implemented.")); + display.setCursor(0, 0); + display.print(F("EQ 120Hz")); + display.setCursor(0, 1); + display.print(F("Not implemented.")); } #else if (LCDML.FUNC_setup()) // ****** SETUP ********* @@ -8758,10 +8758,10 @@ void UI_func_eq_3(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { encoderDir[ENC_R].reset(); - lcd.setCursor(0, 0); - lcd.print(F("EQ 220Hz")); - lcd.setCursor(0, 1); - lcd.print(F("Not implemented.")); + display.setCursor(0, 0); + display.print(F("EQ 220Hz")); + display.setCursor(0, 1); + display.print(F("Not implemented.")); } #else if (LCDML.FUNC_setup()) // ****** SETUP ********* @@ -8805,10 +8805,10 @@ void UI_func_eq_4(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { encoderDir[ENC_R].reset(); - lcd.setCursor(0, 0); - lcd.print(F("EQ 1000Hz")); - lcd.setCursor(0, 1); - lcd.print(F("Not implemented.")); + display.setCursor(0, 0); + display.print(F("EQ 1000Hz")); + display.setCursor(0, 1); + display.print(F("Not implemented.")); } #else if (LCDML.FUNC_setup()) // ****** SETUP ********* @@ -8852,10 +8852,10 @@ void UI_func_eq_5(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { encoderDir[ENC_R].reset(); - lcd.setCursor(0, 0); - lcd.print(F("EQ 2000Hz")); - lcd.setCursor(0, 1); - lcd.print(F("Not implemented.")); + display.setCursor(0, 0); + display.print(F("EQ 2000Hz")); + display.setCursor(0, 1); + display.print(F("Not implemented.")); } #else if (LCDML.FUNC_setup()) // ****** SETUP ********* @@ -8899,10 +8899,10 @@ void UI_func_eq_6(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { encoderDir[ENC_R].reset(); - lcd.setCursor(0, 0); - lcd.print(F("EQ 7000Hz")); - lcd.setCursor(0, 1); - lcd.print(F("Not implemented.")); + display.setCursor(0, 0); + display.print(F("EQ 7000Hz")); + display.setCursor(0, 1); + display.print(F("Not implemented.")); } #else if (LCDML.FUNC_setup()) // ****** SETUP ********* @@ -8946,10 +8946,10 @@ void UI_func_eq_7(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { encoderDir[ENC_R].reset(); - lcd.setCursor(0, 0); - lcd.print(F("EQ High-Cut")); - lcd.setCursor(0, 1); - lcd.print(F("Not implemented.")); + display.setCursor(0, 0); + display.print(F("EQ High-Cut")); + display.setCursor(0, 1); + display.print(F("Not implemented.")); } #else if (LCDML.FUNC_setup()) // ****** SETUP ********* @@ -8997,15 +8997,15 @@ void UI_func_startup(uint8_t param) old_load_at_startup = configuration.sys.load_at_startup; encoderDir[ENC_R].reset(); - lcd.setCursor(0, 0); - lcd.show(0, 0, 16, "Load at startup"); + display.setCursor(0, 0); + display.show(0, 0, 16, "Load at startup"); if (configuration.sys.load_at_startup == 255) - lcd.show(1, 0, 16, "Last Perf."); + display.show(1, 0, 16, "Last Perf."); else if (configuration.sys.load_at_startup <= PERFORMANCE_NUM_MAX) { - lcd.show(1, 0, 16, "Fixed Perf. ["); - lcd.show(1, 13, 2, configuration.sys.load_at_startup); - lcd.show(1, 15, 1, "]"); + display.show(1, 0, 16, "Fixed Perf. ["); + display.show(1, 13, 2, configuration.sys.load_at_startup); + display.show(1, 15, 1, "]"); } } @@ -9032,7 +9032,7 @@ void UI_func_startup(uint8_t param) else if (LCDML.BT_checkEnter()) { stored = true; - lcd.show(1, 0, 16, "Done."); + display.show(1, 0, 16, "Done."); save_sd_sys_json(); if (configuration.sys.load_at_startup <= PERFORMANCE_NUM_MAX && configuration.sys.load_at_startup != configuration.sys.performance_number) load_sd_performance_json(configuration.sys.load_at_startup); @@ -9040,14 +9040,14 @@ void UI_func_startup(uint8_t param) LCDML.FUNC_goBackToMenu(); } - lcd.setCursor(0, 1); + display.setCursor(0, 1); if (configuration.sys.load_at_startup == 255) - lcd.show(1, 0, 16, "Last Perf."); + display.show(1, 0, 16, "Last Perf."); else if (configuration.sys.load_at_startup <= PERFORMANCE_NUM_MAX) { - lcd.show(1, 0, 16, "Fixed Perf. ["); - lcd.show(1, 13, 2, configuration.sys.load_at_startup); - lcd.show(1, 15, 1, "]"); + display.show(1, 0, 16, "Fixed Perf. ["); + display.show(1, 13, 2, configuration.sys.load_at_startup); + display.show(1, 15, 1, "]"); } } } @@ -9057,7 +9057,7 @@ void UI_func_startup(uint8_t param) //lcd_special_chars(SCROLLBAR); if (stored == false) { - lcd.show(1, 0, 16, "Canceled."); + display.show(1, 0, 16, "Canceled."); configuration.sys.load_at_startup = old_load_at_startup; delay(MESSAGE_WAIT_TIME); } @@ -9071,10 +9071,10 @@ void UI_function_not_enabled(void) { encoderDir[ENC_R].reset(); - lcd.setCursor(0, 0); - lcd.print(F("Function not")); - lcd.setCursor(0, 1); - lcd.print(F("enbaled!")); + display.setCursor(0, 0); + display.print(F("Function not")); + display.setCursor(0, 1); + display.print(F("enbaled!")); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -9094,10 +9094,10 @@ void UI_function_not_implemented(uint8_t param) { encoderDir[ENC_R].reset(); - lcd.setCursor(0, 0); - lcd.print(F("Function not")); - lcd.setCursor(0, 1); - lcd.print(F("implemented!")); + display.setCursor(0, 0); + display.print(F("Function not")); + display.setCursor(0, 1); + display.print(F("implemented!")); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -9127,9 +9127,9 @@ bool UI_select_name(uint8_t y, uint8_t x, char* edit_string, uint8_t len, bool i string_trim(edit_string); // just to be sure - lcd.setCursor(x, y); - lcd.print(edit_string); - lcd.setCursor(x, y); + display.setCursor(x, y); + display.print(edit_string); + display.setCursor(x, y); return (false); } @@ -9149,8 +9149,8 @@ bool UI_select_name(uint8_t y, uint8_t x, char* edit_string, uint8_t len, bool i edit_string[edit_pos] = accepted_chars[edit_value]; - lcd.setCursor(x + edit_pos, y); - lcd.print(edit_string[edit_pos]); + display.setCursor(x + edit_pos, y); + display.print(edit_string[edit_pos]); } else { @@ -9164,13 +9164,13 @@ bool UI_select_name(uint8_t y, uint8_t x, char* edit_string, uint8_t len, bool i if (edit_pos == len) { - lcd.noBlink(); - lcd.setCursor(x - 1, y); - lcd.print(F(" ")); - lcd.setCursor(x + len, y); - lcd.print(F(" ")); - lcd.setCursor(x + len + 1, y); - lcd.print(F("[OK]")); + display.noBlink(); + display.setCursor(x - 1, y); + display.print(F(" ")); + display.setCursor(x + len, y); + display.print(F(" ")); + display.setCursor(x + len + 1, y); + display.print(F("[OK]")); } } } @@ -9186,8 +9186,8 @@ bool UI_select_name(uint8_t y, uint8_t x, char* edit_string, uint8_t len, bool i edit_value = 1; edit_string[edit_pos] = accepted_chars[edit_value]; - lcd.setCursor(x + edit_pos, y); - lcd.print(edit_string[edit_pos]); + display.setCursor(x + edit_pos, y); + display.print(edit_string[edit_pos]); } else { @@ -9198,13 +9198,13 @@ bool UI_select_name(uint8_t y, uint8_t x, char* edit_string, uint8_t len, bool i if (edit_pos == last_char_pos) { - lcd.setCursor(x - 1, y); - lcd.print(F("[")); - lcd.setCursor(x + len, y); - lcd.print(F("]")); - lcd.setCursor(x + len + 1, y); - lcd.print(F(" ")); - lcd.blink(); + display.setCursor(x - 1, y); + display.print(F("[")); + display.setCursor(x + len, y); + display.print(F("]")); + display.setCursor(x + len + 1, y); + display.print(F(" ")); + display.blink(); } } } @@ -9228,17 +9228,17 @@ bool UI_select_name(uint8_t y, uint8_t x, char* edit_string, uint8_t len, bool i edit_pos++; if (edit_mode == true) { - lcd.setCursor(x + len + 1, y); - lcd.print(F("*")); + display.setCursor(x + len + 1, y); + display.print(F("*")); } else { - lcd.setCursor(x + len + 1, y); - lcd.print(F(" ")); + display.setCursor(x + len + 1, y); + display.print(F(" ")); } } - lcd.setCursor(x + edit_pos, y); + display.setCursor(x + edit_pos, y); encoderDir[ENC_R].reset(); return (false); @@ -9311,7 +9311,7 @@ void lcd_display_float(float var, uint8_t size_number, uint8_t size_fraction, bo Serial.println(f); Serial.println(s); - lcd.print(s); + display.print(s); } inline void lcd_display_bar_int(const char* title, uint32_t value, float factor, int32_t min_value, int32_t max_value, uint8_t size, bool zeros, bool sign, bool init) @@ -9343,30 +9343,30 @@ void lcd_display_bar_float(const char* title, float value, float factor, int32_t // Title if (init == true) - lcd.show(0, 0, LCD_cols - 2, title); - //lcd.show(0, 0, LCD_cols - 3, title); + display.show(0, 0, LCD_cols - 2, title); + //display.show(0, 0, LCD_cols - 3, title); // Value - lcd.setCursor(LCD_cols - size, 1); + display.setCursor(LCD_cols - size, 1); lcd_display_float(value * factor, size_number, size_fraction, zeros, false, sign); // TBD // Bar - lcd.setCursor(0, 1); + display.setCursor(0, 1); if (vi == 0) { - lcd.write((uint8_t)(vf / 2.0 - 0.5) + 2); + display.write((uint8_t)(vf / 2.0 - 0.5) + 2); for (uint8_t i = vi + 1; i < LCD_cols - size; i++) - lcd.print(F(" ")); // empty block + display.print(F(" ")); // empty block } else { for (uint8_t i = 0; i < vi; i++) - lcd.write((uint8_t)4 + 2); // full block + display.write((uint8_t)4 + 2); // full block if (vi < LCD_cols - size) - lcd.write((uint8_t)(vf / 2.0 - 0.5) + 2); + display.write((uint8_t)(vf / 2.0 - 0.5) + 2); for (uint8_t i = vi + 1; i < LCD_cols - size; i++) - lcd.print(F(" ")); // empty block + display.print(F(" ")); // empty block } } @@ -9397,37 +9397,37 @@ void lcd_display_meter_float(const char* title, float value, float factor, float if (init == true) { // Title - lcd.setCursor(0, 0); - lcd.print(title); + display.setCursor(0, 0); + display.print(title); } // Value - lcd.setCursor(LCD_cols - size, 1); + display.setCursor(LCD_cols - size, 1); lcd_display_float((value + offset) * factor, size_number, size_fraction, zeros, false, sign); // Bar - lcd.setCursor(0, 1); + display.setCursor(0, 1); if (vi == 0) { - lcd.write((uint8_t)(vf / 2.0) + 2); + display.write((uint8_t)(vf / 2.0) + 2); for (uint8_t i = 1; i < LCD_cols - size; i++) - lcd.print(F(" ")); // empty block + display.print(F(" ")); // empty block } else if (vi == LCD_cols - size) { for (uint8_t i = 0; i < LCD_cols - size - 1; i++) - lcd.print(F(" ")); // empty block - lcd.write(4 + 2); + display.print(F(" ")); // empty block + display.write(4 + 2); } else { for (uint8_t i = 0; i < LCD_cols - size; i++) - lcd.print(F(" ")); // empty block - lcd.setCursor(vi, 1); - lcd.write((uint8_t)(vf / 2.0) + 2); + display.print(F(" ")); // empty block + display.setCursor(vi, 1); + display.write((uint8_t)(vf / 2.0) + 2); for (uint8_t i = vi + 1; i < LCD_cols - size; i++) - lcd.print(F(" ")); // empty block + display.print(F(" ")); // empty block } } @@ -9476,11 +9476,11 @@ void lcd_active_instance_number(uint8_t instance_id) } #if NUM_DEXED == 1 - lcd.createChar(0, instance_num[0]); - lcd.createChar(1, (uint8_t*)special_chars[17]); + display.createChar(0, instance_num[0]); + display.createChar(1, (uint8_t*)special_chars[17]); #else - lcd.createChar(0, instance_num[0]); - lcd.createChar(1, instance_num[1]); + display.createChar(0, instance_num[0]); + display.createChar(1, instance_num[1]); #endif } @@ -9497,7 +9497,7 @@ void lcd_OP_active_instance_number(uint8_t instance_id, uint8_t op) else instance_num[n][i] = ~special_chars[n][i]; } - lcd.createChar(n, instance_num[n]); + display.createChar(n, instance_num[n]); } for (i = 0; i < 8; i++) @@ -9534,11 +9534,11 @@ void lcd_OP_active_instance_number(uint8_t instance_id, uint8_t op) } } - lcd.createChar(0, instance_num[0]); + display.createChar(0, instance_num[0]); #if NUM_DEXED > 1 - lcd.createChar(1, instance_num[1]); + display.createChar(1, instance_num[1]); #else - lcd.createChar(1, (uint8_t *)special_chars[17]); + display.createChar(1, (uint8_t *)special_chars[17]); #endif } @@ -9551,7 +9551,7 @@ void lcd_special_chars(uint8_t mode) for (uint8_t i = 0; i < 5; i++) { #ifdef I2C_DISPLAY - lcd.createChar(i, (uint8_t*)scroll_bar[i]); + display.createChar(i, (uint8_t*)scroll_bar[i]); #else flipped_scroll_bar[i] = rotTile(scroll_bar[i]); #endif @@ -9562,7 +9562,7 @@ void lcd_special_chars(uint8_t mode) for (uint8_t i = 0; i < 7; i++) { #ifdef I2C_DISPLAY - lcd.createChar(i + 2, (uint8_t*)block_bar[i]); + display.createChar(i + 2, (uint8_t*)block_bar[i]); #else flipped_block_bar[i] = rotTile(block_bar[i]); #endif @@ -9573,7 +9573,7 @@ void lcd_special_chars(uint8_t mode) for (uint8_t i = 0; i < 7; i++) { #ifdef I2C_DISPLAY - lcd.createChar(i + 2, (uint8_t*)meter_bar[i]); + display.createChar(i + 2, (uint8_t*)meter_bar[i]); #else flipped_meter_bar[i] = rotTile(meter_bar[i]); #endif @@ -9585,39 +9585,39 @@ void lcd_special_chars(uint8_t mode) #ifdef USE_FX void lcd_display_delay_sync(uint8_t sync) { - lcd.show(0, 0, LCD_cols - 2, "Delay Sync"); - if (seq.seq_running == false)lcd.show(1, 0, 10, "MIDI Sync "); else lcd.show(1, 0, 10, "Seq. Sync "); + display.show(0, 0, LCD_cols - 2, "Delay Sync"); + if (seq.running == false)display.show(1, 0, 10, "MIDI Sync "); else display.show(1, 0, 10, "Seq. Sync "); switch (sync) { case 1: - lcd.show(1, 10, 6, "1/16"); + display.show(1, 10, 6, "1/16"); break; case 2: - lcd.show(1, 10, 6, "1/16T"); + display.show(1, 10, 6, "1/16T"); break; case 3: - lcd.show(1, 10, 6, "1/8"); + display.show(1, 10, 6, "1/8"); break; case 4: - lcd.show(1, 10, 6, "1/8T"); + display.show(1, 10, 6, "1/8T"); break; case 5: - lcd.show(1, 10, 6, "1/4"); + display.show(1, 10, 6, "1/4"); break; case 6: - lcd.show(1, 10, 6, "1/4T"); + display.show(1, 10, 6, "1/4T"); break; case 7: - lcd.show(1, 10, 6, "1/2"); + display.show(1, 10, 6, "1/2"); break; case 8: - lcd.show(1, 10, 6, "1/2T"); + display.show(1, 10, 6, "1/2T"); break; case 9: - lcd.show(1, 10, 6, "1/1"); + display.show(1, 10, 6, "1/1"); break; } - if (seq.seq_running == false) { + if (seq.running == false) { uint16_t midi_sync_delay_time = uint16_t(60000.0 * midi_ticks_factor[sync] / midi_bpm + 0.5); if (midi_sync_delay_time > DELAY_MAX_TIME) @@ -9633,10 +9633,10 @@ void lcd_display_delay_sync(uint8_t sync) } } else { - uint16_t midi_sync_delay_time = uint16_t(60000.0 * midi_ticks_factor[sync] / seq.seq_bpm); + uint16_t midi_sync_delay_time = uint16_t(60000.0 * midi_ticks_factor[sync] / seq.bpm); delay_fx[selected_instance_id]->delay(0, constrain(midi_sync_delay_time, DELAY_TIME_MIN, DELAY_TIME_MAX * 10)); } - lcd.show(1, 15, 1, "!"); + display.show(1, 15, 1, "!"); } #endif @@ -9652,8 +9652,8 @@ void string_trim(char *s) void locate_previous_non_favorite() { //find prev. non fav in current bank - lcd.setCursor(3, 0); - lcd.print("= 0 && configuration.dexed[selected_instance_id].bank >= 0) { - lcd.setCursor(3, 0); - lcd.print("SEARCHING"); + display.setCursor(3, 0); + display.print(">SEARCHING"); do { //first find next fav in current bank @@ -9813,8 +9813,8 @@ void locate_next_favorite() void locate_next_non_favorite() { //find next non-fav in current bank - lcd.setCursor(3, 0); - lcd.print(">SEARCHING"); + display.setCursor(3, 0); + display.print(">SEARCHING"); do { configuration.dexed[selected_instance_id].voice++; if (configuration.dexed[selected_instance_id].voice > 31) { @@ -9894,20 +9894,20 @@ void draw_favorite_icon(uint8_t b, uint8_t v, uint8_t instance_id) if (SD.exists(tmp)) { //is Favorite #ifdef TESTDISPLAY20x4 - lcd.setCursor(17, 0); + display.setCursor(17, 0); #else - lcd.setCursor(13, 0); + display.setCursor(13, 0); #endif - lcd.write(2); //fav symbol + display.write(2); //fav symbol } else { // it was not a favorite #ifdef TESTDISPLAY20x4 - lcd.setCursor(17, 0); + display.setCursor(17, 0); #else - lcd.setCursor(13, 0); + display.setCursor(13, 0); #endif - lcd.print(" "); + display.print(" "); } } } @@ -9973,11 +9973,11 @@ void save_favorite(uint8_t b, uint8_t v, uint8_t instance_id) myFav.close(); Serial.println("Favorite saved..."); #ifdef TESTDISPLAY20x4 - lcd.setCursor(17, 0); + display.setCursor(17, 0); #else - lcd.setCursor(13, 0); + display.setCursor(13, 0); #endif - lcd.write(2); //fav symbol + display.write(2); //fav symbol #ifdef DEBUG Serial.println("Added to Favorites..."); #endif @@ -10002,11 +10002,11 @@ void save_favorite(uint8_t b, uint8_t v, uint8_t instance_id) #endif } #ifdef TESTDISPLAY20x4 - lcd.setCursor(17, 0); + display.setCursor(17, 0); #else - lcd.setCursor(13, 0); + display.setCursor(13, 0); #endif - lcd.print(" "); //remove fav symbol + display.print(" "); //remove fav symbol #ifdef DEBUG Serial.println("Removed from Favorites..."); #endif diff --git a/dexed_sd.cpp b/dexed_sd.cpp index cce3dd2..357280f 100644 --- a/dexed_sd.cpp +++ b/dexed_sd.cpp @@ -1250,8 +1250,8 @@ bool save_sd_seq_sub_vel_json(uint8_t number) Serial.print(F(" to ")); Serial.println(filename); #endif - int total = sizeof(seq.seq_vel); - int columns = sizeof(seq.seq_vel[0]); + int total = sizeof(seq.vel); + int columns = sizeof(seq.vel[0]); int rows = total / columns; AudioNoInterrupts(); SD.begin(); @@ -1262,7 +1262,7 @@ bool save_sd_seq_sub_vel_json(uint8_t number) for (uint8_t i = 0; i < rows; i++) { for (uint8_t j = 0; j < columns; j++) { - data_json["seq_velocity"][count] = seq.seq_vel[i][j]; + data_json["seq_velocity"][count] = seq.vel[i][j]; count++; } } @@ -1307,8 +1307,8 @@ bool save_sd_seq_sub_patterns_json(uint8_t number) Serial.print(F(" to ")); Serial.println(filename); #endif - int total = sizeof(seq.seq_data); - int columns = sizeof(seq.seq_data[0]); + int total = sizeof(seq.data); + int columns = sizeof(seq.data[0]); int rows = total / columns; AudioNoInterrupts(); SD.begin(); @@ -1319,7 +1319,7 @@ bool save_sd_seq_sub_patterns_json(uint8_t number) for (uint8_t i = 0; i < rows; i++) { for (uint8_t j = 0; j < columns; j++) { - data_json["seq_data"][count] = seq.seq_data[i][j]; + data_json["seq_data"][count] = seq.data[i][j]; count++; } } @@ -1354,7 +1354,7 @@ bool save_sd_performance_json(uint8_t number) bool seq_was_running = false; number = constrain(number, PERFORMANCE_NUM_MIN, PERFORMANCE_NUM_MAX); - if (seq.seq_running == true ) { + if (seq.running == true ) { seq_was_running = true; handleStop(); } @@ -1394,8 +1394,8 @@ bool save_sd_performance_json(uint8_t number) Serial.print(F(" to ")); Serial.println(filename); #endif - int total = sizeof(seq.seq_patternchain); - int columns = sizeof(seq.seq_patternchain[0]); + int total = sizeof(seq.patternchain); + int columns = sizeof(seq.patternchain[0]); int rows = total / columns; Serial.print(F(" ")); SD.remove(filename); @@ -1411,35 +1411,35 @@ bool save_sd_performance_json(uint8_t number) for (uint8_t i = 0; i < rows; i++) { for (uint8_t j = 0; j < columns; j++) { - data_json["seq_patternchain"][count] = seq.seq_patternchain[i][j]; + data_json["seq_patternchain"][count] = seq.patternchain[i][j]; count++; } } count = 0; - data_json["seq_tempo_ms"] = seq.seq_tempo_ms ; - data_json["seq_bpm"] = seq.seq_bpm; + data_json["seq_tempo_ms"] = seq.tempo_ms ; + data_json["seq_bpm"] = seq.bpm; data_json["arp_play_basenote"] = seq.arp_play_basenote; data_json["arp_speed"] = seq.arp_speed; data_json["arp_lenght"] = seq.arp_lenght; data_json["arp_style"] = seq.arp_style; - data_json["seq_chord_velocity"] = seq.seq_chord_velocity; - data_json["seq_chord_dexed_inst"] = seq.seq_chord_dexed_inst; - data_json["seq_chain_lenght"] = seq.seq_chain_lenght; - data_json["seq_transpose"] = seq.seq_transpose; - data_json["chord_key_ammount"] = seq.seq_chord_key_ammount; - data_json["seq_oct_shift"] = seq.seq_oct_shift; - data_json["seq_element_shift"] = seq.seq_element_shift; - for (uint8_t i = 0; i < sizeof(seq.seq_track_type); i++) { - data_json["track_type"][i] = seq.seq_track_type[i]; + data_json["seq_chord_velocity"] = seq.chord_velocity; + data_json["seq_chord_dexed_inst"] = seq.chord_dexed_inst; + data_json["seq_chain_lenght"] = seq.chain_lenght; + data_json["seq_transpose"] = seq.transpose; + data_json["chord_key_ammount"] = seq.chord_key_ammount; + data_json["seq_oct_shift"] = seq.oct_shift; + data_json["seq_element_shift"] = seq.element_shift; + for (uint8_t i = 0; i < sizeof(seq.track_type); i++) { + data_json["track_type"][i] = seq.track_type[i]; } - for (uint8_t i = 0; i < sizeof(seq.seq_content_type); i++) { - data_json["content_type"][i] = seq.seq_content_type[i]; + for (uint8_t i = 0; i < sizeof(seq.content_type); i++) { + data_json["content_type"][i] = seq.content_type[i]; } - for (uint8_t i = 0; i < sizeof(seq.seq_inst_dexed); i++) { - data_json["seq_inst_dexed"][i] = seq.seq_inst_dexed[i]; + for (uint8_t i = 0; i < sizeof(seq.inst_dexed); i++) { + data_json["seq_inst_dexed"][i] = seq.inst_dexed[i]; } for (uint8_t i = 0; i < FILENAME_LEN; i++) { - data_json["seq_name"][i] = seq.seq_name[i]; + data_json["seq_name"][i] = seq.name[i]; } #if defined(DEBUG) && defined(DEBUG_SHOW_JSON) @@ -1513,7 +1513,7 @@ bool check_performance_directory(uint8_t number) void get_sd_performance_name_json(uint8_t number) { number = constrain(number, PERFORMANCE_NUM_MIN, PERFORMANCE_NUM_MAX); - memset(seq.seq_name_temp, 0, FILENAME_LEN); + memset(seq.name_temp, 0, FILENAME_LEN); if (sd_card > 0) { File json; @@ -1538,13 +1538,13 @@ void get_sd_performance_name_json(uint8_t number) } if (data_json["seq_name"][0] != 0) { for (uint8_t i = 0; i < FILENAME_LEN; i++) { - seq.seq_name_temp[i] = data_json["seq_name"][i]; + seq.name_temp[i] = data_json["seq_name"][i]; } #ifdef DEBUG Serial.print(F("Get performance name for ")); Serial.print(number); Serial.print(F(": ")); - Serial.print(seq.seq_name_temp); + Serial.print(seq.name_temp); Serial.println(); #endif } @@ -1596,14 +1596,14 @@ bool load_sd_seq_sub_vel_json(uint8_t number) serializeJsonPretty(data_json, Serial); Serial.println(); #endif - int total = sizeof(seq.seq_vel); - int columns = sizeof(seq.seq_vel[0]); + int total = sizeof(seq.vel); + int columns = sizeof(seq.vel[0]); int rows = total / columns; int count = 0; for (uint8_t i = 0; i < rows; i++) { for (uint8_t j = 0; j < columns; j++) { - seq.seq_vel[i][j] = data_json["seq_velocity"][count]; + seq.vel[i][j] = data_json["seq_velocity"][count]; count++; } } @@ -1665,15 +1665,15 @@ bool load_sd_seq_sub_patterns_json(uint8_t number) serializeJsonPretty(data_json, Serial); Serial.println(); #endif - int total = sizeof(seq.seq_data); - int columns = sizeof(seq.seq_data[0]); + int total = sizeof(seq.data); + int columns = sizeof(seq.data[0]); int rows = total / columns; int count = 0; for (uint8_t i = 0; i < rows; i++) { for (uint8_t j = 0; j < columns; j++) { - seq.seq_data[i][j] = data_json["seq_data"][count]; + seq.data[i][j] = data_json["seq_data"][count]; count++; } } @@ -1703,10 +1703,10 @@ bool load_sd_performance_json(uint8_t number) #ifdef USE_SEQUENCER bool seq_was_running = false; - if (seq.seq_running) + if (seq.running) { seq_was_running = true; - seq.seq_running = false; + seq.running = false; } #endif @@ -1747,52 +1747,52 @@ bool load_sd_performance_json(uint8_t number) serializeJsonPretty(data_json, Serial); Serial.println(); #endif - int total = sizeof(seq.seq_patternchain); - int columns = sizeof(seq.seq_patternchain[0]); + int total = sizeof(seq.patternchain); + int columns = sizeof(seq.patternchain[0]); int rows = total / columns; int count = 0; for (uint8_t i = 0; i < rows; i++) { for (uint8_t j = 0; j < columns; j++) { - seq.seq_patternchain[i][j] = data_json["seq_patternchain"][count]; + seq.patternchain[i][j] = data_json["seq_patternchain"][count]; count++; } } - for (uint8_t i = 0; i < sizeof(seq.seq_track_type); i++) + for (uint8_t i = 0; i < sizeof(seq.track_type); i++) { - seq.seq_track_type[i] = data_json["track_type"][i]; + seq.track_type[i] = data_json["track_type"][i]; } - for (uint8_t i = 0; i < sizeof(seq.seq_content_type); i++) + for (uint8_t i = 0; i < sizeof(seq.content_type); i++) { - seq.seq_content_type[i] = data_json["content_type"][i]; + seq.content_type[i] = data_json["content_type"][i]; } - for (uint8_t i = 0; i < sizeof(seq.seq_inst_dexed); i++) + for (uint8_t i = 0; i < sizeof(seq.inst_dexed); i++) { - seq.seq_inst_dexed[i] = data_json["seq_inst_dexed"][i]; + seq.inst_dexed[i] = data_json["seq_inst_dexed"][i]; } if (data_json["seq_name"][0] != 0) { for (uint8_t i = 0; i < FILENAME_LEN; i++) { - seq.seq_name[i] = data_json["seq_name"][i]; + seq.name[i] = data_json["seq_name"][i]; } } count = 0; - seq.seq_tempo_ms = data_json["seq_tempo_ms"] ; - seq.seq_bpm = data_json["seq_bpm"]; + seq.tempo_ms = data_json["seq_tempo_ms"] ; + seq.bpm = data_json["seq_bpm"]; seq.arp_play_basenote = data_json["arp_play_basenote"]; seq.arp_speed = data_json["arp_speed"] ; seq.arp_lenght = data_json["arp_lenght"]; seq.arp_style = data_json["arp_style"]; - seq.seq_chord_velocity = data_json["seq_chord_velocity"]; - seq.seq_chord_dexed_inst = data_json["seq_chord_dexed_inst"] ; - seq.seq_chain_lenght = data_json["seq_chain_lenght"]; - seq.seq_transpose = data_json["seq_transpose"]; - seq.seq_chord_key_ammount = data_json["chord_key_ammount"]; - seq.seq_oct_shift = data_json["seq_oct_shift"]; - seq.seq_element_shift = data_json["seq_element_shift"]; + seq.chord_velocity = data_json["seq_chord_velocity"]; + seq.chord_dexed_inst = data_json["seq_chord_dexed_inst"] ; + seq.chain_lenght = data_json["seq_chain_lenght"]; + seq.transpose = data_json["seq_transpose"]; + seq.chord_key_ammount = data_json["chord_key_ammount"]; + seq.oct_shift = data_json["seq_oct_shift"]; + seq.element_shift = data_json["seq_element_shift"]; for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) { #ifdef DEBUG @@ -1811,18 +1811,18 @@ bool load_sd_performance_json(uint8_t number) set_fx_params();*/ dac_unmute(); - seq.seq_step = 0; - seq.seq_chain_active_step = 0; + seq.step = 0; + seq.chain_active_step = 0; #ifdef USE_SEQUENCER if (seq_was_running) { - sequencer_timer.begin(sequencer, seq.seq_tempo_ms / 2); - seq.seq_running = true; + sequencer_timer.begin(sequencer, seq.tempo_ms / 2); + seq.running = true; } else - sequencer_timer.begin(sequencer, seq.seq_tempo_ms / 2, false); + sequencer_timer.begin(sequencer, seq.tempo_ms / 2, false); #else - seq.seq_running = false; + seq.running = false; #endif return (true); } diff --git a/midi_devices.hpp b/midi_devices.hpp index 1185ab0..ffa7e76 100644 --- a/midi_devices.hpp +++ b/midi_devices.hpp @@ -84,8 +84,8 @@ void MD_sendControlChange(uint8_t channel, uint8_t cc, uint8_t value); #ifdef MIDI_DEVICE_DIN void handleNoteOn_MIDI_DEVICE_DIN(byte inChannel, byte inNumber, byte inVelocity) { - seq.seq_note_in=inNumber; - seq.seq_note_in_velocity=inVelocity; + seq.note_in=inNumber; + seq.note_in_velocity=inVelocity; handleNoteOn(inChannel, inNumber, inVelocity); #ifdef DEBUG Serial.print(F("[MIDI_DIN] NoteOn")); @@ -585,8 +585,8 @@ void handleSystemReset_MIDI_DEVICE_DIN(void) #ifdef MIDI_DEVICE_USB_HOST void handleNoteOn_MIDI_DEVICE_USB_HOST(byte inChannel, byte inNumber, byte inVelocity) { - seq.seq_note_in=inNumber; - seq.seq_note_in_velocity=inVelocity; + seq.note_in=inNumber; + seq.note_in_velocity=inVelocity; handleNoteOn(inChannel, inNumber, inVelocity); #ifdef DEBUG Serial.print(F("[MIDI_USB_HOST] NoteOn")); diff --git a/sequencer.cpp b/sequencer.cpp index e4bf2bc..8a45b2e 100644 --- a/sequencer.cpp +++ b/sequencer.cpp @@ -28,7 +28,7 @@ #include extern LCDMenuLib2 LCDML; -extern LiquidCrystal_I2C lcd; +//extern LiquidCrystal_I2C lcd; extern config_t configuration; extern uint8_t drum_midi_channel; extern uint8_t activesample; @@ -48,122 +48,122 @@ sequencer_t seq; void seq_live_recording(void) { //record to sequencer if sequencer menu is active and recording is active - if (seq.seq_note_in > 0 && seq.seq_recording == true && LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_seq_pattern_editor)) + if (seq.note_in > 0 && seq.recording == true && LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_seq_pattern_editor)) { - seq.seq_data[seq.seq_active_track][seq.seq_step] = seq.seq_note_in; + seq.data[seq.active_track][seq.step] = seq.note_in; if ( get_sample_note(activesample) > 209 ) // pitched sample { - seq.seq_vel[seq.seq_active_track][seq.seq_step] = get_sample_note(activesample); + seq.vel[seq.active_track][seq.step] = get_sample_note(activesample); } else - seq.seq_vel[seq.seq_active_track][seq.seq_step] = seq.seq_note_in_velocity; + seq.vel[seq.active_track][seq.step] = seq.note_in_velocity; - seq.seq_note_in = 0; - seq.seq_note_in_velocity = 0; + seq.note_in = 0; + seq.note_in_velocity = 0; } } void sequencer_part1(void) { - //if (seq.seq_note_in > 0 && seq.seq_note_in < 62 && seq.seq_recording == false ) { - //handleNoteOff(configuration.dexed[0].midi_channel, seq.seq_data[3][seq.seq_step] + seq.seq_transpose , 0); - //handleNoteOff(configuration.dexed[0].midi_channel, seq.seq_data[3][seq.seq_step - 1] + seq.seq_transpose , 0); - //if (seq.seq_note_in>65)seq.seq_note_in=seq.seq_note_in-12; - //seq.seq_transpose = seq.seq_note_in % 12 ; - //seq.seq_transpose=seq.seq_transpose-12; - //seq.seq_note_in = 0; + //if (seq.note_in > 0 && seq.note_in < 62 && seq.recording == false ) { + //handleNoteOff(configuration.dexed[0].midi_channel, seq.data[3][seq.step] + seq.transpose , 0); + //handleNoteOff(configuration.dexed[0].midi_channel, seq.data[3][seq.step - 1] + seq.transpose , 0); + //if (seq.note_in>65)seq.note_in=seq.note_in-12; + //seq.transpose = seq.note_in % 12 ; + //seq.transpose=seq.transpose-12; + //seq.note_in = 0; //} seq_live_recording(); for (uint8_t d = 0; d < NUM_SEQ_TRACKS; d++) { - if (seq.seq_patternchain[seq.seq_chain_active_step][d] < NUM_SEQ_PATTERN ) // sequence not empty or muted + if (seq.patternchain[seq.chain_active_step][d] < NUM_SEQ_PATTERN ) // sequence not empty or muted { - if ( seq.seq_track_type[d] == 0) + if ( seq.track_type[d] == 0) { // drum track (drum samples and pitched one-shot samples) - if (seq.seq_data[ seq.seq_patternchain[seq.seq_chain_active_step][d] ][seq.seq_step] > 0 ) + if (seq.data[ seq.patternchain[seq.chain_active_step][d] ][seq.step] > 0 ) { - if (seq.seq_vel[ seq.seq_patternchain[seq.seq_chain_active_step][d] ][seq.seq_step] > 209) // it is a pitched sample + if (seq.vel[ seq.patternchain[seq.chain_active_step][d] ][seq.step] > 209) // it is a pitched sample { // Drum[slot]->setPlaybackRate( pow (2, (inNote - 72) / 12.00) * drum_config[sample].pitch ); get_sample_vol_max(sample) - set_sample_pitch(seq.seq_vel[ seq.seq_patternchain[seq.seq_chain_active_step][d] ][seq.seq_step] - 210 , (float)pow (2, (seq.seq_data[ seq.seq_patternchain[seq.seq_chain_active_step][d] ][seq.seq_step] - 72) / 12.00) * get_sample_p_offset( seq.seq_vel[ seq.seq_patternchain[seq.seq_chain_active_step][d] ][seq.seq_step] - 210 ) ); - handleNoteOn(drum_midi_channel, seq.seq_vel[ seq.seq_patternchain[seq.seq_chain_active_step][d] ][seq.seq_step] , 90 ); + set_sample_pitch(seq.vel[ seq.patternchain[seq.chain_active_step][d] ][seq.step] - 210 , (float)pow (2, (seq.data[ seq.patternchain[seq.chain_active_step][d] ][seq.step] - 72) / 12.00) * get_sample_p_offset( seq.vel[ seq.patternchain[seq.chain_active_step][d] ][seq.step] - 210 ) ); + handleNoteOn(drum_midi_channel, seq.vel[ seq.patternchain[seq.chain_active_step][d] ][seq.step] , 90 ); } else // else play normal drum sample - handleNoteOn(drum_midi_channel, seq.seq_data[ seq.seq_patternchain[seq.seq_chain_active_step][d] ][seq.seq_step] , seq.seq_vel[ seq.seq_patternchain[seq.seq_chain_active_step][d] ][seq.seq_step]); + handleNoteOn(drum_midi_channel, seq.data[ seq.patternchain[seq.chain_active_step][d] ][seq.step] , seq.vel[ seq.patternchain[seq.chain_active_step][d] ][seq.step]); } } else { - if (seq.seq_data[seq.seq_patternchain[seq.seq_chain_active_step][d]][seq.seq_step] > 0 ) // instrument track + if (seq.data[seq.patternchain[seq.chain_active_step][d]][seq.step] > 0 ) // instrument track { - if (seq.seq_track_type[d] == 1 || (seq.seq_track_type[d] == 3 && seq.arp_play_basenote) ) + if (seq.track_type[d] == 1 || (seq.track_type[d] == 3 && seq.arp_play_basenote) ) { - if (seq.seq_data[seq.seq_patternchain[seq.seq_chain_active_step][d]][seq.seq_step] != 130 ) + if (seq.data[seq.patternchain[seq.chain_active_step][d]][seq.step] != 130 ) { - handleNoteOn(configuration.dexed[seq.seq_inst_dexed[d]].midi_channel, seq.seq_data[ seq.seq_patternchain[seq.seq_chain_active_step][d] ][seq.seq_step], seq.seq_vel[ seq.seq_patternchain[seq.seq_chain_active_step][d] ][seq.seq_step]); - seq.seq_prev_note[d] = seq.seq_data[ seq.seq_patternchain[seq.seq_chain_active_step][d] ][seq.seq_step]; - seq.seq_prev_vel[d] = seq.seq_vel[ seq.seq_patternchain[seq.seq_chain_active_step][d] ][seq.seq_step]; + handleNoteOn(configuration.dexed[seq.inst_dexed[d]].midi_channel, seq.data[ seq.patternchain[seq.chain_active_step][d] ][seq.step], seq.vel[ seq.patternchain[seq.chain_active_step][d] ][seq.step]); + seq.prev_note[d] = seq.data[ seq.patternchain[seq.chain_active_step][d] ][seq.step]; + seq.prev_vel[d] = seq.vel[ seq.patternchain[seq.chain_active_step][d] ][seq.step]; } } - else if (seq.seq_track_type[d] == 2 ) //Chords + else if (seq.track_type[d] == 2 ) //Chords { - if (seq.seq_vel[ seq.seq_patternchain[seq.seq_chain_active_step][d]][seq.seq_step] > 199) + if (seq.vel[ seq.patternchain[seq.chain_active_step][d]][seq.step] > 199) { - //handleNoteOn(configuration.dexed[seq.seq_inst_dexed[d]].midi_channel, seq.seq_data[ seq.seq_patternchain[seq.seq_chain_active_step][d] ][seq.seq_step], seq.seq_chord_velocity); // basenote + //handleNoteOn(configuration.dexed[seq.inst_dexed[d]].midi_channel, seq.data[ seq.patternchain[seq.chain_active_step][d] ][seq.step], seq.chord_velocity); // basenote - for (uint8_t x = seq.seq_element_shift; x < seq.seq_element_shift + seq.seq_chord_key_ammount; x++) //play chord notes + for (uint8_t x = seq.element_shift; x < seq.element_shift + seq.chord_key_ammount; x++) //play chord notes { - handleNoteOn(configuration.dexed[seq.seq_chord_dexed_inst].midi_channel, seq.seq_data[ seq.seq_patternchain[seq.seq_chain_active_step][d] ][seq.seq_step] + (seq.seq_oct_shift * 12) + seq.seq_arps[seq.seq_vel[ seq.seq_patternchain[seq.seq_chain_active_step][d] ][seq.seq_step] - 200][x], seq.seq_chord_velocity); + handleNoteOn(configuration.dexed[seq.chord_dexed_inst].midi_channel, seq.data[ seq.patternchain[seq.chain_active_step][d] ][seq.step] + (seq.oct_shift * 12) + seq.arps[seq.vel[ seq.patternchain[seq.chain_active_step][d] ][seq.step] - 200][x], seq.chord_velocity); } - seq.seq_prev_note[d] = seq.seq_data[seq.seq_patternchain[seq.seq_chain_active_step][d]][seq.seq_step] + (seq.seq_oct_shift * 12); - seq.seq_prev_vel[d] = seq.seq_vel[seq.seq_patternchain[seq.seq_chain_active_step][d]][seq.seq_step]; + seq.prev_note[d] = seq.data[seq.patternchain[seq.chain_active_step][d]][seq.step] + (seq.oct_shift * 12); + seq.prev_vel[d] = seq.vel[seq.patternchain[seq.chain_active_step][d]][seq.step]; } } - if (seq.seq_track_type[d] == 3) { //Arp + if (seq.track_type[d] == 3) { //Arp seq.arp_step = 0; seq.arp_counter = 0; - seq.arp_note = seq.seq_data[ seq.seq_patternchain[seq.seq_chain_active_step][d] ][seq.seq_step] + (seq.seq_oct_shift * 12); - seq.arp_chord = seq.seq_vel[seq.seq_patternchain[seq.seq_chain_active_step][d] ][seq.seq_step] - 200; + seq.arp_note = seq.data[ seq.patternchain[seq.chain_active_step][d] ][seq.step] + (seq.oct_shift * 12); + seq.arp_chord = seq.vel[seq.patternchain[seq.chain_active_step][d] ][seq.step] - 200; } } // after here not triggered by a key input - arp only - if (seq.seq_track_type[d] == 3) + if (seq.track_type[d] == 3) { //Arp if (seq.arp_speed == 0 || (seq.arp_speed == 1 && seq.arp_counter == 0) ) { { if (seq.arp_style == 0) { //arp up - handleNoteOn(configuration.dexed[seq.seq_chord_dexed_inst].midi_channel, seq.arp_note + seq.seq_arps[seq.arp_chord][seq.arp_step + seq.seq_element_shift], seq.seq_chord_velocity); - seq.arp_note_prev = seq.arp_note + seq.seq_arps[seq.arp_chord][seq.arp_step + seq.seq_element_shift] ; + handleNoteOn(configuration.dexed[seq.chord_dexed_inst].midi_channel, seq.arp_note + seq.arps[seq.arp_chord][seq.arp_step + seq.element_shift], seq.chord_velocity); + seq.arp_note_prev = seq.arp_note + seq.arps[seq.arp_chord][seq.arp_step + seq.element_shift] ; } else if (seq.arp_style == 1) { //arp down - handleNoteOn(configuration.dexed[seq.seq_chord_dexed_inst].midi_channel, seq.arp_note + seq.seq_arps[seq.arp_chord][seq.arp_lenght - seq.arp_step + seq.seq_element_shift], seq.seq_chord_velocity); - seq.arp_note_prev = seq.arp_note + seq.seq_arps[seq.arp_chord][seq.arp_lenght - seq.arp_step + seq.seq_element_shift] ; + handleNoteOn(configuration.dexed[seq.chord_dexed_inst].midi_channel, seq.arp_note + seq.arps[seq.arp_chord][seq.arp_lenght - seq.arp_step + seq.element_shift], seq.chord_velocity); + seq.arp_note_prev = seq.arp_note + seq.arps[seq.arp_chord][seq.arp_lenght - seq.arp_step + seq.element_shift] ; } else if (seq.arp_style == 2) { //arp up & down if (seq.arp_step <= seq.arp_lenght) { - handleNoteOn(configuration.dexed[seq.seq_chord_dexed_inst].midi_channel, seq.arp_note + seq.seq_arps[seq.arp_chord][seq.arp_step ], seq.seq_chord_velocity); - seq.arp_note_prev = seq.arp_note + seq.seq_arps[seq.arp_chord][seq.arp_step ] ; + handleNoteOn(configuration.dexed[seq.chord_dexed_inst].midi_channel, seq.arp_note + seq.arps[seq.arp_chord][seq.arp_step ], seq.chord_velocity); + seq.arp_note_prev = seq.arp_note + seq.arps[seq.arp_chord][seq.arp_step ] ; } else { - handleNoteOn(configuration.dexed[seq.seq_chord_dexed_inst].midi_channel, seq.arp_note + seq.seq_arps[seq.arp_chord][seq.arp_lenght * 2 - seq.arp_step ], seq.seq_chord_velocity); - seq.arp_note_prev = seq.arp_note + seq.seq_arps[seq.arp_chord][seq.arp_lenght * 2 - seq.arp_step ] ; + handleNoteOn(configuration.dexed[seq.chord_dexed_inst].midi_channel, seq.arp_note + seq.arps[seq.arp_chord][seq.arp_lenght * 2 - seq.arp_step ], seq.chord_velocity); + seq.arp_note_prev = seq.arp_note + seq.arps[seq.arp_chord][seq.arp_lenght * 2 - seq.arp_step ] ; } } else if (seq.arp_style == 3) { //arp random uint8_t rnd1 = random(seq.arp_lenght); - handleNoteOn(configuration.dexed[seq.seq_chord_dexed_inst].midi_channel, seq.arp_note + seq.seq_arps[seq.arp_chord][rnd1 + seq.seq_element_shift] + (seq.seq_oct_shift * 12), seq.seq_chord_velocity); - seq.arp_note_prev = seq.arp_note + seq.seq_arps[seq.arp_chord][rnd1 + seq.seq_element_shift] + (seq.seq_oct_shift * 12); + handleNoteOn(configuration.dexed[seq.chord_dexed_inst].midi_channel, seq.arp_note + seq.arps[seq.arp_chord][rnd1 + seq.element_shift] + (seq.oct_shift * 12), seq.chord_velocity); + seq.arp_note_prev = seq.arp_note + seq.arps[seq.arp_chord][rnd1 + seq.element_shift] + (seq.oct_shift * 12); } } } } } } - seq.seq_noteoffsent[d] = false; + seq.noteoffsent[d] = false; } seq.arp_counter++; - seq.seq_step++; + seq.step++; if (seq.arp_speed == 0) // Arp Speed 1/16 { seq.arp_step++; @@ -179,7 +179,7 @@ void sequencer_part1(void) if (seq.arp_style != 2) { - if ( (seq.arp_step > 1 && seq.seq_arps[seq.arp_chord][seq.arp_step] == 0) || seq.arp_step == seq.arp_lenght) + if ( (seq.arp_step > 1 && seq.arps[seq.arp_chord][seq.arp_step] == 0) || seq.arp_step == seq.arp_lenght) { seq.arp_step = 0; } @@ -191,20 +191,20 @@ void sequencer_part1(void) } if ( seq.arp_style == 2 ) //only for up&down { - if ( (seq.arp_step > 1 && seq.seq_arps[seq.arp_chord][seq.arp_step] == 0) || seq.arp_step == seq.arp_lenght * 2) + if ( (seq.arp_step > 1 && seq.arps[seq.arp_chord][seq.arp_step] == 0) || seq.arp_step == seq.arp_lenght * 2) { seq.arp_step = 0; } } - if (seq.seq_step > 15) + if (seq.step > 15) { - seq.seq_step = 0; - if (seq.seq_chain_lenght > 0) { - seq.seq_chain_active_step++; - if (seq.seq_chain_active_step > seq.seq_chain_lenght) + seq.step = 0; + if (seq.chain_lenght > 0) { + seq.chain_active_step++; + if (seq.chain_active_step > seq.chain_lenght) { - seq.seq_chain_active_step = 0; + seq.chain_active_step = 0; } } } @@ -215,27 +215,27 @@ void sequencer_part2(void) seq_live_recording(); for (uint8_t d = 0; d < NUM_SEQ_TRACKS; d++) { - if (seq.seq_noteoffsent[d] == false) { - if ( seq.seq_prev_note[d] > 0 && seq.seq_track_type[d] > 0) + if (seq.noteoffsent[d] == false) { + if ( seq.prev_note[d] > 0 && seq.track_type[d] > 0) { - if (seq.seq_data[ seq.seq_patternchain[seq.seq_chain_active_step][d] ][seq.seq_step] != 130) + if (seq.data[ seq.patternchain[seq.chain_active_step][d] ][seq.step] != 130) { - handleNoteOff(configuration.dexed[seq.seq_inst_dexed[d]].midi_channel, seq.seq_prev_note[d] , 0); - seq.seq_noteoffsent[d] = true; + handleNoteOff(configuration.dexed[seq.inst_dexed[d]].midi_channel, seq.prev_note[d] , 0); + seq.noteoffsent[d] = true; } - if (seq.seq_track_type[d] == 2) { //Chords - if ( seq.seq_prev_vel[d] > 199) { - for (uint8_t x = seq.seq_element_shift; x < seq.seq_element_shift + seq.seq_chord_key_ammount; x++) //play chord notes + if (seq.track_type[d] == 2) { //Chords + if ( seq.prev_vel[d] > 199) { + for (uint8_t x = seq.element_shift; x < seq.element_shift + seq.chord_key_ammount; x++) //play chord notes { - handleNoteOff(configuration.dexed[seq.seq_chord_dexed_inst].midi_channel, seq.seq_prev_note[d] + seq.seq_arps[seq.seq_prev_vel[d] - 200][x], 0); - seq.seq_noteoffsent[d] = true; + handleNoteOff(configuration.dexed[seq.chord_dexed_inst].midi_channel, seq.prev_note[d] + seq.arps[seq.prev_vel[d] - 200][x], 0); + seq.noteoffsent[d] = true; } } } - else if (seq.seq_track_type[d] == 3) + else if (seq.track_type[d] == 3) { //Arp - handleNoteOff(configuration.dexed[seq.seq_chord_dexed_inst].midi_channel, seq.arp_note_prev, 0); - seq.seq_noteoffsent[d] = true; + handleNoteOff(configuration.dexed[seq.chord_dexed_inst].midi_channel, seq.arp_note_prev, 0); + seq.noteoffsent[d] = true; } } } diff --git a/sequencer.h b/sequencer.h index 26f34d1..351fbdd 100644 --- a/sequencer.h +++ b/sequencer.h @@ -28,29 +28,29 @@ typedef struct sequencer_s { float drums_volume; - uint8_t seq_active_track = 0; - uint8_t seq_menu; - bool seq_noteoffsent[NUM_SEQ_TRACKS] = {false, false, false, false, false, false}; - uint8_t seq_inst_dexed[NUM_SEQ_TRACKS] = { 0, 0, 1, 1 , 1, 1 }; - uint8_t seq_step = 0; - bool seq_running = false; - bool seq_recording = false; + uint8_t active_track = 0; + uint8_t menu; + bool noteoffsent[NUM_SEQ_TRACKS] = {false, false, false, false, false, false}; + uint8_t inst_dexed[NUM_SEQ_TRACKS] = { 0, 0, 1, 1 , 1, 1 }; + uint8_t step = 0; + bool running = false; + bool recording = false; bool smartfilter = true; - uint8_t seq_state_last_loadsave = 200; - char seq_name[FILENAME_LEN]; - char seq_name_temp[FILENAME_LEN]; - uint8_t seq_note_in; - uint8_t seq_note_in_velocity; - int seq_transpose; + uint8_t state_last_loadsave = 200; + char name[FILENAME_LEN]; + char name_temp[FILENAME_LEN]; + uint8_t note_in; + uint8_t note_in_velocity; + int transpose; - uint8_t seq_chord_dexed_inst = 0; - uint8_t seq_chord_velocity = 60; - uint8_t seq_chord_key_ammount = 4; - uint8_t seq_element_shift = 0; - int seq_oct_shift = 0; + uint8_t chord_dexed_inst = 0; + uint8_t chord_velocity = 60; + uint8_t chord_key_ammount = 4; + uint8_t element_shift = 0; + int oct_shift = 0; uint8_t arp_style = 0; // up, down, up&down, random - const uint8_t seq_arps[6][23] = { + const uint8_t arps[6][23] = { { 0, 4, 7, 12, 16, 19, 24, 28, 31, 36, 40, 43, 48, 52, 55, 60, 64, 67, 72, 76, 79, 84, 0}, //major { 0, 3, 7, 12, 15, 19, 24, 27, 31, 36, 39, 43, 48, 51, 55, 60, 63, 67, 72, 75, 79, 84, 0}, //minor { 0, 4, 7, 10, 12, 16, 19, 22, 24, 28, 31, 34, 36, 40, 43, 46, 48, 52, 55, 58, 60, 64, 0}, //seventh @@ -59,7 +59,7 @@ typedef struct sequencer_s { 0, 4, 7, 11, 12, 16, 19, 23, 24, 28, 31, 35, 36, 40, 43, 47, 48, 52, 55, 59, 60, 64, 0} //maj7 }; - const char seq_chord_names[7][4] = { + const char chord_names[7][4] = { {'M', 'a', 'j', ' '}, //major {'M', 'i', 'n', ' '}, {'s', 'e', 'v', ' '}, @@ -75,15 +75,15 @@ typedef struct sequencer_s {'u', '&', 'd'}, {'R', 'N', 'D'} }; - int seq_tempo_ms = 180000; - int seq_bpm = 102; - uint8_t seq_temp_select_menu; - uint8_t seq_temp_active_menu = 99; - uint8_t seq_chain_active_chainstep; - uint8_t seq_chain_lenght = 3; // 0 = 16 steps, 1 = 32 Steps, 2 = 46 Steps, 3 = 64 Steps - uint8_t seq_chain_active_step = 0; - uint8_t seq_prev_note[NUM_SEQ_TRACKS]; // note_offs for every (instr.) track - uint8_t seq_prev_vel[NUM_SEQ_TRACKS]; + int tempo_ms = 180000; + int bpm = 102; + uint8_t temp_select_menu; + uint8_t temp_active_menu = 99; + uint8_t chain_active_chainstep; + uint8_t chain_lenght = 3; // 0 = 16 steps, 1 = 32 Steps, 2 = 46 Steps, 3 = 64 Steps + uint8_t chain_active_step = 0; + uint8_t prev_note[NUM_SEQ_TRACKS]; // note_offs for every (instr.) track + uint8_t prev_vel[NUM_SEQ_TRACKS]; uint8_t arp_step; uint8_t arp_note; uint8_t arp_chord = 6; @@ -94,8 +94,8 @@ typedef struct sequencer_s uint8_t arp_speed = 0; uint8_t arp_counter = 0; uint8_t arp_lenght = 8; - uint8_t seq_data_buffer[16] = { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }; - uint8_t seq_data[NUM_SEQ_PATTERN][16] = { + uint8_t data_buffer[16] = { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }; + uint8_t data[NUM_SEQ_PATTERN][16] = { { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, @@ -107,7 +107,7 @@ typedef struct sequencer_s { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } }; - uint8_t seq_vel[NUM_SEQ_PATTERN][16] = { + uint8_t vel[NUM_SEQ_PATTERN][16] = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, @@ -119,14 +119,14 @@ typedef struct sequencer_s { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }; - uint8_t seq_content_type[NUM_SEQ_PATTERN] = { 0, 0, 0, 0 , 0, 0, 0 , 0 , 0 , 0 }; // 0 = track is Drumtrack, 1 = Instrumenttrack, 2 = Chord or Arpeggio - uint8_t seq_patternchain[4][NUM_SEQ_TRACKS] = { + uint8_t content_type[NUM_SEQ_PATTERN] = { 0, 0, 0, 0 , 0, 0, 0 , 0 , 0 , 0 }; // 0 = track is Drumtrack, 1 = Instrumenttrack, 2 = Chord or Arpeggio + uint8_t patternchain[4][NUM_SEQ_TRACKS] = { { 0 , 2 , 6 , 9 , 99, 99 }, { 1 , 2 , 5 , 8 , 99, 99 }, { 0 , 2 , 6 , 9 , 99, 99 }, { 1 , 2 , 5 , 7 , 99, 99 } }; - uint8_t seq_track_type[NUM_SEQ_TRACKS] = { 0, 0, 1, 1, 1, 1 }; // 0 = track is Drumtrack, 1 = Instrumenttrack, 2 = Chord, 3 = Arp + uint8_t track_type[NUM_SEQ_TRACKS] = { 0, 0, 1, 1, 1, 1 }; // 0 = track is Drumtrack, 1 = Instrumenttrack, 2 = Chord, 3 = Arp } sequencer_t; #endif