Skip to content

Commit

Permalink
Do not send midi above channel 16
Browse files Browse the repository at this point in the history
  • Loading branch information
neauoire committed Nov 17, 2019
1 parent a737783 commit bc3b885
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
6 changes: 3 additions & 3 deletions desktop/sources/scripts/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/* global Theme */

function Client () {
this.version = 150
this.version = 151
this.library = library

this.theme = new Theme(this)
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion desktop/sources/scripts/clock.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) }
Expand Down
6 changes: 4 additions & 2 deletions desktop/sources/scripts/core/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 } }
Expand All @@ -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)
Expand All @@ -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 } }
Expand All @@ -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)
Expand Down
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<head>
<meta charset='utf-8'>
<link rel="stylesheet" type="text/css" href="desktop/sources/links/style.css"/>
<link rel="icon" href="data:">

<script type="text/javascript">function require(name){ console.warn('Failed to require '+name) }</script>

Expand Down

0 comments on commit bc3b885

Please sign in to comment.