Dateien hochladen nach „“

pull/67/head
positionhigh 3 years ago
parent b2459d980d
commit 34dbd05acf
  1. 9
      MicroDexed.ino
  2. 437
      UI.hpp

@ -2567,15 +2567,12 @@ void check_and_create_directories(void)
sprintf(tmp, "/%s/fav-v2", FAV_CONFIG_PATH); sprintf(tmp, "/%s/fav-v2", FAV_CONFIG_PATH);
if (!SD.exists(tmp)) if (!SD.exists(tmp))
SD.mkdir(tmp); // Set Marker so that the Cleanup loops only run once. SD.mkdir(tmp); // Set Marker so that the Cleanup loops only run once.
} else }
#ifdef DEBUG #ifdef DEBUG
Serial.println(F("Favs-V2 ready. ")); else
Serial.println(F("No SD card for directory check available."));
#endif #endif
} }
#ifdef DEBUG
else
Serial.println(F("No SD card for directory check available."));
#endif
} }
/****************************************************************************** /******************************************************************************

437
UI.hpp

@ -686,13 +686,13 @@ void lcdml_menu_control(void)
#endif #endif
encoderDir[ENC_R].ButtonLong(true); encoderDir[ENC_R].ButtonLong(true);
if (seq_running) { // if (seq_running) {
seq_running = false; // seq_running = false;
seq_recording = false; // seq_recording = false;
seq_step = 0; // seq_step = 0;
seq_chain_active_step = 0; // seq_chain_active_step = 0;
MicroDexed[0]->panic(); // MicroDexed[0]->panic();
} // }
if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_voice_select)) if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_voice_select))
{ {
@ -3862,7 +3862,6 @@ const char* seq_find_shortname(uint8_t sstep)
{ {
for (uint8_t d = 0; d < NUM_DRUMSET_CONFIG - 1; d++) for (uint8_t d = 0; d < NUM_DRUMSET_CONFIG - 1; d++)
{ {
// if (seq_data[ seq_patternchain[seq_chain_active_step][seq_active_track] ][sstep] == drum_config[d].midinote)
if (seq_data[seq_active_track][sstep] == drum_config[d].midinote) if (seq_data[seq_active_track][sstep] == drum_config[d].midinote)
{ {
shortname = drum_config[d].shortname; shortname = drum_config[d].shortname;
@ -3873,7 +3872,6 @@ const char* seq_find_shortname(uint8_t sstep)
if (found == false) shortname = "-"; if (found == false) shortname = "-";
} else } else
{ {
// if (seq_data[ seq_patternchain[seq_chain_active_step][seq_active_track] ][sstep] > 0) shortname = "*"; else shortname = "-";
if (seq_data[seq_active_track][sstep] > 0) if (seq_data[seq_active_track][sstep] > 0)
shortname = noteNames[seq_data[seq_active_track][sstep] % 12]; shortname = noteNames[seq_data[seq_active_track][sstep] % 12];
else shortname = "-"; else shortname = "-";
@ -3881,6 +3879,15 @@ const char* seq_find_shortname(uint8_t sstep)
return shortname; return shortname;
} }
void seq_printAllSeqSteps()
{
lcd.setCursor(0, 1);
for (uint8_t i = 0; i < 16; i++)
{
lcd.print(seq_find_shortname(i)[0]);
}
}
// deactivated for now since audio library seems not like to change reverb settings at runtime (and is skipping notes) // deactivated for now since audio library seems not like to change reverb settings at runtime (and is skipping notes)
//void seq_set_rev_for_single_instr_per_step(uint8_t track, uint8_t note) //void seq_set_rev_for_single_instr_per_step(uint8_t track, uint8_t note)
//{ //{
@ -3899,7 +3906,6 @@ const char* seq_find_shortname(uint8_t sstep)
void UI_func_seq_display_style(uint8_t param) void UI_func_seq_display_style(uint8_t param)
{ {
if (LCDML.FUNC_setup()) // ****** SETUP ********* if (LCDML.FUNC_setup()) // ****** SETUP *********
{ {
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
@ -4037,7 +4043,6 @@ void UI_func_seq_lenght(uint8_t param)
lcd.setCursor(0, 0); lcd.setCursor(0, 0);
lcd.print(" Seq. lenght "); lcd.print(" Seq. lenght ");
} }
if (LCDML.FUNC_loop()) // ****** LOOP ********* 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() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort()))
@ -4047,14 +4052,11 @@ void UI_func_seq_lenght(uint8_t param)
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
seq_chain_lenght = constrain(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.setCursor(3, 1);
lcd.print((seq_chain_lenght + 1) * 16 ); lcd.print((seq_chain_lenght + 1) * 16 );
lcd.setCursor(7, 1); lcd.setCursor(7, 1);
lcd.print("Steps"); lcd.print("Steps");
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
@ -4074,7 +4076,6 @@ void UI_func_seq_tempo(uint8_t param)
lcd.setCursor(14, 1); lcd.setCursor(14, 1);
lcd.print("ms"); lcd.print("ms");
} }
if (LCDML.FUNC_loop()) // ****** LOOP ********* 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() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort()))
@ -4084,7 +4085,6 @@ void UI_func_seq_tempo(uint8_t param)
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
seq_bpm = constrain(seq_bpm - ENCODER[ENC_R].speed(), 60, 180); seq_bpm = constrain(seq_bpm - ENCODER[ENC_R].speed(), 60, 180);
} }
seq_tempo_ms = 60000 / seq_bpm / 4; seq_tempo_ms = 60000 / seq_bpm / 4;
sprintf(tmp, "[%3d]", seq_bpm); sprintf(tmp, "[%3d]", seq_bpm);
@ -4095,7 +4095,6 @@ void UI_func_seq_tempo(uint8_t param)
sprintf(tmp, "[%3d]", seq_tempo_ms); sprintf(tmp, "[%3d]", seq_tempo_ms);
lcd.print(tmp); lcd.print(tmp);
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
@ -4107,8 +4106,8 @@ void UI_func_seq_vel_editor(uint8_t param)
char tmp[5]; char tmp[5];
if (LCDML.FUNC_setup()) // ****** SETUP ********* if (LCDML.FUNC_setup()) // ****** SETUP *********
{ {
encoderDir[ENC_R].reset();
// setup function // setup function
encoderDir[ENC_R].reset();
lcd.setCursor(0, 0); lcd.setCursor(0, 0);
lcd.print("Vel:"); lcd.print("Vel:");
sprintf(tmp, "%03d", seq_vel[seq_active_track][seq_menu - 1]); sprintf(tmp, "%03d", seq_vel[seq_active_track][seq_menu - 1]);
@ -4118,18 +4117,13 @@ void UI_func_seq_vel_editor(uint8_t param)
lcd.print("S["); lcd.print("S[");
lcd.setCursor(15, 0); lcd.setCursor(15, 0);
lcd.print("]"); lcd.print("]");
lcd.setCursor(14, 0); lcd.setCursor(14, 0);
lcd.print(seq_active_track); lcd.print(seq_active_track);
for (int i = 0; i < 16; i++) { seq_printAllSeqSteps();
lcd.setCursor(i, 1);
lcd.print(seq_find_shortname(i) );
}
} }
if (LCDML.FUNC_loop()) // ****** LOOP ********* 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() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()))
{ {
if (LCDML.BT_checkDown()) if (LCDML.BT_checkDown())
@ -4182,10 +4176,7 @@ void UI_func_seq_vel_editor(uint8_t param)
lcd.print(seq_active_track); lcd.print(seq_active_track);
lcd.print("]"); lcd.print("]");
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
for (int i = 0; i < 16; i++) { seq_printAllSeqSteps();
lcd.setCursor(i, 1);
lcd.print(seq_find_shortname(i)[0] );
}
} else if (seq_menu == 1) { } else if (seq_menu == 1) {
lcd.setCursor(13, 0); lcd.setCursor(13, 0);
lcd.print(" "); lcd.print(" ");
@ -4215,9 +4206,7 @@ void UI_func_seq_vel_editor(uint8_t param)
if (seq_content_type[seq_active_track] == 0) //is Drumtrack if (seq_content_type[seq_active_track] == 0) //is Drumtrack
{ {
//activesample=seq_data[seq_active_track][seq_menu - 1];
lcd.show(0, 8, 5, seq_find_drum_name_from_note( seq_data[seq_active_track][seq_menu - 1]) ); lcd.show(0, 8, 5, seq_find_drum_name_from_note( seq_data[seq_active_track][seq_menu - 1]) );
// lcd.show(0, 8, 3, basename(drum_config[activesample].name));
} else } else
{ {
lcd.print(noteNames[seq_data[seq_active_track][seq_menu - 1] % 12 ][0] ); lcd.print(noteNames[seq_data[seq_active_track][seq_menu - 1] % 12 ][0] );
@ -4238,6 +4227,37 @@ void UI_func_seq_vel_editor(uint8_t param)
} }
} }
void seq_clear_active_pattern()
{
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 < 10; 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()
{
lcd.setCursor(9, 0);
if (seq_running == false && seq_recording == false)
{
lcd.print("PLY");
} else if (seq_running == true && seq_recording == false)
{
seq_note_in = 0;
lcd.print("REC");
} else if (seq_running == true && seq_recording == true)
{
seq_note_in = 0;
lcd.print("STP");
}
}
void UI_func_sequencer(uint8_t param) void UI_func_sequencer(uint8_t param)
{ {
if (LCDML.FUNC_setup()) // ****** SETUP ********* if (LCDML.FUNC_setup()) // ****** SETUP *********
@ -4248,96 +4268,210 @@ void UI_func_sequencer(uint8_t param)
// setup function // setup function
lcd.setCursor(1, 0); lcd.setCursor(1, 0);
lcd.show(0, 1, 6, basename(drum_config[activesample].name)); lcd.show(0, 1, 6, basename(drum_config[activesample].name));
lcd.setCursor(9, 0); seq_refresh_display_play_status();
if (seq_running == false && seq_recording == false)
{
lcd.print("PLY");
} else if (seq_running == true && seq_recording == false)
{
seq_note_in = 0;
lcd.print("REC");
} else if (seq_running == true && seq_recording == true)
{
seq_note_in = 0;
lcd.print("STP");
}
lcd.setCursor(14, 0); lcd.setCursor(14, 0);
lcd.print(seq_active_track); lcd.print(seq_active_track);
for (int i = 0; i < 16; i++) { seq_printAllSeqSteps();
lcd.setCursor(i, 1);
lcd.print(seq_find_shortname(i)[0]);
}
} }
if (LCDML.FUNC_loop()) // ****** LOOP ********* if (LCDML.FUNC_loop()) // ****** LOOP *********
{ { if (seq_menu == 33 ) { // is in sub-function - fill pattern
if (seq_active_function == 99) seq_active_function = 95;
{
if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()))
{ {
if (LCDML.BT_checkDown()) if (LCDML.BT_checkDown()) {
seq_menu = constrain(seq_menu + 1, 0, 18);
else if (LCDML.BT_checkUp()) seq_temp_active_menu = constrain(seq_temp_active_menu + 1, 0, 3);
seq_menu = constrain(seq_menu - 1, 0, 18); }
else if (LCDML.BT_checkUp()) {
seq_temp_active_menu = constrain(seq_temp_active_menu - 1, 0, 3);
}
} }
} else if (seq_active_function == 0 ) { } else
if (seq_content_type[seq_active_track] == 0) // is in Drumedit mode
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()))
{
if (LCDML.BT_checkDown()) {
seq_temp_select_menu = constrain(seq_temp_select_menu + 1, 0, NUM_DRUMSET_CONFIG - 1);
}
else if (LCDML.BT_checkUp()) {
seq_temp_select_menu = constrain(seq_temp_select_menu - 1, 0, NUM_DRUMSET_CONFIG - 1);
}
}
} else
{
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, 108 );
else if (LCDML.BT_checkUp())
seq_temp_select_menu = constrain(seq_temp_select_menu - 1, 0, 108 );
}
}
} 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, 9);
if (temp_int == seq_active_track)temp_int++;
if (temp_int > 9)temp_int = 0;
}
else if (LCDML.BT_checkUp()) {
temp_int = constrain(temp_int - 1, 0, 9);
if (temp_int == seq_active_track)temp_int--;
if (temp_int < 0)temp_int = 9;
}
}
} else if (seq_active_function == 99)
{ {
if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()))
{ {
if (LCDML.BT_checkDown()) if (LCDML.BT_checkDown())
activesample = constrain(activesample + 1, 0, NUM_DRUMSET_CONFIG + 1 ); seq_menu = constrain(seq_menu + 1, 0, 18);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
activesample = constrain(activesample - 1, 0, NUM_DRUMSET_CONFIG + 1 ); seq_menu = constrain(seq_menu - 1, 0, 18);
} }
} else //is in Instrument Mode } else if (seq_active_function == 0 ) {
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()))
{
if (LCDML.BT_checkDown())
activesample = constrain(activesample + 1, 0, NUM_DRUMSET_CONFIG + 4 );
else if (LCDML.BT_checkUp())
activesample = constrain(activesample - 1, 0, NUM_DRUMSET_CONFIG + 4 );
}
} else //is in Instrument Mode
{
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, 114 );
else if (LCDML.BT_checkUp())
temp_int = constrain(temp_int - 1, 0, 114 );
}
}
} else if (seq_active_function == 2)
{ {
if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()))
{ {
if (LCDML.BT_checkDown()) if (LCDML.BT_checkDown())
temp_int = constrain(temp_int + 1, 0, 111 ); seq_active_track = constrain(seq_active_track + 1, 0, 9);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
temp_int = constrain(temp_int - 1, 0, 111 ); seq_active_track = constrain(seq_active_track - 1, 0, 9);
lcd.setCursor(1, 0);
if (seq_content_type[seq_active_track] == 0) lcd.print("Drum "); else lcd.print("Inst "); //else lcd.print("[ ]");
} }
} }
} else if (seq_active_function == 2) if (LCDML.BT_checkEnter()) //handle button presses during menu >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
{ {
if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) if (seq_menu == 32 && seq_active_function == 97) //fill pattern every 1/4, 1/8, 1/16 step with active sample/note step 1
{ {
if (LCDML.BT_checkDown()) seq_active_function = 96;
seq_active_track = constrain(seq_active_track + 1, 0, 9); seq_menu = 33;
else if (LCDML.BT_checkUp()) } 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
seq_active_track = constrain(seq_active_track - 1, 0, 9); {
if (seq_content_type[seq_active_track] == 0) { //Drumtrack
lcd.setCursor(1, 0); for (uint8_t i = 0; i < 16; i++)
if (seq_content_type[seq_active_track] == 0) lcd.print("Drum "); else lcd.print("Inst "); //else lcd.print("[ ]"); {
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_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_menu = 0;
seq_active_function = 0;
activesample = 0;
temp_int = seq_data[seq_active_track][0];
seq_refresh_display_play_status();
seq_printAllSeqSteps();
} else if (seq_menu == 31) //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]));
seq_content_type[temp_int] = seq_content_type[seq_active_track];
seq_menu = 0;
seq_active_function = 0;
activesample = 0;
temp_int = seq_data[seq_active_track][0];
seq_refresh_display_play_status();
seq_printAllSeqSteps();
} else if (seq_menu == 30) //swap patterns
{
uint8_t data_temp[1][16];
uint8_t vel_temp[1][16];
uint8_t content_type_temp;
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;
temp_int = seq_data[seq_active_track][0];
seq_refresh_display_play_status();
seq_printAllSeqSteps();
} }
}
if (LCDML.BT_checkEnter()) //handle button presses during menu >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
{
if ( seq_menu == 0 && seq_active_function == 99) if ( seq_menu == 0 && seq_active_function == 99)
{ {
seq_active_function = 0; seq_active_function = 0;
} else if ( seq_menu == 0 && seq_active_function == 0) } else if ( seq_menu == 0 && seq_active_function == 0)
{ {
if ( (seq_content_type[seq_active_track] == 0 && activesample == NUM_DRUMSET_CONFIG + 1) || (seq_content_type[seq_active_track] == 0 && temp_int == 111) ) { if ( (seq_content_type[seq_active_track] == 0 && activesample == NUM_DRUMSET_CONFIG + 4) || (seq_content_type[seq_active_track] == 1 && temp_int == 114) )
for (int i = 0; i < 10; i++) { { //fill patterns
memset(seq_data[i], 0, sizeof(seq_data[i])); lcd.setCursor(0, 0);
memset(seq_vel[i], 0, sizeof(seq_vel[i])); lcd.print("Fill Pattern:");
} lcd.setCursor(9, 1);
for (int i = 0; i < 16; i++) { lcd.print(" ");
lcd.setCursor(i, 1); seq_menu = 32;
lcd.print(seq_find_shortname(i)[0]); seq_temp_select_menu = 0;
} seq_temp_active_menu = 0;
} else if ( (seq_content_type[seq_active_track] == 0 && activesample == NUM_DRUMSET_CONFIG) || (seq_content_type[seq_active_track] == 0 && temp_int == 110) ) { }
memset(seq_data[seq_active_track], 0, sizeof(seq_data[seq_active_track])); else if ( (seq_content_type[seq_active_track] == 0 && activesample == NUM_DRUMSET_CONFIG + 3) || (seq_content_type[seq_active_track] == 1 && temp_int == 113) )
memset(seq_vel[seq_active_track], 0, sizeof(seq_vel[seq_active_track])); { //swap patterns: Active pattern <-> destination pattern
for (int i = 0; i < 16; i++) { lcd.setCursor(0, 0);
lcd.setCursor(i, 1); lcd.print("Swap Pattern:");
lcd.print(seq_find_shortname(i)[0]); temp_int = seq_active_track + 1;
} if (temp_int > 9)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] == 1 && temp_int == 112) )
{ //copy pattern
lcd.setCursor(0, 0);
lcd.print("Copy Pattern:");
temp_int = seq_active_track + 1;
if (temp_int > 9)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] == 1 && temp_int == 111) )
{ //clear all patterns
seq_clear_all_patterns();
seq_printAllSeqSteps();
} else if ( (seq_content_type[seq_active_track] == 0 && activesample == NUM_DRUMSET_CONFIG) || (seq_content_type[seq_active_track] == 1 && temp_int == 110) )
{ //clear pattern
seq_clear_active_pattern();
seq_printAllSeqSteps();
} }
seq_active_function = 99; seq_active_function = 99;
} }
@ -4366,7 +4500,7 @@ void UI_func_sequencer(uint8_t param)
} }
} else if ( seq_menu == 2) } else if ( seq_menu == 2)
{ {
if (seq_active_function != 2) seq_active_function = 2; else seq_active_function = 99; 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) if (activesample < NUM_DRUMSET_CONFIG - 1)
@ -4380,7 +4514,7 @@ void UI_func_sequencer(uint8_t param)
lcd.print( (temp_int / 12) - 1); lcd.print( (temp_int / 12) - 1);
} }
} }
} else if (seq_menu > 2) } else if (seq_menu > 2 && seq_menu < 30)
{ {
if (seq_active_function == 99) { if (seq_active_function == 99) {
if (seq_content_type[seq_active_track] == 0) { //Drumtrack if (seq_content_type[seq_active_track] == 0) { //Drumtrack
@ -4405,7 +4539,72 @@ void UI_func_sequencer(uint8_t param)
} }
//button check end <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< //button check end <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
if (seq_menu == 0) { 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_temp_active_menu == 0) lcd.print(" 1/4");
else if (seq_temp_active_menu == 1) lcd.print(" 1/8");
else if (seq_temp_active_menu == 2) lcd.print("1/16");
} else if (seq_menu == 32 ) { //fill pattern
if (seq_content_type[seq_active_track] == 0) { //inst
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_temp_select_menu].name));
lcd.setCursor(11, 1);
if (seq_temp_active_menu == 0) lcd.print(" 1/4");
else if (seq_temp_active_menu == 1) lcd.print(" 1/8");
else if (seq_temp_active_menu == 2) lcd.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_temp_select_menu % 12 ]);
lcd.print( (seq_temp_select_menu / 12) - 1);
lcd.print(" ");
lcd.setCursor(9, 1);
lcd.print("]");
lcd.setCursor(11, 1);
if (seq_temp_active_menu == 0) lcd.print(" 1/4");
else if (seq_temp_active_menu == 1) lcd.print(" 1/8");
else if (seq_temp_active_menu == 2) lcd.print("1/16");
}
} else if (seq_menu == 31) { //copy pattern
lcd.setCursor(13, 0);
lcd.print("[");
lcd.setCursor(15, 0);
lcd.print("]");
lcd.setCursor(0, 1);
lcd.print(" to: [ ]");
lcd.setCursor(14, 1);
lcd.print(temp_int);
} else if (seq_menu == 30) { //swap pattern
lcd.setCursor(13, 0);
lcd.print("[");
lcd.setCursor(15, 0);
lcd.print("]");
lcd.setCursor(0, 1);
lcd.print(" with: [ ]");
lcd.setCursor(14, 1);
lcd.print(temp_int);
} else if (seq_menu == 0) {
lcd.setCursor(8, 0); lcd.setCursor(8, 0);
lcd.print(" "); lcd.print(" ");
lcd.setCursor(12, 0); lcd.setCursor(12, 0);
@ -4421,11 +4620,23 @@ void UI_func_sequencer(uint8_t param)
lcd.print("EMPTY "); lcd.print("EMPTY ");
} else if (activesample == NUM_DRUMSET_CONFIG ) { } else if (activesample == NUM_DRUMSET_CONFIG ) {
lcd.setCursor(1, 0); lcd.setCursor(1, 0);
lcd.print("ClrTrk"); lcd.print("ClrPat");
} else if (activesample == NUM_DRUMSET_CONFIG + 1) { } else if (activesample == NUM_DRUMSET_CONFIG + 1) {
lcd.setCursor(1, 0); lcd.setCursor(1, 0);
lcd.print("ClrAll"); lcd.print("ClrAll");
} }
else if (activesample == NUM_DRUMSET_CONFIG + 2) {
lcd.setCursor(1, 0);
lcd.print("Copy P");
}
else if (activesample == NUM_DRUMSET_CONFIG + 3) {
lcd.setCursor(1, 0);
lcd.print("Swap P");
}
else if (activesample == NUM_DRUMSET_CONFIG + 4) {
lcd.setCursor(1, 0);
lcd.print("Fill P");
}
lcd.setCursor(7, 0); lcd.setCursor(7, 0);
lcd.print("]"); lcd.print("]");
} else //Inst. Mode } else //Inst. Mode
@ -4441,10 +4652,20 @@ void UI_func_sequencer(uint8_t param)
lcd.print("EMPTY "); lcd.print("EMPTY ");
} else if (temp_int == 110) { } else if (temp_int == 110) {
lcd.setCursor(1, 0); lcd.setCursor(1, 0);
lcd.print("ClrTrk"); lcd.print("ClrPat");
} else if (temp_int == 111) { } else if (temp_int == 111) {
lcd.setCursor(1, 0); lcd.setCursor(1, 0);
lcd.print("ClrAll"); lcd.print("ClrAll");
} else if (temp_int == 112) {
lcd.setCursor(1, 0);
lcd.print("Copy P");
} else if (temp_int == 113) {
lcd.setCursor(1, 0);
lcd.print("Swap P");
}
else if (temp_int == 114) {
lcd.setCursor(1, 0);
lcd.print("Fill P");
} }
lcd.setCursor(7, 0); lcd.setCursor(7, 0);
lcd.print("]"); lcd.print("]");
@ -4462,19 +4683,7 @@ void UI_func_sequencer(uint8_t param)
lcd.setCursor(8, 0); lcd.setCursor(8, 0);
lcd.print("["); lcd.print("[");
lcd.setCursor(9, 0); lcd.setCursor(9, 0);
seq_refresh_display_play_status();
if (seq_running == false && seq_recording == false)
{
lcd.print("PLY");
} else if (seq_running == true && seq_recording == false)
{
seq_note_in = 0;
lcd.print("REC");
} else if (seq_running == true && seq_recording == true)
{
seq_note_in = 0;
lcd.print("STP");
}
lcd.setCursor(12, 0); lcd.setCursor(12, 0);
lcd.print("]"); lcd.print("]");
} }
@ -4490,10 +4699,7 @@ void UI_func_sequencer(uint8_t param)
lcd.setCursor(15, 0); lcd.setCursor(15, 0);
lcd.print("]"); lcd.print("]");
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
for (int i = 0; i < 16; i++) { seq_printAllSeqSteps();
lcd.setCursor(i, 1);
lcd.print(seq_find_shortname(i)[0]);
}
} }
if (seq_menu == 3) { if (seq_menu == 3) {
lcd.setCursor(15, 0); lcd.setCursor(15, 0);
@ -4505,7 +4711,7 @@ void UI_func_sequencer(uint8_t param)
lcd.setCursor(1, 1); lcd.setCursor(1, 1);
lcd.print(seq_find_shortname(1)[0]); lcd.print(seq_find_shortname(1)[0]);
} }
if (seq_menu > 3) { if (seq_menu > 3 && seq_menu < 30) {
lcd.setCursor(seq_menu - 3, 1); lcd.setCursor(seq_menu - 3, 1);
lcd.print("x"); lcd.print("x");
lcd.setCursor(seq_menu - 4, 1); lcd.setCursor(seq_menu - 4, 1);
@ -4517,7 +4723,8 @@ void UI_func_sequencer(uint8_t param)
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
seq_menu = 0;
seq_active_function = 99;
// seq_running = false; // seq_running = false;
// seq_recording = false; // seq_recording = false;
// seq_note_in = 0; // seq_note_in = 0;

Loading…
Cancel
Save