From a3dcc0b1094d92217f0519026678cd6f222347a1 Mon Sep 17 00:00:00 2001 From: midilab Date: Mon, 4 Dec 2017 21:10:23 -0200 Subject: [PATCH] Fix #3 for clock PPQN resolutions of 16, 32 and 96 --- src/uClock.cpp | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/uClock.cpp b/src/uClock.cpp index 01f446b..cc091e0 100755 --- a/src/uClock.cpp +++ b/src/uClock.cpp @@ -114,15 +114,18 @@ void uClockClass::start() void uClockClass::stop() { + state = PAUSED; + counter = 0; + last_clock = 0; + div96th_counter = 0; + div32th_counter = 0; + div16th_counter = 0; + mod6_counter = 0; + indiv96th_counter = 0; + inmod6_counter = 0; + pll_x = 220; start_timer = 0; - if (mode == INTERNAL_CLOCK) { - state = PAUSED; - } else { - //if (mode == EXTERNAL_CLOCK) { - state = PAUSED; - } - if (onClockStopCallback) { onClockStopCallback(); } @@ -221,13 +224,6 @@ void uClockClass::handleClock() } break; -/* - interval = (uint32_t)((uint32_t)156250 / tempo) - 16; - - interval = x(156250 / tempo) - 16; - x(156250 / tempo) = -16 -*/ - } }