Merge pull request 'UI fixes, improvements' (#100) from positionhigh/MicroDexed:dev into dev

Reviewed-on: https://codeberg.org/dcoredump/MicroDexed/pulls/100
pull/107/head
Holger Wirtz 3 years ago
commit e00a66f78c
  1. 13
      MicroDexed.ino
  2. 217
      UI.hpp
  3. 53
      UI_FX_T4.h
  4. 2
      config.h

@ -691,6 +691,19 @@ void loop()
lcd.print( seq_chord_names[arp_chord][2]);
lcd.print( seq_chord_names[arp_chord][3]);
}
else if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_drum_monitor)) // UI is in Drum Status Monitor
{
for (uint8_t i = 0; i < NUM_DRUMS; i++)
{
lcd.setCursor( i * 2, 1);
if (Drum[i]->isPlaying() ) {
lcd.write(49 + i);
} else
{
lcd.write(32);
}
}
}
}
}
// CONTROL-RATE-EVENT-HANDLING

217
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,21 +4667,56 @@ 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" );
@ -4641,7 +4727,10 @@ void UI_func_seq_vel_editor(uint8_t param)
}
}
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

@ -125,30 +125,31 @@ 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, 5, "Sequencer", NULL);
LCDML_add(96, LCDML_0_5, 1, "Pattern Editor", UI_func_seq_pattern_editor);
LCDML_add(97, LCDML_0_5, 2, "Vel./Chrd Edit", UI_func_seq_vel_editor);
LCDML_add(98, LCDML_0_5, 3, "Pattern Chain", UI_func_seq_pat_chain);
LCDML_add(99, LCDML_0_5, 4, "Arpeggio", UI_func_arpeggio);
LCDML_add(100, LCDML_0_5, 5, "Seq. Settings", NULL);
LCDML_add(101, LCDML_0_5_5, 1, "Tempo", UI_func_seq_tempo);
LCDML_add(102, LCDML_0_5_5, 2, "Seq. Length", UI_func_seq_lenght);
LCDML_add(103, LCDML_0_5_5, 3, "Track Setup", UI_func_seq_track_setup);
LCDML_add(104, LCDML_0_5_5, 4, "Seq.Disp.Style", UI_func_seq_display_style);
LCDML_add(105, LCDML_0_5_5, 5, "dexed assign", UI_func_dexed_assign);
LCDML_add(106, LCDML_0_5_5, 6, "shift&transp.", UI_func_arp_shift);
LCDML_add(107, LCDML_0_5_5, 7, "L.Transp.Key", UI_func_seq_live_transpose_oct);
LCDML_add(108, LCDML_0_5_5, 8, "ChordTrack Keys", UI_func_seq_chord_keys_ammount);
LCDML_add(109, LCDML_0_5_5, 9, "Smart Filter", UI_func_smart_filter);
LCDML_add(110, LCDML_0_5_5, 10, "Name Sequence", UI_func_set_sequence_name);
LCDML_add(111, LCDML_0_5, 6, "LOAD Seq.Data", UI_func_seq_state_load);
LCDML_add(112, LCDML_0_5, 7, "SAVE Seq.Data", UI_func_seq_state_save);
LCDML_add(113, LCDML_0, 6, "System", NULL);
LCDML_add(114, LCDML_0_6, 1, "Stereo/Mono", UI_func_stereo_mono);
LCDML_add(115, LCDML_0_6, 2, "MIDI Soft THRU", UI_func_midi_soft_thru);
LCDML_add(116, LCDML_0_6, 3, "Favorites", UI_func_favorites);
LCDML_add(117, LCDML_0_6, 4, "EEPROM Reset", UI_func_eeprom_reset);
LCDML_add(118, LCDML_0, 7, "Info", UI_func_information);
LCDML_addAdvanced(119, LCDML_0, 8, COND_hide, "Volume", UI_func_volume, 0, _LCDML_TYPE_default);
#define _LCDML_DISP_cnt 119
LCDML_add(95, LCDML_0_4, 8, "Drum Monitor", UI_func_drum_monitor);
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);
LCDML_add(99, LCDML_0_5, 3, "Pattern Chain", UI_func_seq_pat_chain);
LCDML_add(100, LCDML_0_5, 4, "Arpeggio", UI_func_arpeggio);
LCDML_add(101, LCDML_0_5, 5, "Seq. Settings", NULL);
LCDML_add(102, LCDML_0_5_5, 1, "Tempo", UI_func_seq_tempo);
LCDML_add(103, LCDML_0_5_5, 2, "Seq. Length", UI_func_seq_lenght);
LCDML_add(104, LCDML_0_5_5, 3, "Track Setup", UI_func_seq_track_setup);
LCDML_add(105, LCDML_0_5_5, 4, "Seq.Disp.Style", UI_func_seq_display_style);
LCDML_add(106, LCDML_0_5_5, 5, "dexed assign", UI_func_dexed_assign);
LCDML_add(107, LCDML_0_5_5, 6, "shift&transp.", UI_func_arp_shift);
LCDML_add(108, LCDML_0_5_5, 7, "L.Transp.Key", UI_func_seq_live_transpose_oct);
LCDML_add(109, LCDML_0_5_5, 8, "ChordTrack Keys", UI_func_seq_chord_keys_ammount);
LCDML_add(110, LCDML_0_5_5, 9, "Smart Filter", UI_func_smart_filter);
LCDML_add(111, LCDML_0_5_5, 10, "Name Sequence", UI_func_set_sequence_name);
LCDML_add(112, LCDML_0_5, 6, "LOAD Seq.Data", UI_func_seq_state_load);
LCDML_add(113, LCDML_0_5, 7, "SAVE Seq.Data", UI_func_seq_state_save);
LCDML_add(114, LCDML_0, 6, "System", NULL);
LCDML_add(115, LCDML_0_6, 1, "Stereo/Mono", UI_func_stereo_mono);
LCDML_add(116, LCDML_0_6, 2, "MIDI Soft THRU", UI_func_midi_soft_thru);
LCDML_add(117, LCDML_0_6, 3, "Favorites", UI_func_favorites);
LCDML_add(118, LCDML_0_6, 4, "EEPROM Reset", UI_func_eeprom_reset);
LCDML_add(119, LCDML_0, 7, "Info", UI_func_information);
LCDML_addAdvanced(120, LCDML_0, 8, COND_hide, "Volume", UI_func_volume, 0, _LCDML_TYPE_default);
#define _LCDML_DISP_cnt 120
#endif

@ -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

Loading…
Cancel
Save