Skip to content

Instantly share code, notes, and snippets.

@zeffii
Last active December 27, 2015 00:49
Show Gist options
  • Save zeffii/7240799 to your computer and use it in GitHub Desktop.
Save zeffii/7240799 to your computer and use it in GitHub Desktop.
[chuck](VM): sporking incoming shred: 1 (array_test_sinosc2.ck)...
got (via OSC): 0.313806
got (via OSC): 0.130969
got (via OSC): 0.146900
got (via OSC): 0.315320
got (via OSC): 0.224443
got (via OSC): 0.229042
got (via OSC): 0.818624
got (via OSC): 0.859616
got (via OSC): 0.547270
got (via OSC): 0.596574
[chuck](VM): removing shred: 1 (array_test_sinosc2.ck)...
// create our OSC receiver
OscRecv recv;
6449 => recv.port;
recv.listen();
// create an address in the receiver, store in new variable
recv.event( "/filter, f" ) @=> OscEvent oe;
while (1)
{
// wait for event to arrive
oe => now;
// grab the next message from the queue.
while ( oe.nextMsg() != 0 )
{
// getFloat fetches the expected float
<<< "got (via OSC):", oe.getFloat() >>>;
}
}
import random
import time
from pythonosc import osc_message_builder
from pythonosc import udp_client
ip="127.0.0.1"
port=6449
client = udp_client.UDPClient(ip, port)
osc_msg = osc_message_builder.OscMessageBuilder
for x in range(10):
msg = osc_msg(address = "/filter")
msg.add_arg(random.random())
msg = msg.build()
client.send(msg)
time.sleep(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment