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 @@
(defn on-msg
(msg)
(
(clear) (clear)
(def x (of (osc "/test") "args" "0" "value")) (def msg-value
(def y (of (osc "/test") "args" "1" "value")) (of
(def r (of (osc "/test") "args" "2" "value")) (first msg) :value))
(fill
(circle x y r)
"red")
(stroke (stroke
(circle x y r) (circle 300 300 150) 2
5 "white") (if
(eq msg-value 1) "#ffb545" "#72dec2" ))))
; trigger
(on "/a" on-msg)