aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2020-02-01 21:29:10 +0000
committers-ol <s-ol@users.noreply.github.com>2020-02-01 21:29:10 +0000
commitf4b5543b33de9ce6e5c3a1bcc65db36eb3eb5b03 (patch)
tree636cbcbbcd8be60d39cba2e4cf04b4edc7011233 /lib
parentfix README typo (diff)
downloadalive-f4b5543b33de9ce6e5c3a1bcc65db36eb3eb5b03.tar.gz
alive-f4b5543b33de9ce6e5c3a1bcc65db36eb3eb5b03.zip
first-class scopes
Diffstat (limited to 'lib')
-rw-r--r--lib/math.moon2
-rw-r--r--lib/time.moon4
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/math.moon b/lib/math.moon
index 8ada38a..8e54bbd 100644
--- a/lib/math.moon
+++ b/lib/math.moon
@@ -50,6 +50,8 @@ module = {
:div, '/': div
mix: func_op 'mix', 3, (a, b, i) -> i*b + (1-i)*a
+
+ pi: math.pi, huge: math.huge
}
for name, arity in pairs {
diff --git a/lib/time.moon b/lib/time.moon
index f2ad70c..4fe5d7c 100644
--- a/lib/time.moon
+++ b/lib/time.moon
@@ -6,7 +6,9 @@ class lfo extends Op
super ...
@phase = 0
- setup: (@freq, @wave=Const 'sin') =>
+
+ default_wave = Const 'str', 'sin'
+ setup: (@freq, @wave=default_wave) =>
update: (dt) =>
@phase += dt * @freq\get!