aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2020-03-07 20:58:30 +0000
committers-ol <s-ol@users.noreply.github.com>2020-03-07 20:58:51 +0000
commit6a7a2ddaca798f3cccac394d1fb9f317cbe90de6 (patch)
tree4e49e53057b39f75813311ede13f87d238061fe6 /lib
parentspellcheck (diff)
downloadalive-6a7a2ddaca798f3cccac394d1fb9f317cbe90de6.tar.gz
alive-6a7a2ddaca798f3cccac394d1fb9f317cbe90de6.zip
add ldoc documentation
Diffstat (limited to 'lib')
-rw-r--r--lib/debug.moon6
-rw-r--r--lib/logic.moon16
-rw-r--r--lib/math.moon12
-rw-r--r--lib/midi.moon22
-rw-r--r--lib/osc.moon18
-rw-r--r--lib/pilot.moon20
-rw-r--r--lib/random.moon10
-rw-r--r--lib/sc.moon10
-rw-r--r--lib/string.moon4
-rw-r--r--lib/time.moon24
-rw-r--r--lib/util.moon12
11 files changed, 77 insertions, 77 deletions
diff --git a/lib/debug.moon b/lib/debug.moon
index 1ce56cc..4a22e10 100644
--- a/lib/debug.moon
+++ b/lib/debug.moon
@@ -1,4 +1,4 @@
-import Op, ValueInput, EventInput, match from require 'core.base'
+import Op, Input, match from require 'core.base'
class out extends Op
@doc: "(out [name-str?] value) - log value to the console"
@@ -6,8 +6,8 @@ class out extends Op
setup: (inputs) =>
{ name, value } = match 'str? any', inputs
super
- name: name and ValueInput name
- value: ValueInput value
+ name: name and Input.value name
+ value: Input.value value
tick: =>
{ :name, :value } = @unwrap_all!
diff --git a/lib/logic.moon b/lib/logic.moon
index adff5ee..7cf8695 100644
--- a/lib/logic.moon
+++ b/lib/logic.moon
@@ -1,4 +1,4 @@
-import Op, ValueInput, match from require 'core.base'
+import Op, Input, match from require 'core.base'
all_same = (first, list) ->
for v in *list
@@ -20,8 +20,8 @@ class ReduceOp extends Op
setup: (inputs) =>
{ first, rest } = match "any *any", inputs
super
- first: ValueInput first
- rest: [ValueInput v for v in *rest]
+ first: Input.value first
+ rest: [Input.value v for v in *rest]
tick: =>
{ :first, :rest } = @unwrap_all!
@@ -45,8 +45,8 @@ If the value types dont match, the result is an eval-time constant 'false'."
super if same
{
- first: ValueInput first
- rest: [ValueInput v for v in *rest]
+ first: Input.value first
+ rest: [Input.value v for v in *rest]
}
else
{}
@@ -73,7 +73,7 @@ class not_eq extends Op
setup: (inputs) =>
assert #inputs > 1, "neq need at least two values"
- super [ValueInput v for v in *inputs]
+ super [Input.value v for v in *inputs]
tick: =>
if not @inputs[1]
@@ -105,7 +105,7 @@ class not_ extends Op
setup: (inputs) =>
{ value } = match 'any', inputs
- super value: ValueInput value
+ super value: Input.value value
tick: => @out\set not tobool @inputs.value!
@@ -115,7 +115,7 @@ class bool extends Op
setup: (inputs) =>
{ value } = match 'any', inputs
- super value: ValueInput value
+ super value: Input.value value
tick: => @out\set tobool @inputs\value!
diff --git a/lib/math.moon b/lib/math.moon
index b8b4361..02ba1e1 100644
--- a/lib/math.moon
+++ b/lib/math.moon
@@ -1,4 +1,4 @@
-import Op, Value, ValueInput, match from require 'core.base'
+import Op, Value, Input, match from require 'core.base'
unpack or= table.unpack
class ReduceOp extends Op
@@ -7,8 +7,8 @@ class ReduceOp extends Op
setup: (inputs) =>
{ first, rest } = match 'num *num', inputs
super
- first: ValueInput first
- rest: [ValueInput v for v in *rest]
+ first: Input.value first
+ rest: [Input.value v for v in *rest]
tick: =>
{ :first, :rest } = @unwrap_all!
@@ -52,8 +52,8 @@ evenodd_op = (name, remainder) ->
setup: (inputs) =>
{ val, div } = match 'num num?', inputs
super
- val: ValueInput val
- div: ValueInput div or Value.num 2
+ val: Input.value val
+ div: Input.value div or Value.num 2
tick: =>
{ :val, :div } = @unwrap_all!
@@ -72,7 +72,7 @@ func_op = (name, arity, func) ->
setup: (inputs) =>
{ params } = match '*num', inputs
assert #params == arity, "#{@} needs exactly #{arity} parameters" if arity != '*'
- super [ValueInput p for p in *params]
+ super [Input.value p for p in *params]
tick: => @out\set func unpack @unwrap_all!
diff --git a/lib/midi.moon b/lib/midi.moon
index 01af84f..33fe936 100644
--- a/lib/midi.moon
+++ b/lib/midi.moon
@@ -1,4 +1,4 @@
-import Value, Op, ValueInput, IOInput, match from require 'core.base'
+import Value, Op, Input, match from require 'core.base'
import input, output, inout, apply_range from require 'lib.midi.core'
class gate extends Op
@@ -10,9 +10,9 @@ class gate extends Op
setup: (inputs) =>
{ port, note, chan } = match 'midi/port num num?', inputs
super
- port: IOInput port
- note: ValueInput note
- chan: ValueInput chan or Value.num -1
+ port: Input.io port
+ note: Input.value note
+ chan: Input.value chan or Value.num -1
tick: =>
{ :port, :note, :chan } = @inputs
@@ -37,9 +37,9 @@ class trig extends Op
setup: (inputs) =>
{ port, note, chan } = match 'midi/port num num?', inputs
super
- port: IOInput port
- note: ValueInput note
- chan: ValueInput chan or Value.num -1
+ port: Input.io port
+ note: Input.value note
+ chan: Input.value chan or Value.num -1
tick: =>
{ :port, :note, :chan } = @inputs
@@ -71,10 +71,10 @@ range can be one of:
setup: (inputs) =>
{ port, cc, chan, range } = match 'midi/port num num? any?', inputs
super
- port: IOInput port
- cc: ValueInput cc
- chan: ValueInput chan or Value.num -1
- range: ValueInput range or Value.str 'uni'
+ port: Input.io port
+ cc: Input.value cc
+ chan: Input.value chan or Value.num -1
+ range: Input.value range or Value.str 'uni'
if not @out\unwrap!
@out\set apply_range @inputs.range, 0
diff --git a/lib/osc.moon b/lib/osc.moon
index c459a66..101fb11 100644
--- a/lib/osc.moon
+++ b/lib/osc.moon
@@ -1,4 +1,4 @@
-import Op, ValueInput, EventInput, ColdInput, match from require 'core.base'
+import Op, Input, match from require 'core.base'
import pack from require 'osc'
import dns, udp from require 'socket'
@@ -12,8 +12,8 @@ class connect extends Op
setup: (inputs) =>
{ host, port } = match 'str num', inputs
super
- host: ValueInput host
- port: ValueInput port
+ host: Input.value host
+ port: Input.value port
tick: =>
{ :host, :port } = @unwrap_all!
@@ -30,9 +30,9 @@ sends a message only when val is dirty."
setup: (inputs) =>
{ socket, path, value } = match 'udp/socket str any', inputs
super
- socket: ColdInput socket
- path: ColdInput path
- value: EventInput value
+ socket: Input.cold socket
+ path: Input.cold path
+ value: Input.value value
tick: =>
if @inputs.value\dirty!
@@ -51,9 +51,9 @@ sends a whenever any parameter changes."
setup: (inputs) =>
{ socket, path, value } = match 'udp/socket str any', inputs
super
- socket: ValueInput socket
- path: ValueInput path
- value: ValueInput value
+ socket: Input.value socket
+ path: Input.value path
+ value: Input.value value
tick: =>
{ :socket, :path, :value } = @unwrap_all!
diff --git a/lib/pilot.moon b/lib/pilot.moon
index 5c680ed..f24270e 100644
--- a/lib/pilot.moon
+++ b/lib/pilot.moon
@@ -1,4 +1,4 @@
-import Op, EventInput, ValueInput, ColdInput, match from require 'core.base'
+import Op, Input, match from require 'core.base'
import udp from require 'socket'
local conn
@@ -27,8 +27,8 @@ class play extends Op
{ trig, args } = match 'bang *any', inputs
assert #args < 6, "too many arguments!"
super
- trig: EventInput trig
- args: [ColdInput a for a in *args]
+ trig: Input.event trig
+ args: [Input.cold a for a in *args]
tick: =>
{ :trig, :args } = @inputs
@@ -42,10 +42,10 @@ class play_ extends Op
{ chan, octv, note, args } = match 'any any any *any', inputs
assert #args < 3, "too many arguments!"
super
- chan: ColdInput chan
- octv: ColdInput octv
- note: EventInput note
- args: [ColdInput a for a in *args]
+ chan: Input.cold chan
+ octv: Input.cold octv
+ note: Input.event note
+ args: [Input.cold a for a in *args]
tick: =>
if @inputs.note\dirty!
@@ -60,9 +60,9 @@ which is one of 'DIS', 'CHO', 'REV' or 'FEE'"
setup: (inputs) =>
{ which, a, b } = match 'str num num', inputs
super {
- ColdInput which
- ValueInput a
- ValueInput b
+ Input.cold which
+ Input.value a
+ Input.value b
}
tick: =>
diff --git a/lib/random.moon b/lib/random.moon
index 88fdb89..7cabdf0 100644
--- a/lib/random.moon
+++ b/lib/random.moon
@@ -1,4 +1,4 @@
-import Op, Value, ValueInput, EventInput, match from require 'core.base'
+import Op, Value, Input, match from require 'core.base'
apply_range = (range, val) ->
if range\type! == 'str'
@@ -36,8 +36,8 @@ generates a random value in range on create and trigger.
setup: (inputs) =>
{ trig, range } = match 'bang? any?', inputs
super
- trig: trig and EventInput trig
- range: ValueInput range or Value.str 'uni'
+ trig: trig and Input.event trig
+ range: Input.value range or Value.str 'uni'
tick: =>
@gen! if @inputs.trig and @inputs.trig\dirty!
@@ -59,8 +59,8 @@ each component is in range.
setup: (inputs) =>
{ trig, range } = match 'bang? any?', inputs
super
- trig: trig and EventInput trig
- range: ValueInput range or Value.str 'uni'
+ trig: trig and Input.event trig
+ range: Input.value range or Value.str 'uni'
tick: =>
@gen! if @inputs.trig and @inputs.trig\dirty!
diff --git a/lib/sc.moon b/lib/sc.moon
index bae252a..ebdcd3b 100644
--- a/lib/sc.moon
+++ b/lib/sc.moon
@@ -1,4 +1,4 @@
-import Op, EventInput, ColdInput, match from require 'core.base'
+import Op, Input, match from require 'core.base'
import pack from require 'osc'
import dns, udp from require 'socket'
@@ -15,10 +15,10 @@ class play extends Op
assert val\type! == 'num', "only numbers are supported as control values"
super
- socket: ColdInput socket
- synth: ColdInput synth
- trig: EventInput trig
- ctrls: [ColdInput v for v in *ctrls]
+ trig: Input.event trig
+ socket: Input.cold socket
+ synth: Input.cold synth
+ ctrls: [Input.cold v for v in *ctrls]
tick: =>
if @inputs.trig\dirty! and @inputs.trig!
diff --git a/lib/string.moon b/lib/string.moon
index 2753381..06509f3 100644
--- a/lib/string.moon
+++ b/lib/string.moon
@@ -1,11 +1,11 @@
-import Op, ValueInput from require 'core.base'
+import Op, Input from require 'core.base'
class str extends Op
@doc: "(str v1 [v2]...)
(.. v1 [v2]...) - concatenate/stringify values"
new: => super 'str'
- setup: (inputs) => super [ValueInput v for v in *inputs]
+ setup: (inputs) => super [Input.value v for v in *inputs]
tick: => @out\set table.concat [tostring v! for v in *@inputs]
{
diff --git a/lib/time.moon b/lib/time.moon
index 5823d80..44cb998 100644
--- a/lib/time.moon
+++ b/lib/time.moon
@@ -1,4 +1,4 @@
-import Registry, Value, IO, Op, ValueInput, IOInput, match
+import Registry, Value, IO, Op, Input, match
from require 'core.base'
import monotime from require 'system'
@@ -29,7 +29,7 @@ fps defaults to 60 and has to be an eval-time constant"
setup: (inputs) =>
{ fps } = match 'num?', inputs
- super fps: ValueInput fps or Value.num 60
+ super fps: Input.value fps or Value.num 60
tick: =>
if @inputs.fps\dirty!
@@ -52,9 +52,9 @@ wave selects the wave shape from the following:
setup: (inputs, scope) =>
{ clock, freq, wave } = match 'clock? num any?', inputs
super
- clock: IOInput clock or scope\get '*clock*'
- freq: ValueInput freq
- wave: ValueInput wave or default_wave
+ clock: Input.io clock or scope\get '*clock*'
+ freq: Input.value freq
+ wave: Input.value wave or default_wave
tau = math.pi * 2
tick: =>
@@ -80,9 +80,9 @@ ramps from 0 to max (default same as ramp) once every period seconds."
setup: (inputs, scope) =>
{ clock, period, max } = match 'clock? num num?', inputs
super
- clock: IOInput clock or scope\get '*clock*'
- period: ValueInput period
- max: max and ValueInput max
+ clock: Input.io clock or scope\get '*clock*'
+ period: Input.value period
+ max: max and Input.value max
tick: =>
clock_dirty = @inputs.clock\dirty!
@@ -108,8 +108,8 @@ counts upwards by one every period seconds and returns the number of completed t
setup: (inputs, scope) =>
{ clock, period } = match 'clock? num', inputs
super
- clock: IOInput clock or scope\get '*clock*'
- period: ValueInput period
+ clock: Input.io clock or scope\get '*clock*'
+ period: Input.value period
tick: =>
if @inputs.clock\dirty!
@@ -132,8 +132,8 @@ returns true once every period seconds."
setup: (inputs, scope) =>
{ clock, period } = match 'clock? num', inputs
super
- clock: IOInput clock or scope\get '*clock*'
- period: ValueInput period
+ clock: Input.io clock or scope\get '*clock*'
+ period: Input.value period
tick: =>
if @inputs.clock\dirty!
diff --git a/lib/util.moon b/lib/util.moon
index 65bab65..2a43dd2 100644
--- a/lib/util.moon
+++ b/lib/util.moon
@@ -1,4 +1,4 @@
-import Op, Value, ValueInput, EventInput, ColdInput, match
+import Op, Value, Input, match
from require 'core.base'
all_same = (list) ->
@@ -24,8 +24,8 @@ when i is a num, it is (floor)ed and the matching argument (starting from 0) is
@out = Value typ
super
- i: ValueInput i
- values: [ValueInput v for v in *values]
+ i: Input.value i
+ values: [Input.value v for v in *values]
tick: =>
{ :i, :values } = @inputs
@@ -74,7 +74,7 @@ class edge extends Op
setup: (inputs) =>
{ value } = match 'bool', inputs
- super value: EventInput
+ super value: Input.value
tick: =>
now = @inputs.value!
@@ -91,8 +91,8 @@ default defaults to zero."
setup: (params) =>
{ value, init } = match 'any any', inputs
super
- value: EventInput value
- init: ColdInput init
+ value: Input.event value
+ init: Input.cold init
@out = Value value\type!
@out\set @inputs.init\unwrap!