From 6a5c515daf310db1f8438c2eb82b1bceda1aa67f Mon Sep 17 00:00:00 2001 From: positionhigh Date: Wed, 29 Sep 2021 21:13:38 +0200 Subject: [PATCH] =?UTF-8?q?Dateien=20hochladen=20nach=20=E2=80=9E=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- UI.hpp | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/UI.hpp b/UI.hpp index 572d048..28a34c9 100644 --- a/UI.hpp +++ b/UI.hpp @@ -110,10 +110,11 @@ extern int seq_oct_shift; extern char arp_style_names[4][3]; extern char seq_chord_names[7][4]; extern uint8_t seq_data_buffer[16]; +extern uint8_t seq_data[NUM_SEQ_PATTERN][16]; extern float drums_volume; extern uint8_t drum_midi_channel; uint8_t seq_active_function = 99; -uint8_t activesample; extern uint8_t seq_data[10][16]; +uint8_t activesample; #endif #ifdef DISPLAY_LCD_SPI @@ -646,6 +647,18 @@ void setup_debug_message(void) } #endif +void toggle_sequencer_play_status() +{ + if (seq_running == false && seq_recording == false) + { + handleStart(); + } + else if (seq_running == true && seq_recording == false) + { + handleStop(); + } +} + /*********************************************************************** MENU CONTROL ***********************************************************************/ @@ -923,8 +936,12 @@ void lcdml_menu_control(void) Serial.println(F("ENC-L long recognized")); #endif + // when in Voice select Menu, long left-press sets/unsets favorite if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_voice_select)) save_favorite(configuration.performance.bank[selected_instance_id], configuration.performance.voice[selected_instance_id], selected_instance_id); + // when not in Voice select Menu, long left-press starts/stops sequencer + else if (LCDML.FUNC_getID() != LCDML.OTHER_getIDFromFunction(UI_func_voice_select)) + toggle_sequencer_play_status(); //for (uint8_t i = 0; i < NUM_DEXED; i++) // MicroDexed[i]->panic(); @@ -4837,7 +4854,7 @@ void seq_clear_active_pattern() } void seq_clear_all_patterns() { - for (uint8_t i = 0; i < 10; i++) + for (uint8_t i = 0; i < NUM_SEQ_PATTERN - 1; i++) { memset(seq_data[i], 0, sizeof(seq_data[i])); memset(seq_vel[i], 0, sizeof(seq_vel[i])); @@ -4903,10 +4920,19 @@ void seq_print_current_note() lcd.print( (seq_data[seq_active_track][seq_menu - 3] / 12) - 1); lcd.print(" "); } +void check_variable_samples_basespeed() +{ + for (uint8_t i = 0; i < 6; i++) + { + if (drum_config[i].p_offset == 0) + drum_config[i].p_offset=1; + } +} 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 #ifdef TESTDISPLAY20x4 lcd.createChar(1, (uint8_t*)special_chars[9]); //bar graph