import oscP5.*; // these two 'global' variables will hold the data we get from the OSC port float x; float y; OscP5 oscP5; void setup() { // setup code here... // we're using port # 7878 // the Max/MSP udpsend object will need to use that port # too oscP5 = new OscP5(this, 7878); } void draw() { // drawing code here... } void oscEvent(OscMessage theOscMessage) { if (theOscMessage.checkAddrPattern("/xval")) { x = theOscMessage.get(0).floatValue(); } if (theOscMessage.checkAddrPattern("/yval")) { y = theOscMessage.get(0).floatValue(); } }