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