Skip to content

Commit

Permalink
Triggering clock on run if clock signal is already high
Browse files Browse the repository at this point in the history
  • Loading branch information
Rcomian committed Feb 3, 2019
1 parent 093da2d commit 9ce63ab
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/PianoRoll/PianoRollModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 9ce63ab

Please sign in to comment.