diff options
author | Devine Lu Linvega <[email protected]> | 2019-06-01 15:03:07 +0900 |
---|---|---|
committer | Devine Lu Linvega <[email protected]> | 2019-06-01 15:03:07 +0900 |
commit | f972f2e59228439251f4d5c2a8afefc6ede0bc99 (patch) | |
tree | 88dbb589721f4c85a52c3fdd61cca24d5416df84 | |
parent | 89e9880d0059a47bb728b0632fc47a8173680395 (diff) | |
download | Orca-f972f2e59228439251f4d5c2a8afefc6ede0bc99.tar.gz Orca-f972f2e59228439251f4d5c2a8afefc6ede0bc99.zip |
Catch exceptions
-rw-r--r-- | desktop/core/io/midi.js | 2 | ||||
-rw-r--r-- | desktop/core/library/_midi.js | 2 | ||||
-rw-r--r-- | desktop/core/library/_mono.js | 2 |
3 files changed, 6 insertions, 0 deletions
diff --git a/desktop/core/io/midi.js b/desktop/core/io/midi.js index 9519892..b9ddf7c 100644 --- a/desktop/core/io/midi.js +++ b/desktop/core/io/midi.js @@ -46,6 +46,8 @@ export default function Midi (terminal) { const n = transposed.id const v = parseInt((item.velocity / 16) * 127) + if (!n || c === 127) { return } + this.outputDevice().send([c, n, v]) } diff --git a/desktop/core/library/_midi.js b/desktop/core/library/_midi.js index 18a3996..834dc30 100644 --- a/desktop/core/library/_midi.js +++ b/desktop/core/library/_midi.js @@ -24,6 +24,8 @@ export default function OperatorMidi (orca, x, y, passive) { const note = this.listen(this.ports.note) if (note === '.') { return } + if (!isNaN(note)) { return } + const velocity = this.listen(this.ports.velocity, true) const length = this.listen(this.ports.length, true) diff --git a/desktop/core/library/_mono.js b/desktop/core/library/_mono.js index 3ba7304..55b40d0 100644 --- a/desktop/core/library/_mono.js +++ b/desktop/core/library/_mono.js @@ -24,6 +24,8 @@ export default function OperatorMono (orca, x, y, passive) { const note = this.listen(this.ports.note) if (note === '.') { return } + if (!isNaN(note)) { return } + const velocity = this.listen(this.ports.velocity, true) const length = this.listen(this.ports.length, true) |