;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; OSC messages can also be sent and received
;; using extempore lang compiled code
;;
;; a couple of things to keep in mind:
;; args is the complete list of arguments
;;
;; by default all extempore osc ints and floats
;; are 32bit (i.e. not 64bit)
;; finally, osc messages are big endian
;; so you'll likely need to swap your arguments
(bind-func osc_receive_7020
(lambda (address:i8* types:i8* args:i8*)
(let ((data (bitcast args i32*)))
(printf "address:%s type:%s arg1:%f arg2:%d\n"
address types
(ftod (unswap32f (pref data 0)))
(unswap32i (pref data 1))))))