aboutsummaryrefslogtreecommitdiffhomepage
path: root/desktop/sources/scripts/clock.js
diff options
context:
space:
mode:
authorneauoire <[email protected]>2020-11-09 10:25:57 -0800
committerneauoire <[email protected]>2020-11-09 10:25:57 -0800
commit5cd09b2619e9f569120724cb5678fff91ced21b1 (patch)
tree56ede805fb1b5e8d96af9c46bb0e2e340a059bb5 /desktop/sources/scripts/clock.js
parent7e520805a29a8e2421636ab7dfe1384683017d12 (diff)
downloadOrca-5cd09b2619e9f569120724cb5678fff91ced21b1.tar.gz
Orca-5cd09b2619e9f569120724cb5678fff91ced21b1.zip
Implemented wiring
Diffstat (limited to 'desktop/sources/scripts/clock.js')
-rw-r--r--desktop/sources/scripts/clock.js11
1 files changed, 5 insertions, 6 deletions
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