From f7c6b04d48f7f24a9a640bd6a6df9b366665896a Mon Sep 17 00:00:00 2001 From: midilab Date: Fri, 9 Mar 2018 14:44:25 -0300 Subject: [PATCH] AcidStepSequencer: hotfix for note_stack managment + UI step length realtime setup. --- examples/AcidStepSequencer/AcidStepSequencer.ino | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/AcidStepSequencer/AcidStepSequencer.ino b/examples/AcidStepSequencer/AcidStepSequencer.ino index eeb30a5..7a9f41f 100644 --- a/examples/AcidStepSequencer/AcidStepSequencer.ino +++ b/examples/AcidStepSequencer/AcidStepSequencer.ino @@ -123,7 +123,7 @@ void ClockOut16PPQN(uint32_t * tick) if ( _note_stack[i].length == -1 ) { _note_stack[i].note = _sequencer[_step].note; _note_stack[i].length = length; - break; + return; } } } @@ -172,6 +172,7 @@ void onClockStop() Serial.write(MIDI_STOP); for ( uint8_t i = 0; i < NOTE_STACK_SIZE; i++ ) { sendMidiMessage(NOTE_OFF, _note_stack[i].note, 0); + _note_stack[i].length = -1; } _playing = false; } @@ -372,12 +373,13 @@ void processPots() if ( _step_edit >= _step_length ) { _step_edit = _step_length-1; } - if ( _step >= _step_length ) { + //if ( _step >= _step_length ) { // send stack note off for ( uint8_t i = 0; i < NOTE_STACK_SIZE; i++ ) { sendMidiMessage(NOTE_OFF, _note_stack[i].note, 0); + _note_stack[i].length = -1; } - } + //} } tempo = getPotChanges(TEMPO_POT_PIN, SEQUENCER_MIN_BPM, SEQUENCER_MAX_BPM);