From 4afe34f8936037a42c3466903604029d9f692ba3 Mon Sep 17 00:00:00 2001 From: midilab Date: Mon, 19 Mar 2018 18:09:41 -0300 Subject: [PATCH] Hotfix: Initializing length variable on step handler to avoid long gosth notes. --- examples/AcidStepSequencer/AcidStepSequencer.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/AcidStepSequencer/AcidStepSequencer.ino b/examples/AcidStepSequencer/AcidStepSequencer.ino index 24ab29b..19a3c27 100644 --- a/examples/AcidStepSequencer/AcidStepSequencer.ino +++ b/examples/AcidStepSequencer/AcidStepSequencer.ino @@ -66,7 +66,8 @@ void sendMidiMessage(uint8_t command, uint8_t byte1, uint8_t byte2) // The callback function wich will be called by uClock each Pulse of 16PPQN clock resolution. Each call represents exactly one step. void ClockOut16PPQN(uint32_t * tick) { - uint16_t step, length; + uint16_t step; + uint16_t length = NOTE_LENGTH; // get actual step. _step = *tick % _step_length; @@ -83,7 +84,6 @@ void ClockOut16PPQN(uint32_t * tick) length = NOTE_LENGTH + (i * 6); break; } else if ( _sequencer[step].rest == false ) { - length = NOTE_LENGTH; break; } }