aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2020-03-09 10:49:36 +0000
committers-ol <s-ol@users.noreply.github.com>2020-03-09 10:51:45 +0000
commit08159094121698efe5822e9a79ed9c4a7633a9df (patch)
tree3f1c6fcdef475cc1dc47e2f541660ecd324da2fb /lib
parentadd internals docs (diff)
downloadalive-08159094121698efe5822e9a79ed9c4a7633a9df.tar.gz
alive-08159094121698efe5822e9a79ed9c4a7633a9df.zip
bugfixes
Diffstat (limited to 'lib')
-rw-r--r--lib/midi/core.moon10
-rw-r--r--lib/midi/launchctl.moon25
-rw-r--r--lib/util.moon4
3 files changed, 19 insertions, 20 deletions
diff --git a/lib/midi/core.moon b/lib/midi/core.moon
index 627aa2e..d5259ad 100644
--- a/lib/midi/core.moon
+++ b/lib/midi/core.moon
@@ -1,4 +1,4 @@
-import IO, Op, Registry, ValueInput, match from require 'core.base'
+import IO, Op, Registry, Input, match from require 'core.base'
import RtMidiIn, RtMidiOut, RtMidi from require 'luartmidi'
import band, bor, lshift, rshift from require 'bit32'
@@ -68,7 +68,7 @@ class input extends PortOp
setup: (inputs) =>
{ name } = match 'str', inputs
- super name: ValueInput name
+ super name: Input.value name
tick: => super @inputs.name
@@ -77,7 +77,7 @@ class output extends PortOp
setup: (inputs) =>
{ name } = match 'str', inputs
- super name: ValueInput name
+ super name: Input.value name
tick: => super nil, @inputs.name
@@ -87,8 +87,8 @@ class inout extends PortOp
setup: (inputs) =>
{ inp, out } = match 'str str', inputs
super
- inp: ValueInput inp
- out: ValueInput out
+ inp: Input.value inp
+ out: Input.value out
tick: => super @inputs.inp, @inputs.out
diff --git a/lib/midi/launchctl.moon b/lib/midi/launchctl.moon
index 495743b..6408528 100644
--- a/lib/midi/launchctl.moon
+++ b/lib/midi/launchctl.moon
@@ -1,5 +1,4 @@
-import Value, Op, ValueInput, EventInput, IOInput, match
- from require 'core.base'
+import Value, Op, Input, match from require 'core.base'
import apply_range from require 'lib.midi.core'
import bor, lshift from require 'bit32'
@@ -29,12 +28,12 @@ range can be one of:
chan, steps, range } = match 'midi/port num num num num? any?', inputs
super
- port: IOInput port
- i: ValueInput i
- start: ValueInput start
- chan: ValueInput chan
- steps: ValueInput steps or Value.num 8
- range: ValueInput range or Value.str 'uni'
+ port: Input.io port
+ i: Input.value i
+ start: Input.value start
+ chan: Input.value chan
+ steps: Input.value steps or Value.num 8
+ range: Input.value range or Value.str 'uni'
if not @out\unwrap!
@out\set apply_range @inputs.range, 0
@@ -75,11 +74,11 @@ steps defaults to 8."
{ port, i, start, chan, steps } = match 'midi/port num num num num?', inputs
super
- port: IOInput port
- i: ValueInput i
- start: ValueInput start
- chan: ValueInput chan
- steps: ValueInput steps or Value.num 8
+ port: Input.io port
+ i: Input.value i
+ start: Input.value start
+ chan: Input.value chan
+ steps: Input.value steps or Value.num 8
light = (set, active) ->
set = if set then 'S' else ' '
diff --git a/lib/util.moon b/lib/util.moon
index 2a43dd2..3ed903b 100644
--- a/lib/util.moon
+++ b/lib/util.moon
@@ -21,7 +21,7 @@ when i is a num, it is (floor)ed and the matching argument (starting from 0) is
i_type = i\type!
assert i_type == 'bool' or i_type == 'num', "#{@}: i has to be bool or num"
typ = all_same [v\type! for v in *values]
- @out = Value typ
+ @out = Value typ if not @out or typ != @out.type
super
i: Input.value i
@@ -74,7 +74,7 @@ class edge extends Op
setup: (inputs) =>
{ value } = match 'bool', inputs
- super value: Input.value
+ super value: Input.value value
tick: =>
now = @inputs.value!