aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDevine Lu Linvega <[email protected]>2019-05-31 12:01:36 +0900
committerDevine Lu Linvega <[email protected]>2019-05-31 12:01:36 +0900
commit70c121804c6f23e4f3f704bb5f29a76fdeb1058e (patch)
treed0e19c81a83bccf530d624f92cb77367782b6f8b
parent773bbb3a958c72ab2f89c9569e9729bd97950f86 (diff)
downloadOrca-70c121804c6f23e4f3f704bb5f29a76fdeb1058e.tar.gz
Orca-70c121804c6f23e4f3f704bb5f29a76fdeb1058e.zip
Removed .permission method
-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()
}
}