Skip to content

Instantly share code, notes, and snippets.

@jandrewthompson
Last active December 17, 2015 16:08
Show Gist options
  • Save jandrewthompson/5636092 to your computer and use it in GitHub Desktop.
Save jandrewthompson/5636092 to your computer and use it in GitHub Desktop.
OSC translation layer
(ns oscplay.core)
(use 'overtone.osc)
(def PORT 8000)
(def mappings [{:from "/1/toggle1"
:to "/ardour/toggle1"}
{:from "/1/toggle2"
:to "/ardour/toggle2"}])
(def server (osc-server PORT))
(def client (osc-client "localhost" PORT))
(map
(fn [mapping]
(osc-handle server (:from mapping)
(fn [msg]
(osc-send client (:to mapping) (first (:args msg))))))
mappings
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment