Change the way the osc is handled
This commit is contained in:
parent
4ee834bdb6
commit
605dd1fb9e
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1 +0,0 @@
|
||||
(debug (of (osc "/a") :0 :value))
|
@ -1,11 +1,13 @@
|
||||
(defn on-msg
|
||||
(msg)
|
||||
(
|
||||
(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")
|
||||
(def msg-value
|
||||
(of
|
||||
(first msg) :value))
|
||||
(stroke
|
||||
(circle x y r)
|
||||
5 "white")
|
||||
(circle 300 300 150) 2
|
||||
(if
|
||||
(eq msg-value 1) "#ffb545" "#72dec2" ))))
|
||||
; trigger
|
||||
(on "/a" on-msg)
|
Loading…
x
Reference in New Issue
Block a user