From 7bb3c034f3875bfbf74a80e974081bd51dc3d277 Mon Sep 17 00:00:00 2001 From: positionhigh Date: Mon, 23 Aug 2021 19:18:03 +0200 Subject: [PATCH] =?UTF-8?q?Dateien=20hochladen=20nach=20=E2=80=9E=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sequencer.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/sequencer.cpp b/sequencer.cpp index 2030609..45acf45 100644 --- a/sequencer.cpp +++ b/sequencer.cpp @@ -47,9 +47,12 @@ void sequencer_part1(void) { if (seq_track_type[d] == 1 || (seq_track_type[d] == 3 && arp_play_basenote) ) { - 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_vel[d] = seq_vel[ seq_patternchain[seq_chain_active_step][d] ][seq_step]; + 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]); + 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]; + } } else if (seq_track_type[d] == 2 ) //Chords { @@ -69,9 +72,7 @@ void sequencer_part1(void) if (seq_track_type[d] == 3) { //Arp arp_step = 0; arp_counter = 0; - 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; } } @@ -165,25 +166,29 @@ void sequencer_part2(void) if (seq_noteoffsent[d] == false) { if ( seq_prev_note[d] > 0 && seq_track_type[d] > 0) { - handleNoteOff(configuration.dexed[seq_inst_dexed[d]].midi_channel, seq_prev_note[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); + seq_noteoffsent[d] = true; + } if (seq_track_type[d] == 2) { //Chords 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 { 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) { //Arp handleNoteOff(configuration.dexed[seq_chord_dexed_inst].midi_channel, arp_note_prev, 0); + seq_noteoffsent[d] = true; } } - seq_noteoffsent[d] = true; } } } - void sequencer(void) { // Runs in Interrupt Timer. Switches between the Noteon and Noteoff Task, each cycle