Skip to content

Instantly share code, notes, and snippets.

@cansik
Created November 18, 2015 22:28
Show Gist options
  • Save cansik/2ee391d7b4f0531569b6 to your computer and use it in GitHub Desktop.
Save cansik/2ee391d7b4f0531569b6 to your computer and use it in GitHub Desktop.
import oscP5.*;
import netP5.*;
OscP5 oscP5;
NetAddress myRemoteLocation;
void setup() {
size(400, 400);
frameRate(25);
oscP5 = new OscP5(this, 9000);
myRemoteLocation = new NetAddress("127.0.0.1", 8000);
}
void draw() {
background(0);
}
void keyPressed() {
if (key == ' ')
{
OscMessage myMessage = new OscMessage("/getControls?root=/surfaces/handles&recursive=1");
//OscMessage myMessage = new OscMessage("/getControlValues?url=/surfaces/Quad 1/handles/.*&normalized=1");
oscP5.send(myMessage, myRemoteLocation);
//oscP5.send(myRemoteLocation, myMessage);
println("sending...");
}
}
void oscEvent(OscMessage theOscMessage) {
println("message received!");
theOscMessage.print();
}
void oscBundleEvent(OscBundle bundle)
{
println("bundle received!");
for(OscMessage m : bundle.getMessages())
{
m.print();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment