|
|
@@ -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); |
|
|
|
}; |