|
|
@ -46,11 +46,14 @@ void sequencer_part1(void) |
|
|
|
if (seq_data[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 ) // instrument track
|
|
|
|
{ |
|
|
|
{ |
|
|
|
if (seq_track_type[d] == 1 || (seq_track_type[d] == 3 && arp_play_basenote) ) |
|
|
|
if (seq_track_type[d] == 1 || (seq_track_type[d] == 3 && arp_play_basenote) ) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (seq_data[seq_patternchain[seq_chain_active_step][d]][seq_step] != 130 ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
handleNoteOn(configuration.dexed[seq_inst_dexed[d]].midi_channel, seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step], 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_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_prev_note[d] = seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step]; |
|
|
|
seq_prev_vel[d] = seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step]; |
|
|
|
seq_prev_vel[d] = seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
else if (seq_track_type[d] == 2 ) //Chords
|
|
|
|
else if (seq_track_type[d] == 2 ) //Chords
|
|
|
|
{ |
|
|
|
{ |
|
|
|
if (seq_vel[ seq_patternchain[seq_chain_active_step][d]][seq_step] > 199) |
|
|
|
if (seq_vel[ seq_patternchain[seq_chain_active_step][d]][seq_step] > 199) |
|
|
@ -69,9 +72,7 @@ void sequencer_part1(void) |
|
|
|
if (seq_track_type[d] == 3) { //Arp
|
|
|
|
if (seq_track_type[d] == 3) { //Arp
|
|
|
|
arp_step = 0; |
|
|
|
arp_step = 0; |
|
|
|
arp_counter = 0; |
|
|
|
arp_counter = 0; |
|
|
|
|
|
|
|
|
|
|
|
arp_note = seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] + (seq_oct_shift * 12); |
|
|
|
arp_note = seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] + (seq_oct_shift * 12); |
|
|
|
// if (seq_vel[seq_patternchain[seq_chain_active_step][d] ][seq_step] - 200 >= 0)
|
|
|
|
|
|
|
|
arp_chord = seq_vel[seq_patternchain[seq_chain_active_step][d] ][seq_step] - 200; |
|
|
|
arp_chord = seq_vel[seq_patternchain[seq_chain_active_step][d] ][seq_step] - 200; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -164,26 +165,30 @@ void sequencer_part2(void) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (seq_noteoffsent[d] == false) { |
|
|
|
if (seq_noteoffsent[d] == false) { |
|
|
|
if ( seq_prev_note[d] > 0 && seq_track_type[d] > 0) |
|
|
|
if ( seq_prev_note[d] > 0 && seq_track_type[d] > 0) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (seq_data[ seq_patternchain[seq_chain_active_step][d] ][seq_step] != 130) |
|
|
|
{ |
|
|
|
{ |
|
|
|
handleNoteOff(configuration.dexed[seq_inst_dexed[d]].midi_channel, seq_prev_note[d] , 0); |
|
|
|
handleNoteOff(configuration.dexed[seq_inst_dexed[d]].midi_channel, seq_prev_note[d] , 0); |
|
|
|
|
|
|
|
seq_noteoffsent[d] = true; |
|
|
|
|
|
|
|
} |
|
|
|
if (seq_track_type[d] == 2) { //Chords
|
|
|
|
if (seq_track_type[d] == 2) { //Chords
|
|
|
|
if ( seq_prev_vel[d] > 199) { |
|
|
|
if ( seq_prev_vel[d] > 199) { |
|
|
|
for (uint8_t x = seq_element_shift; x < seq_element_shift + seq_chord_key_ammount; x++) //play chord notes
|
|
|
|
for (uint8_t x = seq_element_shift; x < seq_element_shift + seq_chord_key_ammount; x++) //play chord notes
|
|
|
|
{ |
|
|
|
{ |
|
|
|
handleNoteOff(configuration.dexed[seq_chord_dexed_inst].midi_channel, seq_prev_note[d] + seq_arps[seq_prev_vel[d] - 200][x], 0); |
|
|
|
handleNoteOff(configuration.dexed[seq_chord_dexed_inst].midi_channel, seq_prev_note[d] + seq_arps[seq_prev_vel[d] - 200][x], 0); |
|
|
|
|
|
|
|
seq_noteoffsent[d] = true; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else if (seq_track_type[d] == 3) |
|
|
|
else if (seq_track_type[d] == 3) |
|
|
|
{ //Arp
|
|
|
|
{ //Arp
|
|
|
|
handleNoteOff(configuration.dexed[seq_chord_dexed_inst].midi_channel, arp_note_prev, 0); |
|
|
|
handleNoteOff(configuration.dexed[seq_chord_dexed_inst].midi_channel, arp_note_prev, 0); |
|
|
|
|
|
|
|
seq_noteoffsent[d] = true; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
seq_noteoffsent[d] = true; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void sequencer(void) |
|
|
|
void sequencer(void) |
|
|
|
{ // Runs in Interrupt Timer. Switches between the Noteon and Noteoff Task, each cycle
|
|
|
|
{ // Runs in Interrupt Timer. Switches between the Noteon and Noteoff Task, each cycle
|
|
|
|
|
|
|
|
|
|
|
|