patch version of quil https://github.com/quil/quil to work with oscp5
In applet.clj
(defn -oscEvent
([this message]
(println "osc message received! Message: " message " addrpattern:" (.addrPattern message) " typetag:" (.typetag message))
(with-applet this
((:osc-event (.state this)) message))))
(gen-interface
:name quil.OscP5
:methods [[oscEvent [oscP5.OscMessage] Object]])
-
gen-class
to implementquil.OscP5
-
added
osc-event-fn
inapplet
:osc-event
included as special case
In safe_fns.clj
(defn- wrap-osc-event [function]
(fn [message]
(try
(function message)
(catch Exception e
(println "Exception in :osc-event function:" e "\nstacktrace: " (with-out-str (print-cause-trace e)))
(Thread/sleep 1000)))))
:osc-event
included as special case
(defn- wrap-osc-event [options]
(if-let [handler (:osc-event options)]
(assoc options :osc-event
(fn [message]
(swap! (q/state-atom) handler message)))
options))
- Added
wrap-osc-event
handler tofun-mode