From 20df80095968749e870f09bd4240884eb33fa5ba Mon Sep 17 00:00:00 2001 From: Pete Shadbolt Date: Mon, 3 May 2021 19:07:54 -0700 Subject: [PATCH] Ready to test OSC --- audio.scd | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/audio.scd b/audio.scd index 761847b..696bada 100644 --- a/audio.scd +++ b/audio.scd @@ -1,6 +1,6 @@ s = Server.local; s.waitForBoot { - var module, sound; + var module, sound, msg; // Connect to OSC thisProcess.openUDPPort(5005); @@ -32,4 +32,16 @@ s.waitForBoot { // Make a sound sound = Synth.new("module", [\hue, 0.5, \saturation, 0.1, \value, 0.5, \pan, 0.5]); + + // Hook up OSC + f = { |msg, time, addr| + if(msg[0] == '/radio') { + "Got data: % % % % %".postf(msg[1], msg[2], msg[3], msg[4], msg[5]); + sound.set("hue", msg[1]); + sound.set("saturation", msg[2]); + sound.set("value", msg[3]); + sound.set("pan", msg[4]); + } + }; + thisProcess.addOSCRecvFunc(f); };