diff options
author | Лu Лinveгa <[email protected]> | 2019-07-17 16:29:58 +1200 |
---|---|---|
committer | GitHub <[email protected]> | 2019-07-17 16:29:58 +1200 |
commit | 21217c7339d930f2623eaa422a172dd17ec157e4 (patch) | |
tree | ae72893a622c0fb7cafbc8e31bf8f0680a4e2fe6 | |
parent | 281c3e0b397b2aedc7c85d31909072f6a3200b13 (diff) | |
parent | cb44df6afecfdd52055dd6abccf015abf4f92cbf (diff) | |
download | Orca-21217c7339d930f2623eaa422a172dd17ec157e4.tar.gz Orca-21217c7339d930f2623eaa422a172dd17ec157e4.zip |
Merge pull request #168 from okyeron/midi-clock-fixup
fixes on clock refactor
-rw-r--r-- | desktop/core/io/midi.js | 17 | ||||
-rw-r--r-- | desktop/sources/scripts/clock.js | 1 |
2 files changed, 10 insertions, 8 deletions
diff --git a/desktop/core/io/midi.js b/desktop/core/io/midi.js index 9427716..c3a5bf0 100644 --- a/desktop/core/io/midi.js +++ b/desktop/core/io/midi.js @@ -83,7 +83,7 @@ export default function Midi (terminal) { this.update = function () { terminal.controller.clearCat('default', 'Midi') - // terminal.controller.add('default', 'Midi', `MIDI Send Clock ${this.isClock === true ? ' — On' : ' — Off'}`, () => { this.toggleClock(); this.update() }, '') + terminal.controller.add('default', 'Midi', `MIDI Send Clock ${this.isClock === true ? ' — On' : ' — Off'}`, () => { this.toggleClock(); this.update() }, '') terminal.controller.add('default', 'Midi', `Refresh Device List`, () => { terminal.io.midi.setup(); terminal.io.midi.update() }) terminal.controller.addSpacer('default', 'Midi', 'spacer1') @@ -136,6 +136,7 @@ export default function Midi (terminal) { this.toggleClock = function () { this.isClock = !this.isClock + terminal.clock.stop() } this.sendClock = function () { @@ -156,13 +157,13 @@ export default function Midi (terminal) { this.sendClockStart = function () { if (!this.outputDevice()) { return } this.outputDevice().send([0xFA], 0) - console.log('MIDI', 'Clock Start') + console.log('MIDI', 'MIDI Start Sent') } this.sendClockStop = function () { - if (this.outputDevice()) { return } - this.outputDevice().send([0xFA], 0) - console.log('MIDI', 'Clock Start') + if (!this.outputDevice()) { return } + this.outputDevice().send([0xFC], 0) + console.log('MIDI', 'MIDI Stop Sent') } this.receive = function (msg) { @@ -186,15 +187,15 @@ export default function Midi (terminal) { // terminal.clock.tap() // break case 0xFA: - console.log('MIDI', 'Start msg.') + console.log('MIDI', 'Start Received') terminal.clock.play() break case 0xFB: - console.log('MIDI', 'Continue msg.') + console.log('MIDI', 'Continue Received') terminal.clock.play() break case 0xFC: - console.log('MIDI', 'Stop msg.') + console.log('MIDI', 'Stop Received') terminal.clock.stop() break } diff --git a/desktop/sources/scripts/clock.js b/desktop/sources/scripts/clock.js index 1e2db7c..e2a14e5 100644 --- a/desktop/sources/scripts/clock.js +++ b/desktop/sources/scripts/clock.js @@ -64,6 +64,7 @@ export default function Clock (terminal) { if (this.isPuppet) { console.warn('Clock', 'External Midi control'); return } this.isPaused = true terminal.io.midi.sendClockStop() + terminal.io.midi.allNotesOff() this.clearTimer() terminal.io.midi.silence() } |