Last active
December 17, 2015 16:08
-
-
Save jandrewthompson/5636092 to your computer and use it in GitHub Desktop.
OSC translation layer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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