From 5cd09b2619e9f569120724cb5678fff91ced21b1 Mon Sep 17 00:00:00 2001 From: neauoire Date: Mon, 9 Nov 2020 10:25:57 -0800 Subject: Implemented wiring --- desktop/sources/scripts/clock.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'desktop/sources/scripts/clock.js') diff --git a/desktop/sources/scripts/clock.js b/desktop/sources/scripts/clock.js index 95086cf..d64272b 100644 --- a/desktop/sources/scripts/clock.js +++ b/desktop/sources/scripts/clock.js @@ -62,10 +62,10 @@ function Clock (client) { this.isPaused = false if (this.isPuppet === true) { console.warn('Clock', 'External Midi control') - if (!pulse.frame || midiStart) { // no frames counted while paused (starting from no clock, unlikely) or triggered by MIDI clock START - this.setFrame(0) // make sure frame aligns with pulse count for an accurate beat + if (!pulse.frame || midiStart) { // no frames counted while paused (starting from no clock, unlikely) or triggered by MIDI clock START + this.setFrame(0) // make sure frame aligns with pulse count for an accurate beat pulse.frame = 0 - pulse.count = 5 // by MIDI standard next pulse is the beat + pulse.count = 5 // by MIDI standard next pulse is the beat } } else { if (msg === true) { client.io.midi.sendClockStart() } @@ -93,7 +93,7 @@ function Clock (client) { count: 0, last: null, timer: null, - frame: 0 // paused frame counter + frame: 0 // paused frame counter } this.tap = function () { @@ -109,8 +109,7 @@ function Clock (client) { }, 2000) } if (pulse.count == 0) { - if (this.isPaused) { pulse.frame++ } - else { + if (this.isPaused) { pulse.frame++ } else { if (pulse.frame > 0) { this.setFrame(client.orca.f + pulse.frame) pulse.frame = 0 -- cgit v1.2.3