Browse Source

Ready to test OSC

tags/kitchen
Pete Shadbolt 3 years ago
parent
commit
20df800959
1 changed files with 13 additions and 1 deletions
  1. +13
    -1
      audio.scd

+ 13
- 1
audio.scd View File

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

Loading…
Cancel
Save