Browse Source

Comms OK between python and supercollider

tags/kitchen
Pete Shadbolt 3 years ago
parent
commit
7459663801
2 changed files with 22 additions and 1 deletions
  1. +9
    -0
      osctest.py
  2. +13
    -1
      sine.scd

+ 9
- 0
osctest.py View File

@@ -0,0 +1,9 @@
from pythonosc import udp_client
import time

osc = udp_client.SimpleUDPClient("0.0.0.0", 5005)

while True:
print("send")
osc.send_message("/radio", 1337)
time.sleep(1)

+ 13
- 1
sine.scd View File

@@ -1,4 +1,16 @@
s = Server.local;
s.waitForBoot {
{ SinOsc.ar() }.play;
// Set up OSC communications
thisProcess.openUDPPort(5005);
n = NetAddr.new("0.0.0.0", 5005);
o = OSCFunc({ arg msg, time, addr, recvPort; [msg, time, addr, recvPort].postln; }, '/radio', n);
OSCFunc.trace(true);

// Start some oscillators
{
var x = SinOsc.ar(MouseX.kr(1, 100));
SinOsc.ar(300 * x + 800, 0, 0.1)
+
PinkNoise.ar(0.1 * x + 0.1)
}.play;
};

Loading…
Cancel
Save