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.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)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1 +0,0 @@
|
|||||||
(debug (of (osc "/a") :0 :value))
|
|
@ -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)
|
Loading…
x
Reference in New Issue
Block a user