diff --git a/UI.hpp b/UI.hpp index 0ebd2b0..e4eae23 100644 --- a/UI.hpp +++ b/UI.hpp @@ -77,7 +77,7 @@ extern drum_config_t drum_config[NUM_DRUMSET_CONFIG]; extern char seq_name[FILENAME_LEN]; extern char seq_name_temp[FILENAME_LEN]; extern uint8_t seq_vel[NUM_SEQ_PATTERN][16]; -extern uint8_t seq_patternchain[NUM_SEQ_TRACKS][4]; +extern uint8_t seq_patternchain[4][NUM_SEQ_TRACKS]; extern uint8_t seq_content_type[NUM_SEQ_PATTERN]; extern uint8_t seq_track_type[NUM_SEQ_TRACKS]; extern uint8_t seq_step; @@ -317,7 +317,6 @@ void UI_func_set_sequence_name(uint8_t param); void UI_func_volume(uint8_t param); void UI_func_smart_filter(uint8_t param); void UI_func_drum_midi_channel(uint8_t param); -void UI_func_drum_monitor(uint8_t param); void UI_func_load_performance(uint8_t param); void UI_func_save_performance(uint8_t param); void UI_func_load_voiceconfig(uint8_t param); @@ -370,6 +369,7 @@ void UI_func_drums_main_volume(uint8_t param); void UI_func_drum_volume(uint8_t param); void UI_func_drum_pan(uint8_t param); void UI_func_drum_pitch(uint8_t param); +void UI_func_drum_tune_offset(uint8_t param); char* basename(const char* filename); char* strip_extension(char* filename); @@ -3831,15 +3831,15 @@ void UI_func_drums_main_volume(uint8_t param) encoderDir[ENC_R].reset(); } } -void UI_func_drum_pitch(uint8_t param) +void UI_func_drum_tune_offset(uint8_t param) { char displayname[8] = {0, 0, 0, 0, 0, 0, 0}; if (LCDML.FUNC_setup()) // ****** SETUP ********* { encoderDir[ENC_R].reset(); - temp_int = (int)(drum_config[activesample].p_offset * 100); + temp_int = (int)(drum_config[activesample].p_offset * 200); lcd.setCursor(0, 0); - lcd.print("DrumSmp. Pitch"); + lcd.print("DrumSmp. Tune"); lcd.setCursor(1, 1); lcd.setCursor(1, 1); sprintf(displayname, "%02d", activesample); @@ -3866,11 +3866,11 @@ void UI_func_drum_pitch(uint8_t param) { if (LCDML.BT_checkDown()) { - temp_int = constrain(temp_int + ENCODER[ENC_R].speed(), 0, 200); + temp_int = constrain(temp_int + ENCODER[ENC_R].speed(), 0, 400); } else if (LCDML.BT_checkUp()) { - temp_int = constrain(temp_int - ENCODER[ENC_R].speed(), 0, 200); + temp_int = constrain(temp_int - ENCODER[ENC_R].speed(), 0, 400); } } } @@ -3880,7 +3880,7 @@ void UI_func_drum_pitch(uint8_t param) menu_select_toggle = false; } else { menu_select_toggle = true; - temp_int = (int)(drum_config[activesample].p_offset * 100); + temp_int = (int)(drum_config[activesample].p_offset * 200); } } if (menu_select_toggle == false) { @@ -3896,11 +3896,11 @@ void UI_func_drum_pitch(uint8_t param) sprintf(displayname, "%02d", activesample); lcd.print(displayname); lcd.show(1, 4, 7, basename(drum_config[activesample].name)); - sprintf(displayname, "%03d", (int)(drum_config[activesample].p_offset * 100) ); + sprintf(displayname, "%03d", (int)(drum_config[activesample].p_offset * 200) ); lcd.setCursor(12, 1); lcd.print(displayname); } else { - temp_float = mapfloat(temp_int, 0, 200, 0.0, 2.0); + temp_float = mapfloat(temp_int, 0, 400, 0.0, 2.0); lcd.setCursor(0, 1); lcd.print(" "); lcd.setCursor(3, 1); @@ -3920,7 +3920,95 @@ void UI_func_drum_pitch(uint8_t param) encoderDir[ENC_R].reset(); } } +void UI_func_drum_pitch(uint8_t param) +{ + char displayname[8] = {0, 0, 0, 0, 0, 0, 0}; + if (LCDML.FUNC_setup()) // ****** SETUP ********* + { + 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); + sprintf(displayname, "%02d", activesample); + lcd.print(displayname); + lcd.show(1, 4, 7, basename(drum_config[activesample].name)); + } + if (LCDML.FUNC_loop()) // ****** LOOP ********* + { + if (menu_select_toggle == false) { + 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()) + { + activesample = constrain(activesample + ENCODER[ENC_R].speed(), 0, NUM_DRUMSET_CONFIG - 2); + } + else if (LCDML.BT_checkUp()) + { + activesample = constrain(activesample - ENCODER[ENC_R].speed(), 0, NUM_DRUMSET_CONFIG - 2); + } + } + } else { + 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()) + { + temp_int = constrain(temp_int + ENCODER[ENC_R].speed(), 0, 400); + } + else if (LCDML.BT_checkUp()) + { + temp_int = constrain(temp_int - ENCODER[ENC_R].speed(), 0, 400); + } + } + } + if (LCDML.BT_checkEnter()) + { + if (menu_select_toggle) { + menu_select_toggle = false; + } else + { menu_select_toggle = true; + temp_int = (int)(drum_config[activesample].pitch * 200); + } + } + 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); + sprintf(displayname, "%02d", activesample); + lcd.print(displayname); + lcd.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); + } 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("]"); + sprintf(displayname, "%03d", temp_int); + lcd.setCursor(12, 1); + lcd.print(displayname); + drum_config[activesample].pitch = temp_float; + } + } + if (LCDML.FUNC_close()) // ****** STABLE END ********* + { + encoderDir[ENC_R].reset(); + } +} void UI_func_drum_volume(uint8_t param) { char displayname[8] = {0, 0, 0, 0, 0, 0, 0}; @@ -4282,7 +4370,7 @@ void UI_func_seq_display_style(uint8_t param) lcd.print("Seq. Disp. Style"); lcd.setCursor(0, 1); lcd.print("Pat."); - lcd.setCursor(8, 1); + lcd.setCursor(9, 1); lcd.print("="); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -4292,11 +4380,11 @@ void UI_func_seq_display_style(uint8_t param) { if (LCDML.BT_checkDown()) { - seq_active_track = constrain(seq_active_track + ENCODER[ENC_R].speed(), 0, 9); + seq_active_track = constrain(seq_active_track + ENCODER[ENC_R].speed(), 0, NUM_SEQ_PATTERN - 1); } else if (LCDML.BT_checkUp()) { - seq_active_track = constrain(seq_active_track - ENCODER[ENC_R].speed(), 0, 9); + seq_active_track = constrain(seq_active_track - ENCODER[ENC_R].speed(), 0, NUM_SEQ_PATTERN - 1); } } } else { @@ -4323,12 +4411,14 @@ void UI_func_seq_display_style(uint8_t param) lcd.print(" "); lcd.setCursor(4, 1); lcd.print("["); + if (seq_active_track < 10) + lcd.print ("0"); lcd.print(seq_active_track); lcd.print("]"); } else { lcd.setCursor(4, 1); lcd.print(" "); - lcd.setCursor(6, 1); + lcd.setCursor(7, 1); lcd.print(" "); lcd.setCursor(10, 1); lcd.print("["); @@ -4511,16 +4601,19 @@ void UI_func_seq_vel_editor(uint8_t param) // setup function encoderDir[ENC_R].reset(); lcd.setCursor(0, 0); - lcd.print("Vel:"); + lcd.print("V:"); sprintf(tmp, "%03d", seq_vel[seq_active_track][seq_menu - 1]); - lcd.setCursor(4, 0); + lcd.setCursor(2, 0); lcd.print(tmp); lcd.setCursor(12, 0); - lcd.print("S["); + lcd.print("["); + lcd.setCursor(13, 0); + if (seq_active_track < 10) + lcd.print("0"); + lcd.print(seq_active_track); lcd.setCursor(15, 0); lcd.print("]"); - lcd.setCursor(14, 0); - lcd.print(seq_active_track); + seq_printAllSeqSteps(); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -4614,9 +4707,9 @@ void UI_func_seq_vel_editor(uint8_t param) lcd.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("Vel:"); + lcd.print("V:"); sprintf(tmp, "%03d", seq_vel[seq_active_track][seq_menu - 1]); - lcd.setCursor(4, 0); + lcd.setCursor(2, 0); lcd.print(tmp); } else @@ -4631,19 +4724,16 @@ void UI_func_seq_vel_editor(uint8_t param) } } if (seq_menu == 0) { - if (seq_active_function != 0) - { - lcd.setCursor(0, 0); - lcd.print(" "); - } - lcd.setCursor(13, 0); + lcd.setCursor(12, 0); lcd.print("["); + if (seq_active_track < 10) + lcd.print("0"); lcd.print(seq_active_track); lcd.print("]"); lcd.setCursor(0, 1); seq_printAllSeqSteps(); } else if (seq_menu == 1) { - lcd.setCursor(13, 0); + lcd.setCursor(12, 0); lcd.print(" "); lcd.setCursor(15, 0); lcd.print(" "); @@ -4654,7 +4744,7 @@ void UI_func_seq_vel_editor(uint8_t param) 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]); - lcd.setCursor(4, 0); + lcd.setCursor(2, 0); lcd.print(tmp); } } else if (seq_menu > 1) @@ -4677,11 +4767,12 @@ void UI_func_seq_vel_editor(uint8_t param) lcd.setCursor(0, 0); if (seq_vel[seq_active_track][seq_menu - 1] < 210) //it is a normal sample { - lcd.print("Vel:"); + lcd.print("V:"); sprintf(tmp, "%03d", seq_vel[seq_active_track][seq_menu - 1]); - lcd.setCursor(7, 0); - lcd.print(" "); - lcd.show(0, 8, 5, seq_find_drum_name_from_note( seq_data[seq_active_track][seq_menu - 1]) ); + lcd.print(tmp); + //lcd.setCursor(7, 0); + //lcd.print(" "); + lcd.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 @@ -4703,6 +4794,7 @@ void UI_func_seq_vel_editor(uint8_t param) sprintf(tmp, "%03d", seq_vel[seq_active_track][seq_menu - 1]); lcd.setCursor(4, 0); lcd.print(tmp); + lcd.print(" "); } lcd.setCursor(8, 0); lcd.print(noteNames[seq_data[seq_active_track][seq_menu - 1] % 12 ][0] ); @@ -4715,24 +4807,24 @@ void UI_func_seq_vel_editor(uint8_t param) else { //note is latched lcd.setCursor(0, 0); - lcd.print("latched note "); + lcd.print("latched note "); } if (seq_content_type[seq_active_track] > 1) { lcd.setCursor(0, 0); - if (seq_vel[seq_active_track][seq_menu - 1] == 200) lcd.print("Major" ); - else if (seq_vel[seq_active_track][seq_menu - 1] == 201) lcd.print("Minor" ); - else if (seq_vel[seq_active_track][seq_menu - 1] == 202) lcd.print("Seven" ); - else if (seq_vel[seq_active_track][seq_menu - 1] == 203) lcd.print("Aug " ); - else if (seq_vel[seq_active_track][seq_menu - 1] == 204) lcd.print("Dim " ); - else if (seq_vel[seq_active_track][seq_menu - 1] == 205) lcd.print("Maj7 " ); + if (seq_vel[seq_active_track][seq_menu - 1] == 200) lcd.print("Major " ); + else if (seq_vel[seq_active_track][seq_menu - 1] == 201) lcd.print("Minor " ); + else if (seq_vel[seq_active_track][seq_menu - 1] == 202) lcd.print("Seven " ); + else if (seq_vel[seq_active_track][seq_menu - 1] == 203) lcd.print("Aug " ); + else if (seq_vel[seq_active_track][seq_menu - 1] == 204) lcd.print("Dim " ); + else if (seq_vel[seq_active_track][seq_menu - 1] == 205) lcd.print("Major7 " ); } } } else { lcd.setCursor(0, 0); - lcd.print(" "); + lcd.print(" "); } } } @@ -4762,9 +4854,9 @@ void seq_refresh_display_play_status() { lcd.createChar(0, (uint8_t*)special_chars[19]); //play symbol #ifdef TESTDISPLAY20x4 - lcd.setCursor(15, 0); + lcd.setCursor(14, 0); #else - lcd.setCursor(11, 0); + lcd.setCursor(10, 0); #endif lcd.write(0); } else if (seq_running == true && seq_recording == false) @@ -4772,9 +4864,9 @@ void seq_refresh_display_play_status() seq_note_in = 0; lcd.createChar(0, (uint8_t*)special_chars[20]); //record symbol #ifdef TESTDISPLAY20x4 - lcd.setCursor(15, 0); + lcd.setCursor(14, 0); #else - lcd.setCursor(11, 0); + lcd.setCursor(10, 0); #endif lcd.write(0); } else if (seq_running == true && seq_recording == true) @@ -4782,9 +4874,9 @@ void seq_refresh_display_play_status() seq_note_in = 0; lcd.createChar(0, (uint8_t*)special_chars[21]); //stop symbol #ifdef TESTDISPLAY20x4 - lcd.setCursor(15, 0); + lcd.setCursor(14, 0); #else - lcd.setCursor(11, 0); + lcd.setCursor(10, 0); #endif lcd.write(0); } @@ -4795,36 +4887,26 @@ void arp_refresh_display_play_status() if (seq_running == false ) { lcd.createChar(0, (uint8_t*)special_chars[19]); //play symbol - lcd.setCursor(14, 0); + lcd.setCursor(13, 0); lcd.write(0); } else if (seq_running == true ) { seq_note_in = 0; lcd.createChar(0, (uint8_t*)special_chars[21]); //stop symbol - lcd.setCursor(14, 0); + lcd.setCursor(13, 0); lcd.write(0); } } - -void UI_func_drum_monitor(uint8_t param) +void seq_print_current_note() { - if (LCDML.FUNC_setup()) // ****** SETUP ********* - { - encoderDir[ENC_R].reset(); - - lcd.setCursor(0, 0); - lcd.print(F("Drum Status ")); - } - if (LCDML.FUNC_loop()) // ****** LOOP ********* - { - ; - } - if (LCDML.FUNC_close()) // ****** STABLE END ********* - { - encoderDir[ENC_R].reset(); - } + lcd.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_data[seq_active_track][seq_menu - 3] % 12 ][1] ); + } + lcd.print( (seq_data[seq_active_track][seq_menu - 3] / 12) - 1); + lcd.print(" "); } - void UI_func_seq_pattern_editor(uint8_t param) { if (LCDML.FUNC_setup()) // ****** SETUP ********* @@ -4845,10 +4927,11 @@ void UI_func_seq_pattern_editor(uint8_t param) // setup function seq_refresh_display_play_status(); #ifdef TESTDISPLAY20x4 - lcd.setCursor(18, 0); + lcd.setCursor(17, 0); #else - lcd.setCursor(14, 0); + lcd.setCursor(13, 0); #endif + if (seq_active_track < 10)lcd.print("0"); lcd.print(seq_active_track); seq_printAllSeqSteps(); #ifdef TESTDISPLAY20x4 @@ -4856,7 +4939,19 @@ void UI_func_seq_pattern_editor(uint8_t param) #endif } if (LCDML.FUNC_loop()) // ****** LOOP ********* - { if (seq_menu == 33 ) { // is in sub-function - fill pattern + { + if (seq_active_function == 40 ) { // pitch edit sample + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) + { + if (LCDML.BT_checkDown()) { + 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_data[seq_active_track][seq_menu - 3] = constrain(seq_data[seq_active_track][seq_menu - 3] - 1, 1, 108); + } + } + } + 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())) { @@ -4868,7 +4963,7 @@ void UI_func_seq_pattern_editor(uint8_t param) } } } - else if (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_content_type[seq_active_track] == 0) { if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) @@ -4900,7 +4995,7 @@ void UI_func_seq_pattern_editor(uint8_t param) temp_int = constrain(temp_int + 1, 0, NUM_SEQ_PATTERN - 1); if (temp_int == seq_active_track)temp_int++; - if (temp_int > 9)temp_int = 0; + 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); @@ -4909,7 +5004,7 @@ void UI_func_seq_pattern_editor(uint8_t param) } } } - else if (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())) { @@ -4923,7 +5018,7 @@ void UI_func_seq_pattern_editor(uint8_t param) } } } - else if (seq_active_function == 99) + else if (seq_active_function == 99 ) { if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { @@ -4969,7 +5064,18 @@ void UI_func_seq_pattern_editor(uint8_t param) } if (LCDML.BT_checkEnter()) //handle button presses during menu >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> { - if (seq_menu == 34 ) //transpose pattern + 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(" "); + seq_active_function = 0; + activesample = 0; + seq_refresh_display_play_status(); + seq_printAllSeqSteps(); + } else if (seq_menu == 34 ) //transpose pattern { seq_menu = 0; seq_active_function = 0; @@ -4977,6 +5083,11 @@ void UI_func_seq_pattern_editor(uint8_t param) temp_int = seq_data[seq_active_track][0]; lcd.setCursor(8, 0); lcd.print(" "); + lcd.setCursor(12, 0); + lcd.print(" "); + lcd.setCursor(13, 0); + if (seq_active_track < 10)lcd.print("0"); + lcd.print(seq_active_track); seq_refresh_display_play_status(); seq_printAllSeqSteps(); } @@ -5011,7 +5122,7 @@ void UI_func_seq_pattern_editor(uint8_t param) lcd.print(" "); seq_refresh_display_play_status(); seq_printAllSeqSteps(); - } else if (seq_menu == 31) //copy patterns + } else if (seq_menu == 31 && seq_active_function != 40) //copy patterns { 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])); @@ -5021,10 +5132,10 @@ void UI_func_seq_pattern_editor(uint8_t param) activesample = 0; temp_int = seq_data[seq_active_track][0]; lcd.setCursor(8, 0); - lcd.print(" "); + lcd.print(" "); seq_refresh_display_play_status(); seq_printAllSeqSteps(); - } else if (seq_menu == 30) //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]; @@ -5041,9 +5152,9 @@ void UI_func_seq_pattern_editor(uint8_t param) seq_menu = 0; seq_active_function = 0; activesample = 0; - temp_int = seq_data[seq_active_track][0]; lcd.setCursor(8, 0); - lcd.print(" "); + lcd.print(" "); + temp_int = seq_data[seq_active_track][0]; seq_refresh_display_play_status(); seq_printAllSeqSteps(); } @@ -5055,7 +5166,7 @@ void UI_func_seq_pattern_editor(uint8_t param) 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"); + lcd.print("Transpose:[ 00]"); for (uint8_t i = 0; i < 16; i++) { seq_data_buffer[i] = seq_data[seq_active_track][i]; @@ -5078,16 +5189,16 @@ void UI_func_seq_pattern_editor(uint8_t param) 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("Swap Pattern:"); + lcd.print("SwapPattern:"); temp_int = seq_active_track + 1; - if (temp_int > 9)temp_int = 0; + if (temp_int > NUM_SEQ_PATTERN - 1)temp_int = 0; 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) ) + } 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_active_track + 1; - if (temp_int > 9)temp_int = 0; + if (temp_int > NUM_SEQ_PATTERN - 1)temp_int = 0; 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 @@ -5100,7 +5211,7 @@ void UI_func_seq_pattern_editor(uint8_t param) } seq_active_function = 99; } - if ( seq_menu == 1) + if ( seq_menu == 1 && seq_active_function != 40) { if (seq_running == false && seq_recording == false) { @@ -5121,7 +5232,7 @@ void UI_func_seq_pattern_editor(uint8_t param) timer1.stop(); MicroDexed[0]->panic(); } - } else if ( seq_menu == 2) + } else if ( seq_menu == 2 && seq_active_function != 40) { if (seq_active_function != 2) seq_active_function = 2; else seq_active_function = 99; @@ -5139,22 +5250,35 @@ void UI_func_seq_pattern_editor(uint8_t param) lcd.print( (temp_int / 12) - 1); } } - } else if (seq_menu > 2 && seq_menu < 30) + } else if (seq_menu > 2 && seq_menu < 30 && seq_active_function != 40) { if (seq_active_function == 99) { if (seq_content_type[seq_active_track] == 0) { //Drumtrack - //check if note is already there, if not -> insert it, else remove it from grid. - if (seq_data[seq_active_track][seq_menu - 3] == drum_config[activesample].midinote) - { - seq_data[seq_active_track][seq_menu - 3] = 0; - seq_vel[seq_active_track][seq_menu - 3] = 0; - } else + + if ( drum_config[activesample].midinote > 209 ) //it is a pitched sample { - seq_data[seq_active_track][seq_menu - 3] = drum_config[activesample].midinote; - seq_vel[seq_active_track][seq_menu - 3] = 120; + 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_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_data[seq_active_track][seq_menu - 3] == drum_config[activesample].midinote) + { + seq_data[seq_active_track][seq_menu - 3] = 0; + seq_vel[seq_active_track][seq_menu - 3] = 0; + } else + { + seq_data[seq_active_track][seq_menu - 3] = drum_config[activesample].midinote; + seq_vel[seq_active_track][seq_menu - 3] = 120; + } } else { //Inst. Track @@ -5178,15 +5302,13 @@ void UI_func_seq_pattern_editor(uint8_t param) } //button check end <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< - if (seq_menu == 35 ) - { //transpose - ; - } - else if (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); - if (temp_int > 1) { + lcd.print("["); + lcd.setCursor(11, 0); + if (temp_int > 0) { lcd.print("+"); } else if (temp_int < 0) { @@ -5196,8 +5318,8 @@ void UI_func_seq_pattern_editor(uint8_t param) lcd.print(" "); } sprintf(displayname, "%02d", abs(temp_int)); - lcd.setCursor(11, 0); lcd.print( displayname); + lcd.print("]"); for (uint8_t i = 0; i < 16; i++) { if (seq_content_type[seq_active_track] == 0) { //drums @@ -5259,22 +5381,24 @@ void UI_func_seq_pattern_editor(uint8_t param) else if (seq_temp_active_menu == 2) lcd.print("1/16"); } } else if (seq_menu == 31) { //copy pattern - lcd.setCursor(13, 0); + lcd.setCursor(12, 0); lcd.print("["); lcd.setCursor(15, 0); lcd.print("]"); lcd.setCursor(0, 1); - lcd.print(" to: [ ]"); - lcd.setCursor(14, 1); + lcd.print(" to:[ ]"); + lcd.setCursor(13, 1); + if (temp_int < 10) lcd.print("0"); lcd.print(temp_int); } else if (seq_menu == 30) { //swap pattern - lcd.setCursor(13, 0); + lcd.setCursor(12, 0); lcd.print("["); lcd.setCursor(15, 0); lcd.print("]"); lcd.setCursor(0, 1); - lcd.print(" with: [ ]"); - lcd.setCursor(14, 1); + lcd.print(" with:[ ]"); + lcd.setCursor(13, 1); + if (temp_int < 10) lcd.print("0"); lcd.print(temp_int); } else if (seq_menu == 0) { #ifdef TESTDISPLAY20x4 @@ -5283,9 +5407,9 @@ void UI_func_seq_pattern_editor(uint8_t param) lcd.setCursor(16, 0); lcd.print(" "); #else - lcd.setCursor(10, 0); + lcd.setCursor(9, 0); lcd.print(" "); - lcd.setCursor(12, 0); + lcd.setCursor(11, 0); lcd.print(" "); #endif lcd.setCursor(0, 0); @@ -5370,7 +5494,7 @@ void UI_func_seq_pattern_editor(uint8_t param) lcd.setCursor(19, 0); lcd.print(" "); #else - lcd.setCursor(13, 0); + lcd.setCursor(12, 0); lcd.print(" "); lcd.setCursor(15, 0); lcd.print(" "); @@ -5382,10 +5506,10 @@ void UI_func_seq_pattern_editor(uint8_t param) lcd.setCursor(16, 0); lcd.print("]"); #else - lcd.setCursor(10, 0); + lcd.setCursor(9, 0); lcd.print("["); seq_refresh_display_play_status(); - lcd.setCursor(12, 0); + lcd.setCursor(11, 0); lcd.print("]"); #endif } @@ -5395,23 +5519,32 @@ void UI_func_seq_pattern_editor(uint8_t param) lcd.print(" "); lcd.setCursor(16, 0); lcd.print(" "); - lcd.setCursor(17, 0); + lcd.setCursor(16, 0); lcd.print("["); - lcd.setCursor(18, 0); + lcd.setCursor(17, 0); + if (seq_active_track < 10) lcd.print("0"); lcd.print(seq_active_track); lcd.setCursor(19, 0); lcd.print("]"); #else - lcd.setCursor(10, 0); + lcd.setCursor(9, 0); lcd.print(" "); - lcd.setCursor(12, 0); + lcd.setCursor(11, 0); lcd.print(" "); - lcd.setCursor(13, 0); + lcd.setCursor(12, 0); lcd.print("["); - lcd.setCursor(14, 0); + lcd.setCursor(13, 0); + if (seq_active_track < 10) lcd.print("0"); lcd.print(seq_active_track); lcd.setCursor(15, 0); lcd.print("]"); + if (seq_content_type[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); seq_printAllSeqSteps(); @@ -5426,26 +5559,61 @@ void UI_func_seq_pattern_editor(uint8_t param) lcd.setCursor(19, 0); lcd.print(" "); #else - lcd.setCursor(13, 0); + lcd.setCursor(12, 0); lcd.print(" "); lcd.setCursor(15, 0); lcd.print(" "); #endif - lcd.setCursor(0, 1); - lcd.print("_"); - lcd.setCursor(1, 1); - lcd.print(seq_find_shortname(1)[0]); + // lcd.setCursor(0, 1); + // lcd.print("_"); + // lcd.setCursor(1, 1); + // lcd.print(seq_find_shortname(1)[0]); } - if (seq_menu > 3 && seq_menu < 19) { - lcd.setCursor(seq_menu - 3, 1); + if (seq_menu > 2 && seq_menu < 19 && seq_active_function != 40) + { + if (seq_menu == 3) + lcd.setCursor(0, 1); + else + lcd.setCursor(seq_menu - 3, 1); lcd.write(219); // cursor symbol - lcd.setCursor(seq_menu - 4, 1); - lcd.print(seq_find_shortname(seq_menu - 4)[0]); + + if (seq_menu > 3) + { + lcd.setCursor(seq_menu - 4, 1); + + lcd.print(seq_find_shortname(seq_menu - 4)[0]); + } if (seq_menu < 18) { lcd.setCursor(seq_menu - 2, 1); lcd.print(seq_find_shortname(seq_menu - 2)[0]); } + 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 "); + seq_print_current_note(); + lcd.setCursor(8, 0); + lcd.print("?]"); + } + else + { + lcd.setCursor(0, 0); + lcd.print(" "); + lcd.show(0, 1, 6, basename(drum_config[activesample].name)); + lcd.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); + seq_print_current_note(); + lcd.setCursor(9, 0); + lcd.print("]"); } } if (LCDML.FUNC_close()) // ****** STABLE END ********* @@ -5646,32 +5814,19 @@ void UI_func_seq_pat_chain(uint8_t param) // setup function seq_temp_select_menu = 0; seq_temp_active_menu = 99; - lcd.setCursor( 12, 0); - lcd.print(seq_chain_active_chainstep + 1); + seq_menu = 0; + lcd.setCursor( 0, 0); + lcd.print("ChainStep:"); lcd.setCursor( 13, 0); - lcd.print("/"); + lcd.print(seq_chain_active_chainstep + 1); lcd.setCursor( 14, 0); + lcd.print("/"); + lcd.setCursor( 15, 0); lcd.print(seq_chain_lenght + 1); - - lcd.setCursor(0 , 0); - if (seq_track_type[0] == 0 ) lcd.print("D"); else if (seq_track_type[0] == 1 ) lcd.print("I"); else if (seq_track_type[0] == 2 ) lcd.print("C"); else lcd.print("A"); - lcd.setCursor(2 , 0); - lcd.print( seq_patternchain[seq_chain_active_chainstep][0]); - - lcd.setCursor(0 , 1); - if (seq_track_type[1] == 0 ) lcd.print("D"); else if (seq_track_type[1] == 1 ) lcd.print("I"); else if (seq_track_type[1] == 2 ) lcd.print("C"); else lcd.print("A"); - lcd.setCursor(2 , 1); - lcd.print( seq_patternchain[seq_chain_active_chainstep][1]); - - lcd.setCursor(6 , 0); - if (seq_track_type[2] == 0 ) lcd.print("D"); else if (seq_track_type[2] == 1 ) lcd.print("I"); else if (seq_track_type[2] == 2 ) lcd.print("C"); else lcd.print("A"); - lcd.setCursor(8 , 0); - lcd.print( seq_patternchain[seq_chain_active_chainstep][2]); - - lcd.setCursor(6 , 1); - if (seq_track_type[3] == 0 ) lcd.print("D"); else if (seq_track_type[3] == 1 ) lcd.print("I"); else if (seq_track_type[3] == 2 ) lcd.print("C"); else lcd.print("A"); - lcd.setCursor(8 , 1); - lcd.print( seq_patternchain[seq_chain_active_chainstep][3]); + lcd.setCursor( 0, 1); + lcd.print("T"); + lcd.setCursor(10 , 1); + lcd.print("=P"); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { @@ -5679,11 +5834,20 @@ void UI_func_seq_pat_chain(uint8_t param) if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) - seq_temp_select_menu = constrain(seq_temp_select_menu + 1, 0, 4); + seq_menu = constrain(seq_menu + 1, 0, 2); //menu select else if (LCDML.BT_checkUp()) - seq_temp_select_menu = constrain(seq_temp_select_menu - 1, 0, 4); + seq_menu = constrain(seq_menu - 1, 0, 2); } - } else if (seq_temp_active_menu == 4) { + } + 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_temp_select_menu = constrain(seq_temp_select_menu + 1, 0, NUM_SEQ_TRACKS - 1); + else if (LCDML.BT_checkUp()) + seq_temp_select_menu = constrain(seq_temp_select_menu - 1, 0, NUM_SEQ_TRACKS - 1); + } + } 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()) @@ -5692,130 +5856,94 @@ void UI_func_seq_pat_chain(uint8_t param) seq_chain_active_chainstep = constrain(seq_chain_active_chainstep - 1, 0, seq_chain_lenght); } } - else if (seq_temp_active_menu < 4) { + 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_patternchain[seq_chain_active_chainstep][seq_temp_active_menu] = constrain(seq_patternchain[seq_chain_active_chainstep][seq_temp_active_menu] + 1, 0, 9); + { + 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_patternchain[seq_chain_active_chainstep][seq_temp_active_menu] = constrain(seq_patternchain[seq_chain_active_chainstep][seq_temp_active_menu] - 1, 0, 9); + { + 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 (seq_temp_select_menu == 0 && seq_temp_active_menu == 99) // Drum 0 + if (LCDML.BT_checkEnter()) //handle button presses during menu >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> { - lcd.setCursor(1 , 0); - lcd.print("["); - lcd.setCursor(3 , 0); - lcd.print("]"); - lcd.setCursor(1 , 1); - lcd.print(" "); - lcd.setCursor(3 , 1); - lcd.print(" "); - } else if (seq_temp_select_menu == 1 && seq_temp_active_menu == 99) // Drum 1 + if (seq_temp_active_menu == 99 && seq_menu == 0 ) + { + seq_temp_active_menu = 20; + } + else if (seq_temp_active_menu == 99 && seq_menu == 1 ) + { + seq_temp_active_menu = 90; + } + else if (seq_temp_active_menu == 99 && seq_menu == 2 ) + { + seq_temp_active_menu = 18; + } + else + seq_temp_active_menu = 99; + } + if (seq_menu == 0) // Chainselect modify { - lcd.setCursor(1 , 0); + lcd.setCursor( 12, 1); lcd.print(" "); - lcd.setCursor(3 , 0); - lcd.print(" "); - lcd.setCursor(7 , 0); - lcd.print(" "); - lcd.setCursor(9 , 0); + lcd.setCursor( 15, 1); lcd.print(" "); lcd.setCursor(1 , 1); - lcd.print("["); - lcd.setCursor(3 , 1); - lcd.print("]"); - } else if (seq_temp_select_menu == 2 && seq_temp_active_menu == 99) // Drum 2 - { - lcd.setCursor(7 , 0); - lcd.print("["); - lcd.setCursor(9 , 0); - lcd.print("]"); - lcd.setCursor(1 , 1); lcd.print(" "); lcd.setCursor(3 , 1); lcd.print(" "); - lcd.setCursor(7 , 1); + lcd.setCursor( 11, 0); + lcd.print("["); + lcd.setCursor( 13, 0); + lcd.print("]"); + } + else if (seq_menu == 1 ) { + lcd.setCursor( 12, 1); lcd.print(" "); - lcd.setCursor(9 , 1); + lcd.setCursor( 15, 1); lcd.print(" "); - } else if (seq_temp_select_menu == 3 && seq_temp_active_menu == 99) // Inst - { - lcd.setCursor(7 , 0); + lcd.setCursor( 11, 0); lcd.print(" "); - lcd.setCursor(9 , 0); + lcd.setCursor( 13, 0); lcd.print(" "); - lcd.setCursor(7 , 1); + lcd.setCursor(1 , 1); lcd.print("["); - lcd.setCursor(9 , 1); + lcd.setCursor(3 , 1); lcd.print("]"); + } + else if (seq_menu == 2 ) { lcd.setCursor( 11, 0); lcd.print(" "); - lcd.setCursor( 15, 0); + lcd.setCursor( 13, 0); lcd.print(" "); - } else if (seq_temp_select_menu == 4 && seq_temp_active_menu == 99) // Chainselect - { - lcd.setCursor(7 , 1); + lcd.setCursor(1 , 1); lcd.print(" "); - lcd.setCursor(9 , 1); + lcd.setCursor(3 , 1); lcd.print(" "); - lcd.setCursor( 11, 0); - lcd.print("["); - lcd.setCursor( 12, 0); - lcd.print(seq_chain_active_chainstep + 1); - lcd.setCursor( 13, 0); - lcd.print("/"); - lcd.setCursor( 14, 0); - lcd.print(seq_chain_lenght + 1); - lcd.setCursor( 15, 0); - lcd.print("]"); - } else if (seq_temp_select_menu == 4 && seq_temp_active_menu == 4) // Chainselect modify - { - lcd.setCursor( 11, 0); + lcd.setCursor( 12, 1); lcd.print("["); - lcd.setCursor( 12, 0); - lcd.print(seq_chain_active_chainstep + 1); - lcd.setCursor( 13, 0); - lcd.print("/"); - lcd.setCursor( 14, 0); - lcd.print(seq_chain_lenght + 1); - lcd.setCursor( 15, 0); + lcd.setCursor( 15, 1); lcd.print("]"); - lcd.setCursor(2 , 0); - lcd.print( seq_patternchain[seq_chain_active_chainstep][0]); - lcd.setCursor(2 , 1); - lcd.print( seq_patternchain[seq_chain_active_chainstep][1]); - lcd.setCursor(8 , 0); - lcd.print( seq_patternchain[seq_chain_active_chainstep][2]); - lcd.setCursor(8 , 1); - lcd.print( seq_patternchain[seq_chain_active_chainstep][3]); - } else if (seq_temp_select_menu == 0 && seq_temp_active_menu == 0) // Drum 0 modify - { - lcd.setCursor(2 , 0); - lcd.print( seq_patternchain[seq_chain_active_chainstep][0]); - } else if (seq_temp_select_menu == 1 && seq_temp_active_menu == 1) // Drum 1 modify - { - lcd.setCursor(2 , 1); - lcd.print( seq_patternchain[seq_chain_active_chainstep][1]); - } else if (seq_temp_select_menu == 2 && seq_temp_active_menu == 2) // Drum 2 modify - { - lcd.setCursor(8 , 0); - lcd.print( seq_patternchain[seq_chain_active_chainstep][2]); - } else if (seq_temp_select_menu == 3 && seq_temp_active_menu == 3) // Inst modify - { - lcd.setCursor(8 , 1); - lcd.print( seq_patternchain[seq_chain_active_chainstep][3]); } - - if (LCDML.BT_checkEnter()) //handle button presses during menu >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + lcd.setCursor( 12, 0); + lcd.print(seq_chain_active_chainstep + 1); + lcd.setCursor(2 , 1); + lcd.print( seq_temp_select_menu + 1); + lcd.setCursor(4 , 1); + if (seq_track_type[seq_temp_select_menu] == 0 ) lcd.print("(Drum)"); + else if (seq_track_type[seq_temp_select_menu] == 1 ) lcd.print("(Inst)"); + else if (seq_track_type[seq_temp_select_menu] == 2 ) lcd.print("(Chrd)"); else lcd.print("(Arp.)"); + lcd.setCursor( 13, 1); + if (seq_patternchain[seq_chain_active_chainstep][seq_temp_select_menu] == NUM_SEQ_PATTERN)lcd.print("--"); //empty pattern + else { - if (seq_temp_active_menu == seq_temp_select_menu) { - seq_temp_active_menu = 99; - } else - { - seq_temp_active_menu = seq_temp_select_menu; - } + if (seq_patternchain[seq_chain_active_chainstep][seq_temp_select_menu] < 10) + lcd.print("0"); + lcd.print(seq_patternchain[seq_chain_active_chainstep][seq_temp_select_menu] ); } } if (LCDML.FUNC_close()) // ****** STABLE END ********* @@ -5830,22 +5958,11 @@ void UI_func_seq_track_setup(uint8_t param) { // setup function seq_temp_active_menu = 99; + seq_temp_select_menu = 0; lcd.setCursor(0 , 0); - lcd.print("T1"); + lcd.print("Track Setup"); lcd.setCursor(0 , 1); - lcd.print("T2"); - lcd.setCursor(9 , 0); - lcd.print("T3"); - lcd.setCursor(9 , 1); - lcd.print("T4"); - lcd.setCursor(3 , 0); - if (seq_track_type[0] == 0 ) lcd.print("Drm"); else if (seq_track_type[0] == 1 ) lcd.print("Ins"); else if (seq_track_type[0] == 2 )lcd.print("Chd"); else lcd.print("Arp"); - lcd.setCursor(3 , 1); - if (seq_track_type[1] == 0 ) lcd.print("Drm"); else if (seq_track_type[1] == 1 ) lcd.print("Ins"); else if (seq_track_type[1] == 2 )lcd.print("Chd"); else lcd.print("Arp"); - lcd.setCursor(12 , 0); - if (seq_track_type[2] == 0 ) lcd.print("Drm"); else if (seq_track_type[2] == 1 ) lcd.print("Ins"); else if (seq_track_type[2] == 2 )lcd.print("Chd"); else lcd.print("Arp"); - lcd.setCursor(12 , 1); - if (seq_track_type[3] == 0 ) lcd.print("Drm"); else if (seq_track_type[3] == 1 ) lcd.print("Ins"); else if (seq_track_type[3] == 2 )lcd.print("Chd"); else lcd.print("Arp"); + lcd.print("Track "); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { @@ -5853,9 +5970,9 @@ void UI_func_seq_track_setup(uint8_t param) if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) - seq_temp_select_menu = constrain(seq_temp_select_menu + 1, 0, 3); + seq_temp_select_menu = constrain(seq_temp_select_menu + 1, 0, NUM_SEQ_TRACKS - 1); else if (LCDML.BT_checkUp()) - seq_temp_select_menu = constrain(seq_temp_select_menu - 1, 0, 3); + 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())) @@ -5875,63 +5992,33 @@ void UI_func_seq_track_setup(uint8_t param) seq_temp_active_menu = 99; } } - if (seq_temp_select_menu == 0) - { - lcd.setCursor(2 , 0); - lcd.print("["); - lcd.setCursor(6 , 0); - lcd.print("]"); - lcd.setCursor(2 , 1); - lcd.print(" "); - lcd.setCursor(6 , 1); - lcd.print(" "); - lcd.setCursor(3 , 0); - if (seq_track_type[0] == 0 ) lcd.print("Drm"); else if (seq_track_type[0] == 1 ) lcd.print("Ins"); else if (seq_track_type[0] == 2 )lcd.print("Chd"); else lcd.print("Arp"); - } else if (seq_temp_select_menu == 1) + if (seq_temp_active_menu == 99) { - lcd.setCursor(2 , 0); + lcd.setCursor(8 , 1); lcd.print(" "); - lcd.setCursor(6 , 0); + lcd.setCursor(15 , 1); lcd.print(" "); - lcd.setCursor(2 , 1); + lcd.setCursor(5 , 1); lcd.print("["); lcd.setCursor(6 , 1); + lcd.print(seq_temp_select_menu + 1); + lcd.setCursor(7 , 1); lcd.print("]"); - lcd.setCursor(11 , 0); - lcd.print(" "); - lcd.setCursor(15 , 0); - lcd.print(" "); - lcd.setCursor(3 , 1); - if (seq_track_type[1] == 0 ) lcd.print("Drm"); else if (seq_track_type[1] == 1 ) lcd.print("Ins"); else if (seq_track_type[1] == 2 )lcd.print("Chd"); else lcd.print("Arp"); - } else if (seq_temp_select_menu == 2) - { - lcd.setCursor(2 , 1); - lcd.print(" "); - lcd.setCursor(6 , 1); - lcd.print(" "); - lcd.setCursor(11 , 0); - lcd.print("["); - lcd.setCursor(15 , 0); - lcd.print("]"); - lcd.setCursor(11 , 1); - lcd.print(" "); - lcd.setCursor(15 , 1); - lcd.print(" "); - lcd.setCursor(12 , 0); - if (seq_track_type[2] == 0 ) lcd.print("Drm"); else if (seq_track_type[2] == 1 ) lcd.print("Ins"); else if (seq_track_type[2] == 2 )lcd.print("Chd"); else lcd.print("Arp"); - } else if (seq_temp_select_menu == 3) + lcd.setCursor(9 , 1); + } else { - lcd.setCursor(11 , 0); + lcd.setCursor(5 , 1); lcd.print(" "); - lcd.setCursor(15 , 0); + lcd.setCursor(7 , 1); lcd.print(" "); - lcd.setCursor(11 , 1); + lcd.setCursor(8 , 1); lcd.print("["); lcd.setCursor(15 , 1); lcd.print("]"); - lcd.setCursor(12 , 1); - if (seq_track_type[3] == 0 ) lcd.print("Drm"); else if (seq_track_type[3] == 1 ) lcd.print("Ins"); else if (seq_track_type[3] == 2 )lcd.print("Chd"); else lcd.print("Arp"); + lcd.setCursor(9 , 1); } + if (seq_track_type[seq_temp_select_menu] == 0 ) lcd.print("Drums "); else if (seq_track_type[seq_temp_select_menu] == 1 ) lcd.print("Instru"); + else if (seq_track_type[seq_temp_select_menu] == 2 )lcd.print("Chords"); else lcd.print("Arp "); } if (LCDML.FUNC_close()) // ****** STABLE END ********* { @@ -5945,22 +6032,11 @@ void UI_func_dexed_assign(uint8_t param) { // setup function seq_temp_active_menu = 99; + seq_temp_select_menu = 0; lcd.setCursor(0 , 0); - lcd.print("T1"); + lcd.print("dexed assign"); lcd.setCursor(0 , 1); - lcd.print("T2"); - lcd.setCursor(9 , 0); - lcd.print("T3"); - lcd.setCursor(9 , 1); - lcd.print("T4"); - lcd.setCursor(3 , 0); - if (seq_inst_dexed[0] == 0 ) lcd.print("D1"); else lcd.print("D2"); - lcd.setCursor(3 , 1); - if (seq_inst_dexed[1] == 0 ) lcd.print("D1"); else lcd.print("D2"); - lcd.setCursor(12 , 0); - if (seq_inst_dexed[2] == 0 ) lcd.print("D1"); else lcd.print("D2"); - lcd.setCursor(12 , 1); - if (seq_inst_dexed[3] == 0 ) lcd.print("D1"); else lcd.print("D2"); + lcd.print("Track "); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { @@ -5968,9 +6044,9 @@ void UI_func_dexed_assign(uint8_t param) if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) - seq_temp_select_menu = constrain(seq_temp_select_menu + 1, 0, 3); + seq_temp_select_menu = constrain(seq_temp_select_menu + 1, 0, NUM_SEQ_TRACKS - 1); else if (LCDML.BT_checkUp()) - seq_temp_select_menu = constrain(seq_temp_select_menu - 1, 0, 3); + 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())) @@ -5990,63 +6066,34 @@ void UI_func_dexed_assign(uint8_t param) seq_temp_active_menu = 99; } } - if (seq_temp_select_menu == 0) + if (seq_temp_active_menu == 99) { - lcd.setCursor(2 , 0); - lcd.print("["); - lcd.setCursor(6 , 0); - lcd.print("]"); - lcd.setCursor(2 , 1); - lcd.print(" "); - lcd.setCursor(6 , 1); - lcd.print(" "); - lcd.setCursor(3 , 0); - if (seq_inst_dexed[0] == 0 ) lcd.print("D1"); else lcd.print("D2"); - } else if (seq_temp_select_menu == 1) - { - lcd.setCursor(2 , 0); + lcd.setCursor(8 , 1); lcd.print(" "); - lcd.setCursor(6 , 0); + lcd.setCursor(15 , 1); lcd.print(" "); - lcd.setCursor(2 , 1); + lcd.setCursor(5 , 1); lcd.print("["); lcd.setCursor(6 , 1); + lcd.print(seq_temp_select_menu + 1); + lcd.setCursor(7 , 1); lcd.print("]"); - lcd.setCursor(11 , 0); - lcd.print(" "); - lcd.setCursor(15 , 0); - lcd.print(" "); - lcd.setCursor(3 , 1); - if (seq_inst_dexed[1] == 0 ) lcd.print("D1"); else lcd.print("D2"); - } else if (seq_temp_select_menu == 2) - { - lcd.setCursor(2 , 1); - lcd.print(" "); - lcd.setCursor(6 , 1); - lcd.print(" "); - lcd.setCursor(11 , 0); - lcd.print("["); - lcd.setCursor(15 , 0); - lcd.print("]"); - lcd.setCursor(11 , 1); - lcd.print(" "); - lcd.setCursor(15 , 1); - lcd.print(" "); - lcd.setCursor(12 , 0); - if (seq_inst_dexed[2] == 0 ) lcd.print("D1"); else lcd.print("D2"); - } else if (seq_temp_select_menu == 3) + lcd.setCursor(9 , 1); + } else { - lcd.setCursor(11 , 0); + lcd.setCursor(5 , 1); lcd.print(" "); - lcd.setCursor(15 , 0); + lcd.setCursor(7 , 1); lcd.print(" "); - lcd.setCursor(11 , 1); + lcd.setCursor(8 , 1); lcd.print("["); lcd.setCursor(15 , 1); lcd.print("]"); - lcd.setCursor(12 , 1); - if (seq_inst_dexed[3] == 0 ) lcd.print("D1"); else lcd.print("D2"); + lcd.setCursor(9 , 1); + } + if (seq_inst_dexed[seq_temp_select_menu] == 0 ) lcd.print("dexed0"); else if (seq_inst_dexed[seq_temp_select_menu] == 1 ) lcd.print("dexed1"); else lcd.print("??????"); + } if (LCDML.FUNC_close()) // ****** STABLE END ********* { @@ -6101,7 +6148,6 @@ void UI_func_seq_state_load(uint8_t param) char tmp[10]; sprintf(tmp, "[%2d]", temp_int); lcd.print(tmp); - //cd.setCursor(5, 1); if (check_sd_seq_exists(temp_int)) { get_sd_seq_name_json(temp_int); diff --git a/UI_FX_T4.h b/UI_FX_T4.h index 4ebbbf6..a9b4b0b 100644 --- a/UI_FX_T4.h +++ b/UI_FX_T4.h @@ -121,11 +121,11 @@ LCDML_add(87, LCDML_0, 4, "Drums", NULL); LCDML_add(88, LCDML_0_4, 1, "Drums Main Vol", UI_func_drums_main_volume); LCDML_add(89, LCDML_0_4, 2, "Drum Volumes", UI_func_drum_volume); LCDML_add(90, LCDML_0_4, 3, "Drum Pan", UI_func_drum_pan); -LCDML_add(91, LCDML_0_4, 4, "Drum Pitch", UI_func_drum_pitch); -LCDML_add(92, LCDML_0_4, 5, "Drum Rev.Send", UI_func_drum_reverb_send); -LCDML_add(93, LCDML_0_4, 6, "MIDI Channel", UI_func_drum_midi_channel); -LCDML_add(94, LCDML_0_4, 7, "Smart Filter", UI_func_smart_filter); -LCDML_add(95, LCDML_0_4, 8, "Drum Monitor", UI_func_drum_monitor); +LCDML_add(91, LCDML_0_4, 4, "Drum Rev.Send", UI_func_drum_reverb_send); +LCDML_add(92, LCDML_0_4, 5, "Drum Pitch", UI_func_drum_pitch); +LCDML_add(93, LCDML_0_4, 6, "Drum Tune", UI_func_drum_tune_offset); +LCDML_add(94, LCDML_0_4, 7, "MIDI Channel", UI_func_drum_midi_channel); +LCDML_add(95, LCDML_0_4, 8, "Smart Filter", UI_func_smart_filter); LCDML_add(96, LCDML_0, 5, "Sequencer", NULL); LCDML_add(97, LCDML_0_5, 1, "Pattern Editor", UI_func_seq_pattern_editor); LCDML_add(98, LCDML_0_5, 2, "Vel./Chrd Edit", UI_func_seq_vel_editor); diff --git a/sequencer.h b/sequencer.h index 40b14cc..c300cf3 100644 --- a/sequencer.h +++ b/sequencer.h @@ -3,7 +3,7 @@ float drums_volume; uint8_t seq_active_track = 0; uint8_t seq_menu; bool seq_button_r = false; -bool seq_noteoffsent[4] = {false, false, false, false}; +bool seq_noteoffsent[NUM_SEQ_TRACKS] = {false, false, false, false,false, false}; uint8_t seq_step = 0; bool seq_running = false; bool seq_recording = false; @@ -14,7 +14,7 @@ char seq_name_temp[FILENAME_LEN]; uint8_t seq_note_in; uint8_t seq_note_in_velocity; int seq_transpose; -uint8_t seq_inst_dexed[NUM_SEQ_TRACKS] = { 0, 0, 1, 1 }; +uint8_t seq_inst_dexed[NUM_SEQ_TRACKS] = { 0, 0, 1, 1 ,1,1 }; uint8_t seq_chord_dexed_inst = 0; uint8_t seq_chord_velocity = 60; uint8_t seq_chord_key_ammount = 4; @@ -45,7 +45,7 @@ char arp_style_names[4][3] = { 'u', 'p', ' ', 'u', '&', 'd', 'R', 'N', 'D', }; -int seq_tempo_ms = 147; +int seq_tempo_ms = 180000; int seq_bpm = 102; uint8_t seq_temp_select_menu; uint8_t seq_temp_active_menu = 99; @@ -66,27 +66,27 @@ 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] = {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 , - 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 , - 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 , - 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 , + 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 , + 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 , + 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 + }; uint8_t seq_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, - 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, - 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, - 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, + 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, + 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, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + }; //uint8_t seq_data[10][16] = {69 , 69 , 0 , 69 , 69 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 67 , 67 , 0 , 67 , 67 , 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 , @@ -133,10 +133,12 @@ uint8_t seq_vel[NUM_SEQ_PATTERN][16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // 123, 120, 0, 110, 120, 0, 90, 120, 0, 0, 0, 0, 0, 0, 0, 0 // }; -uint8_t seq_patternchain[NUM_SEQ_TRACKS][4] = { 0 , 2 , 6 , 9 , - 1 , 2 , 5 , 8 , - 0 , 2 , 6 , 9 , - 1 , 2 , 5 , 7 - }; -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_track_type[NUM_SEQ_TRACKS] = { 0, 0, 0, 0 }; // 0 = track is Drumtrack, 1 = Instrumenttrack, 2 = Chord, 3 = Arp +uint8_t seq_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_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_track_type[NUM_SEQ_TRACKS] = { 0, 0, 1, 1, 1,1 }; // 0 = track is Drumtrack, 1 = Instrumenttrack, 2 = Chord, 3 = Arp