|
|
@ -66,6 +66,7 @@ extern char receive_bank_filename[FILENAME_LEN]; |
|
|
|
extern uint8_t seqdata[3][16]; |
|
|
|
extern uint8_t seqdata[3][16]; |
|
|
|
extern uint8_t seqsteptimer; |
|
|
|
extern uint8_t seqsteptimer; |
|
|
|
extern bool seq_running; |
|
|
|
extern bool seq_running; |
|
|
|
|
|
|
|
extern bool seq_recording; |
|
|
|
uint8_t seq_active_function = 99; |
|
|
|
uint8_t seq_active_function = 99; |
|
|
|
uint8_t activesample; |
|
|
|
uint8_t activesample; |
|
|
|
#if NUM_DRUMS > 0 |
|
|
|
#if NUM_DRUMS > 0 |
|
|
@ -638,7 +639,7 @@ void lcdml_menu_control(void) |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
encoderDir[ENC_R].ButtonShort(true); |
|
|
|
encoderDir[ENC_R].ButtonShort(true); |
|
|
|
seq_button_r = true; |
|
|
|
seq_button_r = true; |
|
|
|
//nexus
|
|
|
|
|
|
|
|
LCDML.BT_enter(); |
|
|
|
LCDML.BT_enter(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -3533,47 +3534,59 @@ void UI_handle_OP(uint8_t param) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const char* seq_find_shortname(uint8_t seqstep) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
const char* shortname = " "; |
|
|
|
|
|
|
|
bool found = false; |
|
|
|
|
|
|
|
for (uint8_t d = 0; d < NUM_DRUMCONFIG - 1; d++) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (seqdata[active_seq_track][seqstep] == drum_config[d].midinote) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
shortname = drum_config[d].shortname; |
|
|
|
|
|
|
|
found = true; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (found == false) shortname = "-"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return shortname; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UI_func_sequencer(uint8_t param) |
|
|
|
void UI_func_sequencer(uint8_t param) |
|
|
|
{ |
|
|
|
{ |
|
|
|
bool foundsound = false; |
|
|
|
|
|
|
|
char displayname[9]; |
|
|
|
char displayname[9]; |
|
|
|
|
|
|
|
|
|
|
|
if (LCDML.FUNC_setup()) // ****** SETUP *********
|
|
|
|
if (LCDML.FUNC_setup()) // ****** SETUP *********
|
|
|
|
{ |
|
|
|
{ |
|
|
|
encoderDir[ENC_R].reset(); |
|
|
|
encoderDir[ENC_R].reset(); |
|
|
|
seq_button_r = false; |
|
|
|
seq_button_r = false; |
|
|
|
|
|
|
|
seq_note_in = 0; |
|
|
|
// setup function
|
|
|
|
// setup function
|
|
|
|
lcd.setCursor(1, 0); |
|
|
|
lcd.setCursor(1, 0); |
|
|
|
strcpy(displayname, drum_config[activesample].filename); |
|
|
|
strncpy(displayname, drum_config[activesample].filename + 5, 6); |
|
|
|
lcd.print(*displayname + 5); |
|
|
|
lcd.print(displayname); |
|
|
|
lcd.setCursor(8, 0); |
|
|
|
|
|
|
|
lcd.print("["); |
|
|
|
|
|
|
|
lcd.setCursor(9, 0); |
|
|
|
lcd.setCursor(9, 0); |
|
|
|
if (seq_running) |
|
|
|
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.print("STP"); |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
|
|
|
|
lcd.print("RUN"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
lcd.setCursor(12, 0); |
|
|
|
|
|
|
|
lcd.print("]"); |
|
|
|
|
|
|
|
lcd.setCursor(14, 0); |
|
|
|
lcd.setCursor(14, 0); |
|
|
|
lcd.print(active_seq_track + 1); |
|
|
|
lcd.print(active_seq_track + 1); |
|
|
|
lcd.setCursor(10, 0); |
|
|
|
lcd.setCursor(10, 0); |
|
|
|
for (int i = 0; i < 16; i++) { |
|
|
|
for (int i = 0; i < 16; i++) { |
|
|
|
lcd.setCursor(i, 1); |
|
|
|
lcd.setCursor(i, 1); |
|
|
|
for (uint8_t d = 0; d < NUM_DRUMCONFIG - 1; d++) |
|
|
|
lcd.print(seq_find_shortname(i) ); |
|
|
|
{ |
|
|
|
|
|
|
|
if (seqdata[active_seq_track][i] == drum_config[d].midinote) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
lcd.print(drum_config[d].shortname ); //one letter name of Category
|
|
|
|
|
|
|
|
foundsound = true; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (foundsound == false)lcd.print("-"); |
|
|
|
|
|
|
|
foundsound = false; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (LCDML.FUNC_loop()) // ****** LOOP *********
|
|
|
|
if (LCDML.FUNC_loop()) // ****** LOOP *********
|
|
|
@ -3591,9 +3604,9 @@ void UI_func_sequencer(uint8_t param) |
|
|
|
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_DRUMCONFIG - 1 ); |
|
|
|
activesample = constrain(activesample + 1, 0, NUM_DRUMCONFIG + 2 ); |
|
|
|
else if (LCDML.BT_checkUp()) |
|
|
|
else if (LCDML.BT_checkUp()) |
|
|
|
activesample = constrain(activesample - 1, 0, NUM_DRUMCONFIG - 1 ); |
|
|
|
activesample = constrain(activesample - 1, 0, NUM_DRUMCONFIG + 2 ); |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (seq_active_function == 2) { |
|
|
|
} 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())) |
|
|
@ -3612,25 +3625,52 @@ void UI_func_sequencer(uint8_t param) |
|
|
|
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 (activesample == NUM_DRUMCONFIG + 2) { |
|
|
|
|
|
|
|
memset(seqdata[0], 0, sizeof(seqdata[0])); |
|
|
|
|
|
|
|
memset(seqdata[1], 0, sizeof(seqdata[1])); |
|
|
|
|
|
|
|
memset(seqdata[2], 0, sizeof(seqdata[2])); |
|
|
|
|
|
|
|
for (int i = 0; i < 16; i++) { |
|
|
|
|
|
|
|
lcd.setCursor(i, 1); |
|
|
|
|
|
|
|
lcd.print(seq_find_shortname(i) ); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else if (activesample == NUM_DRUMCONFIG + 1) { |
|
|
|
|
|
|
|
memset(seqdata[active_seq_track], 0, sizeof(seqdata[active_seq_track])); |
|
|
|
|
|
|
|
for (int i = 0; i < 16; i++) { |
|
|
|
|
|
|
|
lcd.setCursor(i, 1); |
|
|
|
|
|
|
|
lcd.print(seq_find_shortname(i) ); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
seq_active_function = 99; |
|
|
|
seq_active_function = 99; |
|
|
|
} |
|
|
|
} |
|
|
|
if ( seq_menu == 1) |
|
|
|
if ( seq_menu == 1) |
|
|
|
{ |
|
|
|
{ |
|
|
|
lcd.setCursor(9, 0); |
|
|
|
lcd.setCursor(9, 0); |
|
|
|
if (seq_running == true) |
|
|
|
|
|
|
|
|
|
|
|
if (seq_running == false && seq_recording == false) |
|
|
|
{ |
|
|
|
{ |
|
|
|
seq_running = false; |
|
|
|
seq_running = true; |
|
|
|
lcd.print("RUN"); |
|
|
|
lcd.print("REC"); |
|
|
|
} else |
|
|
|
} else |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (seq_running == true && seq_recording == false) |
|
|
|
{ |
|
|
|
{ |
|
|
|
seq_running = true; |
|
|
|
seq_running = true; |
|
|
|
|
|
|
|
seq_recording = true; |
|
|
|
|
|
|
|
seq_note_in = 0; |
|
|
|
lcd.print("STP"); |
|
|
|
lcd.print("STP"); |
|
|
|
|
|
|
|
} else if (seq_running == true && seq_recording == true) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
seq_running = false; |
|
|
|
|
|
|
|
seq_recording = false; |
|
|
|
|
|
|
|
seq_note_in = 0; |
|
|
|
|
|
|
|
lcd.print("PLY"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} 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; |
|
|
|
} |
|
|
|
} else if (seq_menu > 2) |
|
|
|
if (seq_menu > 2) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
if (seq_active_function == 99) { |
|
|
|
if (seq_active_function == 99) { |
|
|
|
seqdata[active_seq_track][seq_menu - 3] = drum_config[activesample].midinote; |
|
|
|
seqdata[active_seq_track][seq_menu - 3] = drum_config[activesample].midinote; |
|
|
@ -3647,9 +3687,21 @@ void UI_func_sequencer(uint8_t param) |
|
|
|
lcd.print(" "); |
|
|
|
lcd.print(" "); |
|
|
|
lcd.setCursor(0, 0); |
|
|
|
lcd.setCursor(0, 0); |
|
|
|
lcd.print("["); |
|
|
|
lcd.print("["); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (activesample < NUM_DRUMCONFIG) { |
|
|
|
lcd.setCursor(1, 0); |
|
|
|
lcd.setCursor(1, 0); |
|
|
|
strcpy(displayname, drum_config[activesample].filename); |
|
|
|
strncpy(displayname, drum_config[activesample].filename + 5, 6); |
|
|
|
lcd.print(*displayname + 5); |
|
|
|
lcd.print(displayname); |
|
|
|
|
|
|
|
} else if (activesample == NUM_DRUMCONFIG) { |
|
|
|
|
|
|
|
lcd.setCursor(1, 0); |
|
|
|
|
|
|
|
lcd.print("EMPTY "); |
|
|
|
|
|
|
|
} else if (activesample == NUM_DRUMCONFIG + 1) { |
|
|
|
|
|
|
|
lcd.setCursor(1, 0); |
|
|
|
|
|
|
|
lcd.print("ClrTrk"); |
|
|
|
|
|
|
|
} else if (activesample == NUM_DRUMCONFIG + 2) { |
|
|
|
|
|
|
|
lcd.setCursor(1, 0); |
|
|
|
|
|
|
|
lcd.print("ClrAll"); |
|
|
|
|
|
|
|
} |
|
|
|
lcd.setCursor(7, 0); |
|
|
|
lcd.setCursor(7, 0); |
|
|
|
lcd.print("]"); |
|
|
|
lcd.print("]"); |
|
|
|
} |
|
|
|
} |
|
|
@ -3665,13 +3717,19 @@ 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); |
|
|
|
if (seq_running) |
|
|
|
|
|
|
|
|
|
|
|
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.print("STP"); |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
|
|
|
|
lcd.print("RUN"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
lcd.setCursor(12, 0); |
|
|
|
lcd.setCursor(12, 0); |
|
|
|
lcd.print("]"); |
|
|
|
lcd.print("]"); |
|
|
|
} |
|
|
|
} |
|
|
@ -3689,17 +3747,7 @@ void UI_func_sequencer(uint8_t param) |
|
|
|
lcd.setCursor(0, 1); |
|
|
|
lcd.setCursor(0, 1); |
|
|
|
for (int i = 0; i < 16; i++) { |
|
|
|
for (int i = 0; i < 16; i++) { |
|
|
|
lcd.setCursor(i, 1); |
|
|
|
lcd.setCursor(i, 1); |
|
|
|
for (uint8_t d = 0; d < NUM_DRUMCONFIG - 1; d++) |
|
|
|
lcd.print(seq_find_shortname(i) ); |
|
|
|
{ |
|
|
|
|
|
|
|
if (seqdata[active_seq_track][i] == drum_config[d].midinote) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
lcd.print(drum_config[d].shortname ); //one letter name of Category
|
|
|
|
|
|
|
|
foundsound = true; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (foundsound == false)lcd.print("-"); |
|
|
|
|
|
|
|
foundsound = false; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (seq_menu == 3) { |
|
|
|
if (seq_menu == 3) { |
|
|
@ -3710,45 +3758,16 @@ void UI_func_sequencer(uint8_t param) |
|
|
|
lcd.setCursor(0, 1); |
|
|
|
lcd.setCursor(0, 1); |
|
|
|
lcd.print("x"); |
|
|
|
lcd.print("x"); |
|
|
|
lcd.setCursor(1, 1); |
|
|
|
lcd.setCursor(1, 1); |
|
|
|
for (uint8_t d = 0; d < NUM_DRUMCONFIG - 1; d++) |
|
|
|
lcd.print(seq_find_shortname(1) ); |
|
|
|
{ |
|
|
|
|
|
|
|
if (seqdata[active_seq_track][1] == drum_config[d].midinote) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
lcd.print(drum_config[d].shortname ); //one letter name of Category
|
|
|
|
|
|
|
|
foundsound = true; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (foundsound == false) lcd.print("-"); |
|
|
|
|
|
|
|
foundsound = false; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
if (seq_menu > 3) { |
|
|
|
if (seq_menu > 3) { |
|
|
|
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); |
|
|
|
for (uint8_t d = 0; d < NUM_DRUMCONFIG - 1; d++) |
|
|
|
lcd.print(seq_find_shortname(seq_menu - 4) ); |
|
|
|
{ |
|
|
|
|
|
|
|
if (seqdata[active_seq_track][seq_menu - 4] == drum_config[d].midinote) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
lcd.print(drum_config[d].shortname ); //one letter name of Category
|
|
|
|
|
|
|
|
foundsound = true; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (foundsound == false) lcd.print("-"); |
|
|
|
|
|
|
|
foundsound = false; |
|
|
|
|
|
|
|
lcd.setCursor(seq_menu - 2, 1); |
|
|
|
lcd.setCursor(seq_menu - 2, 1); |
|
|
|
for (uint8_t d = 0; d < NUM_DRUMCONFIG - 1; d++) |
|
|
|
lcd.print(seq_find_shortname(seq_menu - 2) ); |
|
|
|
{ |
|
|
|
|
|
|
|
if (seqdata[active_seq_track][seq_menu - 2] == drum_config[d].midinote) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
lcd.print(drum_config[d].shortname ); //one letter name of Category
|
|
|
|
|
|
|
|
foundsound = true; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (foundsound == false) lcd.print("-"); |
|
|
|
|
|
|
|
foundsound = false; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (LCDML.FUNC_close()) // ****** STABLE END *********
|
|
|
|
if (LCDML.FUNC_close()) // ****** STABLE END *********
|
|
|
|