From cbbac81e6292cb6d63fa77f4476c505d2ac38336 Mon Sep 17 00:00:00 2001 From: positionhigh Date: Sun, 29 Aug 2021 22:17: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 | 221 ++++++++++++++++++++++++++++++++++++++++++------------- config.h | 2 +- 2 files changed, 172 insertions(+), 51 deletions(-) diff --git a/UI.hpp b/UI.hpp index 57a9fc5..6e417a3 100644 --- a/UI.hpp +++ b/UI.hpp @@ -314,6 +314,7 @@ 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); @@ -4521,7 +4522,8 @@ void UI_func_seq_vel_editor(uint8_t param) } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (seq_active_function == 99) { + if (seq_active_function == 99) + { if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) @@ -4530,7 +4532,8 @@ void UI_func_seq_vel_editor(uint8_t param) seq_menu = constrain(seq_menu - 1, 0, 16); } } - else if (seq_active_function == 0) { + else if (seq_active_function == 0) + { if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) @@ -4539,21 +4542,41 @@ void UI_func_seq_vel_editor(uint8_t param) seq_active_track = constrain(seq_active_track - 1, 0, 9); } } - else 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 ( seq_data[seq_active_track][seq_menu - 1] > 0 ) + { + if (seq_vel[seq_active_track][seq_menu - 1] < 210) //it is a normal sample { - if (LCDML.BT_checkDown()) - 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_vel[seq_active_track][seq_menu - 1] = constrain(seq_vel[seq_active_track][seq_menu - 1] - 1, 0, 127); + 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_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_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_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_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_vel[seq_active_track][seq_menu - 1] = constrain(seq_vel[seq_active_track][seq_menu - 1] - 1, 200, 205); + } + } } - } 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())) + else { - if (LCDML.BT_checkDown()) - 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_vel[seq_active_track][seq_menu - 1] = constrain(seq_vel[seq_active_track][seq_menu - 1] - 1, 200, 205); + //is in pitched Sample Mode + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) + { + if (LCDML.BT_checkDown()) + seq_vel[seq_active_track][seq_menu - 1] = constrain(seq_vel[seq_active_track][seq_menu - 1] + 1, 210, 214); + else if (LCDML.BT_checkUp()) + seq_vel[seq_active_track][seq_menu - 1] = constrain(seq_vel[seq_active_track][seq_menu - 1] - 1, 210, 214); + } } } if (LCDML.BT_checkEnter()) //handle button presses during menu >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> @@ -4573,19 +4596,43 @@ void UI_func_seq_vel_editor(uint8_t param) seq_active_function = 99; } //button check end <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< - 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_menu > 0 && seq_content_type[seq_active_track] < 2) { + if (seq_active_function == 0) { lcd.setCursor(0, 0); - lcd.print("Vel:"); - sprintf(tmp, "%03d", seq_vel[seq_active_track][seq_menu - 1]); - lcd.setCursor(4, 0); - lcd.print(tmp); + if (seq_content_type[seq_active_track] == 0) + lcd.print("Drum Track "); + else if (seq_content_type[seq_active_track] == 1) + lcd.print("Instr. Track "); + else + lcd.print("Chord Track "); + } + if (seq_menu > 0 && seq_content_type[seq_active_track] == 0) + { + 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:"); + sprintf(tmp, "%03d", seq_vel[seq_active_track][seq_menu - 1]); + lcd.setCursor(4, 0); + lcd.print(tmp); + } + else + { // else it is a live-pitched sample + if (seq_vel[seq_active_track][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_vel[seq_active_track][seq_menu - 1] - 210].name)); + } + } } if (seq_menu == 0) { - lcd.setCursor(4, 0); - lcd.print("--- --- "); + if (seq_active_function != 0) + { + lcd.setCursor(0, 0); + lcd.print(" "); + } lcd.setCursor(13, 0); lcd.print("["); lcd.print(seq_active_track); @@ -4601,10 +4648,14 @@ void UI_func_seq_vel_editor(uint8_t param) lcd.write(219); // cursor symbol lcd.setCursor(1, 1); lcd.print(seq_find_shortname(1)[0] ); - sprintf(tmp, "%03d", seq_vel[seq_active_track][seq_menu - 1]); - lcd.setCursor(4, 0); - lcd.print(tmp); - } else if (seq_menu > 1) { + 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.print(tmp); + } + } else if (seq_menu > 1) + { lcd.setCursor(seq_menu - 1, 1); lcd.write(219); // cursor symbol lcd.setCursor(seq_menu - 2, 1); @@ -4616,32 +4667,70 @@ void UI_func_seq_vel_editor(uint8_t param) } if (seq_menu > 0) { lcd.setCursor(4, 0); - if (seq_data[seq_active_track][seq_menu - 1] > 0) { - + if (seq_data[seq_active_track][seq_menu - 1] > 0) + { if (seq_content_type[seq_active_track] == 0) //is Drumtrack { - lcd.show(0, 8, 5, seq_find_drum_name_from_note( seq_data[seq_active_track][seq_menu - 1]) ); + lcd.setCursor(0, 0); + if (seq_vel[seq_active_track][seq_menu - 1] < 210) //it is a normal sample + { + lcd.print("Vel:"); + 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]) ); + } + 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_vel[seq_active_track][seq_menu - 1] - 210].name)); + } } else - { lcd.setCursor(0, 0); - lcd.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' ) { - lcd.print(noteNames[seq_data[seq_active_track][seq_menu - 1] % 12 ][1] ); + { + if ( seq_data[seq_active_track][seq_menu - 1] != 130 ) //note not latched + { + if (seq_content_type[seq_active_track] < 2) + { + lcd.setCursor(0, 0); + lcd.print("Vel:"); + sprintf(tmp, "%03d", seq_vel[seq_active_track][seq_menu - 1]); + lcd.setCursor(4, 0); + lcd.print(tmp); + } + lcd.setCursor(8, 0); + lcd.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' ) { + lcd.print(noteNames[seq_data[seq_active_track][seq_menu - 1] % 12 ][1] ); + } + lcd.print( (seq_data[seq_active_track][seq_menu - 1] / 12) - 1); + lcd.print(" "); } - lcd.print( (seq_data[seq_active_track][seq_menu - 1] / 12) - 1); - lcd.print(" "); - if (seq_content_type[seq_active_track] > 1) { - lcd.setCursor(3, 0); + else + { //note is latched + lcd.setCursor(0, 0); + 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] == 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 " ); } } } else - lcd.print(" "); + { + lcd.setCursor(0, 0); + lcd.print(" "); + } } } if (LCDML.FUNC_close()) // ****** STABLE END ********* @@ -4714,6 +4803,25 @@ void arp_refresh_display_play_status() } } +void UI_func_drum_monitor(uint8_t param) +{ + 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(); + } +} + void UI_func_seq_pattern_editor(uint8_t param) { if (LCDML.FUNC_setup()) // ****** SETUP ********* @@ -4821,9 +4929,9 @@ 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()) - temp_int = constrain(temp_int + 1, 0, 115 ); //was 114 + temp_int = constrain(temp_int + 1, 0, 115 ); else if (LCDML.BT_checkUp()) - temp_int = constrain(temp_int - 1, 0, 115 );//was 114 + temp_int = constrain(temp_int - 1, 0, 115 ); } } } else if (seq_active_function == 2) @@ -4969,10 +5077,12 @@ void UI_func_seq_pattern_editor(uint8_t param) { if (seq_active_function != 2) seq_active_function = 2; else seq_active_function = 99; - if (seq_content_type[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)); - } else { + } else + { if (temp_int < 109) { lcd.setCursor(3, 0); lcd.print(" "); @@ -4983,14 +5093,25 @@ void UI_func_seq_pattern_editor(uint8_t param) } } else if (seq_menu > 2 && seq_menu < 30) { - if (seq_active_function == 99) { - if (seq_content_type[seq_active_track] == 0) { //Drumtrack - seq_data[seq_active_track][seq_menu - 3] = drum_config[activesample].midinote; - seq_vel[seq_active_track][seq_menu - 3] = 120; + 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 + { + 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) { //clear note + if (temp_int == 109 || seq_data[seq_active_track][seq_menu - 3] == temp_int ) + { //clear note 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 diff --git a/config.h b/config.h index 694b982..481aa96 100644 --- a/config.h +++ b/config.h @@ -90,7 +90,7 @@ //************************************************************************************************* //* DEBUG OUTPUT SETTINGS //************************************************************************************************* -#define DEBUG 1 +//#define DEBUG 1 #define SERIAL_SPEED 230400 #define SHOW_XRUN 1 #define SHOW_CPU_LOAD_MSEC 5000