aboutsummaryrefslogtreecommitdiffhomepage
path: root/desktop/core
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/core')
-rw-r--r--desktop/core/library/_cc.js5
-rw-r--r--desktop/core/library/_mono.js2
-rw-r--r--desktop/core/operator.js7
-rw-r--r--desktop/core/orca.js1
4 files changed, 7 insertions, 8 deletions
diff --git a/desktop/core/library/_cc.js b/desktop/core/library/_cc.js
index 455a893..92fed96 100644
--- a/desktop/core/library/_cc.js
+++ b/desktop/core/library/_cc.js
@@ -20,11 +20,10 @@ export default function OperatorCC (orca, x, y) {
const channel = this.listen(this.ports.channel, true)
const knob = this.listen(this.ports.knob, true)
const rawValue = this.listen(this.ports.value, true)
-
- const val = Math.ceil((127 * rawValue) / 35)
+ const value = Math.ceil((127 * rawValue) / 35)
this.draw = false
- terminal.io.cc.send(channel, knob, val)
+ terminal.io.cc.send(channel, knob, value)
if (force === true) {
terminal.io.cc.run()
diff --git a/desktop/core/library/_mono.js b/desktop/core/library/_mono.js
index f920413..9c69537 100644
--- a/desktop/core/library/_mono.js
+++ b/desktop/core/library/_mono.js
@@ -27,6 +27,8 @@ export default function OperatorMono (orca, x, y, passive) {
const rawVelocity = this.listen(this.ports.velocity, true)
const length = this.listen(this.ports.length, true)
+ if (!isNaN(rawNote)) { return }
+
const transposed = this.transpose(rawNote, rawOctave)
// 1 - 8
const octave = transposed.octave
diff --git a/desktop/core/operator.js b/desktop/core/operator.js
index c0d9397..776f824 100644
--- a/desktop/core/operator.js
+++ b/desktop/core/operator.js
@@ -39,14 +39,13 @@ export default function Operator (orca, x, y, glyph = '.', passive = false) {
// Phases
- this.permissions = function () {
+ this.run = function (force = false) {
+ // Permissions
for (const id in this.ports) {
orca.lock(this.x + this.ports[id].x, this.y + this.ports[id].y)
}
- }
-
- this.run = function (force = false) {
this.draw = true
+ // Operate
const payload = this.operation(force)
if (this.ports.output) {
if (this.ports.output.bang === true) {
diff --git a/desktop/core/orca.js b/desktop/core/orca.js
index dbb3cf7..98dd675 100644
--- a/desktop/core/orca.js
+++ b/desktop/core/orca.js
@@ -85,7 +85,6 @@ export default function Orca (terminal) {
const operator = operators[id]
if (this.lockAt(operator.x, operator.y)) { continue }
if (operator.passive || operator.hasNeighbor('*')) {
- operator.permissions()
operator.run()
}
}