From 9ce63ab522aa90690af495a329debe960e3241df Mon Sep 17 00:00:00 2001 From: Jim Tupper Date: Sun, 3 Feb 2019 10:45:18 +0000 Subject: [PATCH] Triggering clock on run if clock signal is already high --- src/PianoRoll/PianoRollModule.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/PianoRoll/PianoRollModule.cpp b/src/PianoRoll/PianoRollModule.cpp index c0b25b5..23594e3 100644 --- a/src/PianoRoll/PianoRollModule.cpp +++ b/src/PianoRoll/PianoRollModule.cpp @@ -89,14 +89,20 @@ void PianoRollModule::step() { } bool clockTick = false; - + float currentClockLevel = 0.f; + while((int)clockBuffer.size() > clockDelay) { - clockTick = clockInputTrigger.process(clockBuffer.shift()); + currentClockLevel = clockBuffer.shift(); + clockTick |= clockInputTrigger.process(currentClockLevel); } if (runInputTrigger.process(inputs[RUN_INPUT].value)) { transport.toggleRun(); + if (currentClockLevel > 1.f) { + clockTick = true; + } + if (!transport.isRunning()) { gateOutputPulse.reset(); }