diff options
-rw-r--r-- | desktop/sources/scripts/client.js | 9 | ||||
-rw-r--r-- | desktop/sources/scripts/core/io/midi.js | 28 |
2 files changed, 19 insertions, 18 deletions
diff --git a/desktop/sources/scripts/client.js b/desktop/sources/scripts/client.js index 6fcdd38..f482f06 100644 --- a/desktop/sources/scripts/client.js +++ b/desktop/sources/scripts/client.js @@ -238,7 +238,7 @@ function Client () { } this.isInvisible = (x, y) => { - return this.orca.glyphAt(x, y) === '.' && !this.isMarker(x, y) && !this.cursor.selected(x, y) && !this.isLocals(x, y) && !this.ports[this.orca.indexAt(x, y)] + return this.orca.glyphAt(x, y) === '.' && !this.isMarker(x, y) && !this.cursor.selected(x, y) && !this.isLocals(x, y) && !this.ports[this.orca.indexAt(x, y)] && !this.orca.lockAt(x, y) } this.findPorts = () => { @@ -308,12 +308,13 @@ function Client () { } this.makeStyle = (x, y, glyph, selection) => { - const isLocked = this.orca.lockAt(x, y) - const port = this.ports[this.orca.indexAt(x, y)] if (this.cursor.selected(x, y)) { return 4 } + const isLocked = this.orca.lockAt(x, y) if (selection === glyph && isLocked === false && selection !== '.') { return 6 } if (glyph === '*' && isLocked === false) { return 2 } - if (port && port.reader) { return 9 } + + const port = this.ports[this.orca.indexAt(x, y)] + if (port) { return port[2] } if (isLocked === true) { return 5 } return 20 diff --git a/desktop/sources/scripts/core/io/midi.js b/desktop/sources/scripts/core/io/midi.js index 3f98c64..a298237 100644 --- a/desktop/sources/scripts/core/io/midi.js +++ b/desktop/sources/scripts/core/io/midi.js @@ -93,20 +93,6 @@ function Midi (client) { this.ticks = [] - this.sendClock = function () { - if (!this.outputDevice()) { return } - if (this.isClock !== true) { return } - - const bpm = client.clock.speed.value - const frameTime = (60000 / bpm) / 4 - const frameFrag = frameTime / 6 - - for (let id = 0; id < 6; id++) { - if (this.ticks[id]) { clearTimeout(this.ticks[id]) } - this.ticks[id] = setTimeout(() => { this.outputDevice().send([0xF8], 0) }, parseInt(id) * frameFrag) - } - } - this.sendClockStart = function () { if (!this.outputDevice()) { return } this.isClock = true @@ -121,6 +107,20 @@ function Midi (client) { console.log('MIDI', 'MIDI Stop Sent') } + this.sendClock = function () { + if (!this.outputDevice()) { return } + if (this.isClock !== true) { return } + + const bpm = client.clock.speed.value + const frameTime = (60000 / bpm) / 4 + const frameFrag = frameTime / 6 + + for (let id = 0; id < 6; id++) { + if (this.ticks[id]) { clearTimeout(this.ticks[id]) } + this.ticks[id] = setTimeout(() => { this.outputDevice().send([0xF8], 0) }, parseInt(id) * frameFrag) + } + } + this.receive = function (msg) { switch (msg.data[0]) { // Clock |