Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Processing and OSC
import netP5.*;
import oscP5.*;
OscP5 oscP5;
NetAddress remoteIP;
void setup() {
size(400, 400);
frameRate(30);
/* Start our sender on the Default Isadora port (1234)*/
oscP5 = new OscP5(this, 1234);
/* Set our remoteIP */
remoteIP = new NetAddress("127.0.0.1", 1234);
}
void draw() {
background(0);
}
void mousePressed() {
/* Create a new bundle that we can fill up */
OscBundle myBundle = new OscBundle();
/* Create a new message object in our bundle with the correct path */
OscMessage myMessage = new OscMessage("/test");
myMessage.add(random(1, 10));
/* Add it back to our bundle */
myBundle.add(myMessage);
myMessage.clear();
/* Send it away ! */
oscP5.send(myBundle, remoteIP);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment