Merge pull request 'Chords for Sequencer' (#68) from positionhigh/MicroDexed:dev into dev

Reviewed-on: https://codeberg.org/dcoredump/MicroDexed/pulls/68
pull/76/head
Holger Wirtz 3 years ago
commit 82d9c7f770
  1. 34
      UI.hpp
  2. 2
      UI_FX.h
  3. 2
      UI_FX_T4.h
  4. 2
      drums.h
  5. 52
      sequencer.cpp

@ -4144,7 +4144,7 @@ void UI_func_seq_vel_editor(uint8_t param)
seq_active_track = constrain(seq_active_track - 1, 0, 9); seq_active_track = constrain(seq_active_track - 1, 0, 9);
} }
} }
else if (seq_active_function == 1) { 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 ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()))
{ {
if (LCDML.BT_checkDown()) if (LCDML.BT_checkDown())
@ -4152,6 +4152,14 @@ void UI_func_seq_vel_editor(uint8_t param)
else if (LCDML.BT_checkUp()) 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); 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 ) {
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);
}
} }
if (LCDML.BT_checkEnter()) //handle button presses during menu >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> if (LCDML.BT_checkEnter()) //handle button presses during menu >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
{ {
@ -4171,6 +4179,8 @@ void UI_func_seq_vel_editor(uint8_t param)
} }
//button check end <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< //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) { if (seq_menu == 0) {
lcd.setCursor(4, 0); lcd.setCursor(4, 0);
lcd.print("--- --- "); lcd.print("--- --- ");
@ -4212,12 +4222,24 @@ void UI_func_seq_vel_editor(uint8_t param)
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]) );
} else } else
{ {
lcd.print(noteNames[seq_data[seq_active_track][seq_menu - 1] % 12 ][0] ); if (seq_content_type[seq_active_track] < 2)
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(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(" ");
}
else {
if (seq_vel[seq_active_track][seq_menu - 1] == 200) lcd.print("Maj" );
else if (seq_vel[seq_active_track][seq_menu - 1] == 201) lcd.print("Min" );
else if (seq_vel[seq_active_track][seq_menu - 1] == 202) lcd.print("Sev" );
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("Mj7" );
} }
lcd.print( (seq_data[seq_active_track][seq_menu - 1] / 12) - 1);
lcd.print(" ");
} }
} }
else else

@ -119,7 +119,7 @@ LCDML_add(85, LCDML_0_4, 3, "Drum Pan", UI_func_drum_pan);
LCDML_add(86, LCDML_0_4, 4, "Drum Rev.Send", UI_func_drum_reverb_send); LCDML_add(86, LCDML_0_4, 4, "Drum Rev.Send", UI_func_drum_reverb_send);
LCDML_add(87, LCDML_0, 5, "Sequencer", NULL); LCDML_add(87, LCDML_0, 5, "Sequencer", NULL);
LCDML_add(88, LCDML_0_5, 1, "Sequencer", UI_func_sequencer); LCDML_add(88, LCDML_0_5, 1, "Sequencer", UI_func_sequencer);
LCDML_add(89, LCDML_0_5, 2, "Velocity Edit", UI_func_seq_vel_editor); LCDML_add(89, LCDML_0_5, 2, "Vel./Chrd Edit", UI_func_seq_vel_editor);
LCDML_add(90, LCDML_0_5, 3, "Pattern Chain", UI_func_seq_pat_chain); LCDML_add(90, LCDML_0_5, 3, "Pattern Chain", UI_func_seq_pat_chain);
LCDML_add(91, LCDML_0_5, 4, "Seq. Length", UI_func_seq_lenght); LCDML_add(91, LCDML_0_5, 4, "Seq. Length", UI_func_seq_lenght);
LCDML_add(92, LCDML_0_5, 5, "Tempo", UI_func_seq_tempo); LCDML_add(92, LCDML_0_5, 5, "Tempo", UI_func_seq_tempo);

@ -122,7 +122,7 @@ LCDML_add(88, LCDML_0_4, 3, "Drum Pan", UI_func_drum_pan);
LCDML_add(89, LCDML_0_4, 4, "Drum Rev.Send", UI_func_drum_reverb_send); LCDML_add(89, LCDML_0_4, 4, "Drum Rev.Send", UI_func_drum_reverb_send);
LCDML_add(90, LCDML_0, 5, "Sequencer", NULL); LCDML_add(90, LCDML_0, 5, "Sequencer", NULL);
LCDML_add(91, LCDML_0_5, 1, "Sequencer", UI_func_sequencer); LCDML_add(91, LCDML_0_5, 1, "Sequencer", UI_func_sequencer);
LCDML_add(92, LCDML_0_5, 2, "Velocity Edit", UI_func_seq_vel_editor); LCDML_add(92, LCDML_0_5, 2, "Vel./Chrd Edit", UI_func_seq_vel_editor);
LCDML_add(93, LCDML_0_5, 3, "Pattern Chain", UI_func_seq_pat_chain); LCDML_add(93, LCDML_0_5, 3, "Pattern Chain", UI_func_seq_pat_chain);
LCDML_add(94, LCDML_0_5, 4, "Seq. Length", UI_func_seq_lenght); LCDML_add(94, LCDML_0_5, 4, "Seq. Length", UI_func_seq_lenght);
LCDML_add(95, LCDML_0_5, 5, "Tempo", UI_func_seq_tempo); LCDML_add(95, LCDML_0_5, 5, "Tempo", UI_func_seq_tempo);

@ -176,7 +176,7 @@ drum_config_t drum_config[NUM_DRUMSET_CONFIG] =
"phkick1", "phkick1",
AudioSamplePhkick1, AudioSamplePhkick1,
"B", "B",
-1.0, 0.0,
0.9, 0.9,
0.0, 0.0,
0.0 0.0

@ -12,26 +12,18 @@ extern void handleNoteOff(byte , byte , byte );
extern void UI_func_sequencer(uint8_t); extern void UI_func_sequencer(uint8_t);
extern const char* seq_find_shortname(uint8_t); extern const char* seq_find_shortname(uint8_t);
void sequencer(void) void sequencer(void)
{ {
//if (seq_note_in > 0 && seq_note_in < 62 && seq_recording == false ) {
//handleNoteOff(configuration.dexed[0].midi_channel, seq_data[3][seq_step] + seq_transpose , 0);
if (seq_note_in > 0 && seq_note_in < 62 && seq_recording == false ) { //handleNoteOff(configuration.dexed[0].midi_channel, seq_data[3][seq_step - 1] + seq_transpose , 0);
// handleNoteOff(configuration.dexed[0].midi_channel, seq_data[3][seq_step] + seq_transpose , 0); //if (seq_note_in>65)seq_note_in=seq_note_in-12;
// handleNoteOff(configuration.dexed[0].midi_channel, seq_data[3][seq_step - 1] + seq_transpose , 0); //seq_transpose = seq_note_in % 12 ;
//seq_transpose=seq_transpose-12;
//if (seq_note_in>65)seq_note_in=seq_note_in-12; //seq_note_in = 0;
//}
// seq_transpose = seq_note_in % 12 ;
//seq_transpose=seq_transpose-12;
// seq_note_in = 0;
}
if (seq_millis_timer > seq_timer_previous + seq_tempo_ms) if (seq_millis_timer > seq_timer_previous + seq_tempo_ms)
{ {
seq_timer_previous = seq_millis_timer; seq_timer_previous = seq_millis_timer;
@ -71,8 +63,18 @@ void sequencer(void)
else { else {
if (seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] > 0 && seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step] > 0) // instrument track if (seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] > 0 && seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step] > 0) // instrument track
{ {
handleNoteOn(configuration.dexed[0].midi_channel, seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] + seq_transpose , seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step]); handleNoteOn(configuration.dexed[seq_inst_dexed[d]].midi_channel, seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] + seq_transpose , seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step]);
seq_prev_note[d] = seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] + seq_transpose; seq_prev_note[d] = seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] + seq_transpose;
seq_prev_vel[d] = seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step];
if (seq_track_type[d] == 2) {
if (seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step] > 199)
{
handleNoteOn(configuration.dexed[seq_chord_ch].midi_channel, seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] + seq_transpose + seq_chords[seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step] - 200][0], seq_chord_velocity);
handleNoteOn(configuration.dexed[seq_chord_ch].midi_channel, seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] + seq_transpose + seq_chords[seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step] - 200][1], seq_chord_velocity);
handleNoteOn(configuration.dexed[seq_chord_ch].midi_channel, seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] + seq_transpose + seq_chords[seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step] - 200][2], seq_chord_velocity);
handleNoteOn(configuration.dexed[seq_chord_ch].midi_channel, seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] + seq_transpose + seq_chords[seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step] - 200][3], seq_chord_velocity);
}
}
} }
} }
seq_noteoffsent[d] = false; seq_noteoffsent[d] = false;
@ -91,19 +93,27 @@ void sequencer(void)
} }
} }
} }
if (seq_millis_timer > seq_timer_previous + 80 ) if (seq_millis_timer > seq_timer_previous + 80 )
{ {
for (uint8_t d = 0; d < 4; d++) for (uint8_t d = 0; d < 4; d++)
{ {
if ( seq_noteoffsent[d] == false) { if ( seq_noteoffsent[d] == false) {
if ( seq_prev_note[d] > 0) //test instrument sequencer Instance=0 if ( seq_prev_note[d] > 0 && seq_track_type[d] > 0) //test instrument sequencer Instance=0
{ {
handleNoteOff(configuration.dexed[0].midi_channel, seq_prev_note[d] , 0); handleNoteOff(configuration.dexed[seq_inst_dexed[d]].midi_channel, seq_prev_note[d] , 0);
if (seq_track_type[d] == 2) {
if ( seq_prev_vel[d] > 199) {
handleNoteOff(configuration.dexed[seq_chord_ch].midi_channel, seq_prev_note[d] + seq_chords[seq_prev_vel[d] - 200][0], 0);
handleNoteOff(configuration.dexed[seq_chord_ch].midi_channel, seq_prev_note[d] + seq_chords[seq_prev_vel[d] - 200][1] , 0);
handleNoteOff(configuration.dexed[seq_chord_ch].midi_channel, seq_prev_note[d] + seq_chords[seq_prev_vel[d] - 200][2] , 0);
handleNoteOff(configuration.dexed[seq_chord_ch].midi_channel, seq_prev_note[d] + seq_chords[seq_prev_vel[d] - 200][3] , 0);
}
}
} }
} }
seq_noteoffsent[d] = true; seq_noteoffsent[d] = true;
} }
} }
} }

Loading…
Cancel
Save