import oscP5.*; import netP5.*; OscP5 oscP5; NetAddress myRemoteLocation; void setup() { size(400, 400); background(102); frameRate(25); oscP5 = new OscP5(this,6600); myRemoteLocation = new NetAddress("127.0.0.1",6600); } void draw() { stroke(255); if(mousePressed) { line(mouseX, mouseY, pmouseX, pmouseY); OscMessage myMessage = new OscMessage("/draw"); /* new message */ myMessage.add(mouseX*1.0); /* add x coordinate to the message*/ myMessage.add(mouseY*1.0); /* add x coordinate to the message*/ oscP5.send(myMessage, myRemoteLocation); /* send the message */ } } /* incoming osc message are forwarded to the oscEvent method. */ // void oscEvent(OscMessage theOscMessage) { // print("### received an osc message."); // print(" addrpattern: "+theOscMessage.addrPattern()); // println(" typetag: "+theOscMessage.typetag()); // println("XVal = "+theOscMessage.get(0).intValue()); // println("YVal = "+theOscMessage.get(1).intValue()); // }