|
|
@@ -1,6 +1,6 @@ |
|
|
|
s = Server.local; |
|
|
|
s.waitForBoot { |
|
|
|
var module, sound, msg, modules; |
|
|
|
var module, msg, modules; |
|
|
|
|
|
|
|
// Connect to OSC |
|
|
|
thisProcess.openUDPPort(5005); |
|
|
@@ -34,21 +34,22 @@ s.waitForBoot { |
|
|
|
|
|
|
|
// Create multiple sound generators |
|
|
|
modules = []; |
|
|
|
10.do({ |
|
|
|
16.do({ |
|
|
|
arg index; |
|
|
|
var synth; |
|
|
|
synth = Synth.new("module", [\hue, 0.5, \saturation, 0.1, \value, 0.5, \pan, 0.5, \gain, 0.2]); |
|
|
|
synth = Synth.new("module", [\hue, 0.5, \saturation, 0.1, \value, 0.5, \pan, 0.5, \gain, 0.9]); |
|
|
|
modules.add(synth); |
|
|
|
}); |
|
|
|
|
|
|
|
// 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]); |
|
|
|
"Got data: index: % hue: % sat: % value: % pan: %\n".postf(msg[1], msg[2], msg[3], msg[4], msg[5]); |
|
|
|
modules[msg[1]].set(\hue, msg[2]); |
|
|
|
modules[msg[1]].set(\saturation, msg[3]); |
|
|
|
modules[msg[1]].set(\value, msg[4]); |
|
|
|
modules[msg[1]].set(\pan, msg[5]); |
|
|
|
s.sync; |
|
|
|
} |
|
|
|
}; |
|
|
|
thisProcess.addOSCRecvFunc(f); |
|
|
|