From bc3b88571dcf8935f95a8a17132b63469685549c Mon Sep 17 00:00:00 2001 From: neauoire Date: Sun, 17 Nov 2019 14:11:19 -0500 Subject: [PATCH] Do not send midi above channel 16 --- desktop/sources/scripts/client.js | 6 +++--- desktop/sources/scripts/clock.js | 2 +- desktop/sources/scripts/core/library.js | 6 ++++-- index.html | 1 + 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/desktop/sources/scripts/client.js b/desktop/sources/scripts/client.js index fe27015d..0e45fcfe 100644 --- a/desktop/sources/scripts/client.js +++ b/desktop/sources/scripts/client.js @@ -12,7 +12,7 @@ /* global Theme */ function Client () { - this.version = 150 + this.version = 151 this.library = library this.theme = new Theme(this) @@ -332,7 +332,7 @@ function Client () { } this.drawInterface = () => { - this.write(this.orca.f < 15 ? `ver${this.version}` : `${this.cursor.inspect()}`, this.grid.w * 0, this.orca.h, this.grid.w) + this.write(`${this.cursor.inspect()}`, this.grid.w * 0, this.orca.h, this.grid.w) this.write(`${this.cursor.x},${this.cursor.y}${this.cursor.mode === 1 ? '+' : ''}`, this.grid.w * 1, this.orca.h, this.grid.w, this.cursor.mode === 1 ? 1 : 2) this.write(`${this.cursor.w}:${this.cursor.h}`, this.grid.w * 2, this.orca.h, this.grid.w) this.write(`${this.orca.f}f${this.isPaused ? '*' : ''}`, this.grid.w * 3, this.orca.h, this.grid.w) @@ -342,7 +342,7 @@ function Client () { if (this.commander.isActive === true) { this.write(`${this.commander.query}${this.orca.f % 2 === 0 ? '_' : ''}`, this.grid.w * 0, this.orca.h + 1, this.grid.w * 4) } else { - this.write(`${Object.keys(this.source.cache).length} modules`, this.grid.w * 0, this.orca.h + 1, this.grid.w) + this.write(this.orca.f < 15 ? `ver${this.version}` : `${Object.keys(this.source.cache).length} mods`, this.grid.w * 0, this.orca.h + 1, this.grid.w) this.write(`${this.orca.w}x${this.orca.h}`, this.grid.w * 1, this.orca.h + 1, this.grid.w) this.write(`${this.grid.w}/${this.grid.h}${this.tile.w !== 10 ? ' ' + (this.tile.w / 10).toFixed(1) : ''}`, this.grid.w * 2, this.orca.h + 1, this.grid.w) this.write(`${this.clock}`, this.grid.w * 3, this.orca.h + 1, this.grid.w, this.clock.isPuppet === true ? 3 : 2) diff --git a/desktop/sources/scripts/clock.js b/desktop/sources/scripts/clock.js index e8aad8d5..a7351d8e 100644 --- a/desktop/sources/scripts/clock.js +++ b/desktop/sources/scripts/clock.js @@ -29,7 +29,7 @@ function Clock (client) { } this.setSpeed = (value, target = null, setTimer = false) => { - if (this.speed.value === value && this.speed.target === target && this.timer) { console.warn('already at that speed'); return } + if (this.speed.value === value && this.speed.target === target && this.timer) { return } if (value) { this.speed.value = clamp(value, 60, 300) } if (target) { this.speed.target = clamp(target, 60, 300) } if (setTimer === true) { this.setTimer(this.speed.value) } diff --git a/desktop/sources/scripts/core/library.js b/desktop/sources/scripts/core/library.js index d5c3edf5..7b827948 100644 --- a/desktop/sources/scripts/core/library.js +++ b/desktop/sources/scripts/core/library.js @@ -571,7 +571,7 @@ library[':'] = function OperatorMidi (orca, x, y, passive) { this.name = 'midi' this.info = 'Sends MIDI note' - this.ports.channel = { x: 1, y: 0, clamp: { min: 0, max: 16 } } + this.ports.channel = { x: 1, y: 0 } this.ports.octave = { x: 2, y: 0, clamp: { min: 0, max: 8 } } this.ports.note = { x: 3, y: 0 } this.ports.velocity = { x: 4, y: 0, default: 'f', clamp: { min: 0, max: 16 } } @@ -585,6 +585,7 @@ library[':'] = function OperatorMidi (orca, x, y, passive) { if (!isNaN(this.listen(this.ports.note))) { return } const channel = this.listen(this.ports.channel, true) + if (channel > 15) { return } const octave = this.listen(this.ports.octave, true) const note = this.listen(this.ports.note) const velocity = this.listen(this.ports.velocity, true) @@ -605,7 +606,7 @@ library['%'] = function OperatorMono (orca, x, y, passive) { this.name = 'mono' this.info = 'Sends MIDI monophonic note' - this.ports.channel = { x: 1, y: 0, clamp: { min: 0, max: 16 } } + this.ports.channel = { x: 1, y: 0 } this.ports.octave = { x: 2, y: 0, clamp: { min: 0, max: 8 } } this.ports.note = { x: 3, y: 0 } this.ports.velocity = { x: 4, y: 0, default: 'f', clamp: { min: 0, max: 16 } } @@ -619,6 +620,7 @@ library['%'] = function OperatorMono (orca, x, y, passive) { if (!isNaN(this.listen(this.ports.note))) { return } const channel = this.listen(this.ports.channel, true) + if (channel > 15) { return } const octave = this.listen(this.ports.octave, true) const note = this.listen(this.ports.note) const velocity = this.listen(this.ports.velocity, true) diff --git a/index.html b/index.html index 740c1ba4..dd3c9063 100644 --- a/index.html +++ b/index.html @@ -2,6 +2,7 @@ +