diff --git a/desktop/sources/scripts/osc.js b/desktop/sources/scripts/osc.js index 7c5389d..77651de 100644 --- a/desktop/sources/scripts/osc.js +++ b/desktop/sources/scripts/osc.js @@ -17,7 +17,8 @@ function Osc (ronin) { } this.onMsg = (msg, timeTag, info) => { - this.msg[msg.address] = msg.args - // ronin.log(`${info.address}:${info.port} > ${msg.args}`, info) + if (ronin.bindings[msg.address]) { + ronin.bindings[msg.address](msg.args) + } } } diff --git a/examples/orca.lisp b/examples/orca.lisp deleted file mode 100644 index 4e61054..0000000 --- a/examples/orca.lisp +++ /dev/null @@ -1 +0,0 @@ -(debug (of (osc "/a") :0 :value)) \ No newline at end of file diff --git a/examples/osc.lisp b/examples/osc.lisp index 70e1e6f..2a3afc3 100644 --- a/examples/osc.lisp +++ b/examples/osc.lisp @@ -1,11 +1,13 @@ -(clear) -(def x (of (osc "/test") "args" "0" "value")) -(def y (of (osc "/test") "args" "1" "value")) -(def r (of (osc "/test") "args" "2" "value")) - -(fill -(circle x y r) -"red") -(stroke -(circle x y r) -5 "white") +(defn on-msg + (msg) + ( + (clear) + (def msg-value + (of + (first msg) :value)) + (stroke + (circle 300 300 150) 2 + (if + (eq msg-value 1) "#ffb545" "#72dec2" )))) +; trigger +(on "/a" on-msg) \ No newline at end of file