aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2020-03-02 19:08:48 +0000
committers-ol <s-ol@users.noreply.github.com>2020-03-02 19:09:56 +0000
commitc26b90317cb67ddcf71237e1d2f5fad87a5a3191 (patch)
tree3577416ff058cbd5e955c33693684a2b78c0c364 /lib
parentfind IO via Result tree, not Registry (diff)
downloadalive-c26b90317cb67ddcf71237e1d2f5fad87a5a3191.tar.gz
alive-c26b90317cb67ddcf71237e1d2f5fad87a5a3191.zip
document more interfaces
Diffstat (limited to 'lib')
-rw-r--r--lib/debug.moon2
-rw-r--r--lib/gui.moon76
-rw-r--r--lib/logic.moon2
-rw-r--r--lib/math.moon2
-rw-r--r--lib/midi/core.moon2
-rw-r--r--lib/midi/init.moon2
-rw-r--r--lib/midi/launchctl.moon3
-rw-r--r--lib/osc.moon2
-rw-r--r--lib/pilot.moon2
-rw-r--r--lib/random.moon2
-rw-r--r--lib/sc.moon2
-rw-r--r--lib/string.moon2
-rw-r--r--lib/time.moon2
-rw-r--r--lib/util.moon3
14 files changed, 15 insertions, 89 deletions
diff --git a/lib/debug.moon b/lib/debug.moon
index e098800..1ce56cc 100644
--- a/lib/debug.moon
+++ b/lib/debug.moon
@@ -1,4 +1,4 @@
-import Op, ValueInput, EventInput, match from require 'core'
+import Op, ValueInput, EventInput, match from require 'core.base'
class out extends Op
@doc: "(out [name-str?] value) - log value to the console"
diff --git a/lib/gui.moon b/lib/gui.moon
deleted file mode 100644
index 474de5c..0000000
--- a/lib/gui.moon
+++ /dev/null
@@ -1,76 +0,0 @@
-assert love, "this module only works from within love2d!"
-{ graphics: lg, keyboard: lk } = love
-
-import Op from require 'core'
-import Copilot from require 'copilot'
-import Logger from require 'logger'
-
-class out extends Op
- @doc: "(out name-str value) - show the output
-
-display value as a bar"
-
- setup: (name, @chld) =>
- @@instances[@name] = nil if @name
- @name = name\const!\unwrap!
- @@instances[@name] = @
-
- update: (dt) =>
- @value = @chld\unwrap!
-
- destroy: =>
- @@instances[@name] = nil
-
- MARGIN = 16
- WIDTH = 24
- HEIGHT = 120
- @instances: {}
- @draw_all: ->
- outs = [name for name in pairs @@instances]
- table.sort outs
-
- x = MARGIN
- lg.setColor 1, 1, 1
- for name in *outs
- value = @@instances[name].value * HEIGHT
- lg.rectangle 'line', x, MARGIN, WIDTH, HEIGHT
- lg.rectangle 'fill', x, MARGIN + HEIGHT - value, WIDTH, value
- lg.print name, x, MARGIN + HEIGHT + MARGIN
- x += WIDTH + MARGIN
-
-class key extends Op
- @doc: "(key name-str) - gate from keypress"
-
- setup: (@key) =>
- assert @key
- @out = Stream 'bool', false
- @out
-
- update: (dt) =>
- @out\set lk.isDown @key\unwrap!
-
-arguments, k = {}
-for a in *arg
- if match = a\match '^%-%-(.*)'
- k = match
- arguments[k] = true
- elseif k
- arguments[k] = a
- k = nil
- else
- table.insert arguments, a
-
-Logger.init arguments.log
-
-copilot = Copilot arguments[#arguments]
-
-love.update = (dt) ->
- copilot\update dt
-
-love.draw = ->
- out.draw_all!
-
-{
- :out
- :key
-}
diff --git a/lib/logic.moon b/lib/logic.moon
index b4c6cf7..adff5ee 100644
--- a/lib/logic.moon
+++ b/lib/logic.moon
@@ -1,4 +1,4 @@
-import Op, ValueInput, match from require 'core'
+import Op, ValueInput, match from require 'core.base'
all_same = (first, list) ->
for v in *list
diff --git a/lib/math.moon b/lib/math.moon
index 4d01741..b8b4361 100644
--- a/lib/math.moon
+++ b/lib/math.moon
@@ -1,4 +1,4 @@
-import Op, Value, ValueInput, match from require 'core'
+import Op, Value, ValueInput, match from require 'core.base'
unpack or= table.unpack
class ReduceOp extends Op
diff --git a/lib/midi/core.moon b/lib/midi/core.moon
index 156feb2..627aa2e 100644
--- a/lib/midi/core.moon
+++ b/lib/midi/core.moon
@@ -1,4 +1,4 @@
-import IO, Op, Registry, ValueInput, match from require 'core'
+import IO, Op, Registry, ValueInput, match from require 'core.base'
import RtMidiIn, RtMidiOut, RtMidi from require 'luartmidi'
import band, bor, lshift, rshift from require 'bit32'
diff --git a/lib/midi/init.moon b/lib/midi/init.moon
index daf0088..01af84f 100644
--- a/lib/midi/init.moon
+++ b/lib/midi/init.moon
@@ -1,4 +1,4 @@
-import Value, Op, ValueInput, IOInput, match from require 'core'
+import Value, Op, ValueInput, IOInput, match from require 'core.base'
import input, output, inout, apply_range from require 'lib.midi.core'
class gate extends Op
diff --git a/lib/midi/launchctl.moon b/lib/midi/launchctl.moon
index 1acafdc..495743b 100644
--- a/lib/midi/launchctl.moon
+++ b/lib/midi/launchctl.moon
@@ -1,4 +1,5 @@
-import Value, Op, ValueInput, EventInput, IOInput, match from require 'core'
+import Value, Op, ValueInput, EventInput, IOInput, match
+ from require 'core.base'
import apply_range from require 'lib.midi.core'
import bor, lshift from require 'bit32'
diff --git a/lib/osc.moon b/lib/osc.moon
index e73a982..c459a66 100644
--- a/lib/osc.moon
+++ b/lib/osc.moon
@@ -1,4 +1,4 @@
-import Op, ValueInput, EventInput, ColdInput, match from require 'core'
+import Op, ValueInput, EventInput, ColdInput, match from require 'core.base'
import pack from require 'osc'
import dns, udp from require 'socket'
diff --git a/lib/pilot.moon b/lib/pilot.moon
index a442b77..7251f55 100644
--- a/lib/pilot.moon
+++ b/lib/pilot.moon
@@ -1,4 +1,4 @@
-import Op, EventInput, ValueInput, ColdInput, match from require 'core'
+import Op, EventInput, ValueInput, ColdInput, match from require 'core.base'
import udp from require 'socket'
conn = udp!
diff --git a/lib/random.moon b/lib/random.moon
index 9e5e62b..88fdb89 100644
--- a/lib/random.moon
+++ b/lib/random.moon
@@ -1,4 +1,4 @@
-import Op, Value, ValueInput, EventInput, match from require 'core'
+import Op, Value, ValueInput, EventInput, match from require 'core.base'
apply_range = (range, val) ->
if range\type! == 'str'
diff --git a/lib/sc.moon b/lib/sc.moon
index b30e30d..bae252a 100644
--- a/lib/sc.moon
+++ b/lib/sc.moon
@@ -1,4 +1,4 @@
-import Op, EventInput, ColdInput, match from require 'core'
+import Op, EventInput, ColdInput, match from require 'core.base'
import pack from require 'osc'
import dns, udp from require 'socket'
diff --git a/lib/string.moon b/lib/string.moon
index 8c10c5d..2753381 100644
--- a/lib/string.moon
+++ b/lib/string.moon
@@ -1,4 +1,4 @@
-import Op, ValueInput from require 'core'
+import Op, ValueInput from require 'core.base'
class str extends Op
@doc: "(str v1 [v2]...)
diff --git a/lib/time.moon b/lib/time.moon
index d44013e..5823d80 100644
--- a/lib/time.moon
+++ b/lib/time.moon
@@ -1,5 +1,5 @@
import Registry, Value, IO, Op, ValueInput, IOInput, match
- from require 'core'
+ from require 'core.base'
import monotime from require 'system'
class Clock extends IO
diff --git a/lib/util.moon b/lib/util.moon
index 6ada851..65bab65 100644
--- a/lib/util.moon
+++ b/lib/util.moon
@@ -1,4 +1,5 @@
-import Op, Value, ValueInput, EventInput, ColdInput, match from require 'core'
+import Op, Value, ValueInput, EventInput, ColdInput, match
+ from require 'core.base'
all_same = (list) ->
for v in *list[2,]