Change the way the osc is handled

This commit is contained in:
Devine Lu Linvega 2019-07-22 11:27:42 +09:00
parent 4ee834bdb6
commit 605dd1fb9e
3 changed files with 16 additions and 14 deletions

View File

@ -17,7 +17,8 @@ function Osc (ronin) {
} }
this.onMsg = (msg, timeTag, info) => { this.onMsg = (msg, timeTag, info) => {
this.msg[msg.address] = msg.args if (ronin.bindings[msg.address]) {
// ronin.log(`${info.address}:${info.port} > ${msg.args}`, info) ronin.bindings[msg.address](msg.args)
}
} }
} }

View File

@ -1 +0,0 @@
(debug (of (osc "/a") :0 :value))

View File

@ -1,11 +1,13 @@
(clear) (defn on-msg
(def x (of (osc "/test") "args" "0" "value")) (msg)
(def y (of (osc "/test") "args" "1" "value")) (
(def r (of (osc "/test") "args" "2" "value")) (clear)
(def msg-value
(fill (of
(circle x y r) (first msg) :value))
"red") (stroke
(stroke (circle 300 300 150) 2
(circle x y r) (if
5 "white") (eq msg-value 1) "#ffb545" "#72dec2" ))))
; trigger
(on "/a" on-msg)