computerscare-vcv-modules

computerscare modules for VCV Rack
Log | Files | Refs

commit fb3f8e6a094a472810c1787b91dac52bd0f573e6
parent 177fb66768410d2c2ef2d242fddd9efcd753d46f
Author: Adam M <[email protected]>
Date:   Sun, 26 Dec 2021 09:46:16 -0600

blank should ignore clock pulses 1ms within reset trigger

Diffstat:
Msrc/ComputerscareBlank.cpp | 25++++++++++++++++++++-----
Msrc/ComputerscareBlankExpander.cpp | 6++++--
2 files changed, 24 insertions(+), 7 deletions(-)

diff --git a/src/ComputerscareBlank.cpp b/src/ComputerscareBlank.cpp @@ -104,6 +104,8 @@ struct ComputerscareBlank : ComputerscareMenuParamModule { dsp::Timer syncTimer; dsp::Timer slideshowTimer; + dsp::PulseGenerator resetTriggerPulse; + ComputerscareSVGPanel* panelRef; @@ -234,6 +236,20 @@ struct ComputerscareBlank : ComputerscareMenuParamModule { updateScrubFrame(); + bool resetTriggered = false; + bool resetTimerHigh = false; + + if (resetConnected) { + if (resetTrigger.process(messageFromExpander[4])) { + resetTriggered = true; + + resetTriggerPulse.trigger(1e-3f); + } + } + + + resetTimerHigh = resetTriggerPulse.process(args.sampleTime); + if (clockConnected) { clockTriggered = clockTrigger.process(messageFromExpander[2]); if (clockMode == CLOCK_MODE_SYNC) { @@ -255,7 +271,8 @@ struct ComputerscareBlank : ComputerscareMenuParamModule { } else if (clockMode == CLOCK_MODE_FRAME) { //frame advance - shouldAdvanceAnimation = clockTriggered; + //should be ignored if being reset + shouldAdvanceAnimation = clockTriggered && !resetTimerHigh; } } @@ -269,10 +286,8 @@ struct ComputerscareBlank : ComputerscareMenuParamModule { checkAndPerformEndAction(true); } - if (resetConnected) { - if (resetTrigger.process(messageFromExpander[4])) { - goToFrame(0); - } + if (resetTriggered) { + goToFrame(0); } if (resetButtonTrigger.process(messageFromExpander[9])) { goToFrame(0); diff --git a/src/ComputerscareBlankExpander.cpp b/src/ComputerscareBlankExpander.cpp @@ -109,11 +109,13 @@ struct ComputerscareBlankExpander : Module { frameOffsetQuantity->setNumFrames(numFrames); } + + if (eocMessageReadTrigger.process(currentFrame == 0 ? 10.f : 0.f)) { - eocPulse.trigger(1e-3); + eocPulse.trigger(1e-3f); } if (eachFrameReadTrigger.process(lastTick != tick ? 10.f : 0.f)) { - eachFramePulse.trigger(1e-3); + eachFramePulse.trigger(1e-3f); }