import oscP5.*; // Import the OSC Libary
import netP5.*; // Import the net Library
OscP5 oscP5; // Make an instance of the OSC Library
NetAddress myRemoteLocation; // Set a net Address
void setup()
{
size(400, 400);
oscP5 = new OscP5(this, 0000); // start oscP5, listening for incoming messages at port 12000
myRemoteLocation = new NetAddress("172.31.224.95", 1111); // The Address defined here is the Address of the Receiver
}
void draw()
{
background(0);
sendOSC(255);
}
void sendOSC(int theData)
{
OscMessage myMessage = new OscMessage("Moritz"); // New Message
myMessage.add(theData); // Add Data
oscP5.send(myMessage, myRemoteLocation); // Send Message
}
|