From 21ba99d38ec9bcf6789910689f7f55a5b0e02e09 Mon Sep 17 00:00:00 2001 From: midilab Date: Fri, 9 Mar 2018 11:36:14 -0300 Subject: [PATCH] AcidStepSequencer: Proper handling of user step length pot in cases where we can get a ghost note on. --- examples/AcidStepSequencer/AcidStepSequencer.ino | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/examples/AcidStepSequencer/AcidStepSequencer.ino b/examples/AcidStepSequencer/AcidStepSequencer.ino index dc2d009..dfdf5be 100644 --- a/examples/AcidStepSequencer/AcidStepSequencer.ino +++ b/examples/AcidStepSequencer/AcidStepSequencer.ino @@ -363,6 +363,14 @@ void processPots() step_length = getPotChanges(STEP_LENGTH_POT_PIN, 1, STEP_MAX_SIZE); if ( step_length != -1 ) { _step_length = step_length; + if ( _step_edit >= _step_length ) { + _step_edit = _step_length-1; + } + if ( _step >= _step_length ) { + // send stack note off + sendMidiMessage(NOTE_OFF, _note_stack[1].note, 0); + sendMidiMessage(NOTE_OFF, _note_stack[0].note, 0); + } } tempo = getPotChanges(TEMPO_POT_PIN, SEQUENCER_MIN_BPM, SEQUENCER_MAX_BPM);