diff options
author | David Runge <dave@sleepmap.de> | 2015-12-31 03:34:08 +0100 |
---|---|---|
committer | David Runge <dave@sleepmap.de> | 2015-12-31 03:34:08 +0100 |
commit | 589e6c881bd2cf11e8615e9c1bf8cb4012293bad (patch) | |
tree | 407d617ed861a61d64e64f7d581052f90b10e981 /libraries/oscP5/examples/oscP5flush | |
parent | 6a713ba6966eee4cf7bb9fb9e1513918fc94b528 (diff) | |
download | processing-sketchbook-589e6c881bd2cf11e8615e9c1bf8cb4012293bad.tar.gz processing-sketchbook-589e6c881bd2cf11e8615e9c1bf8cb4012293bad.tar.bz2 processing-sketchbook-589e6c881bd2cf11e8615e9c1bf8cb4012293bad.tar.xz processing-sketchbook-589e6c881bd2cf11e8615e9c1bf8cb4012293bad.zip |
libraries/oscP5: Adding oscP5 library for OSC capabilities.
Diffstat (limited to 'libraries/oscP5/examples/oscP5flush')
-rw-r--r-- | libraries/oscP5/examples/oscP5flush/oscP5flush.pde | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/libraries/oscP5/examples/oscP5flush/oscP5flush.pde b/libraries/oscP5/examples/oscP5flush/oscP5flush.pde new file mode 100644 index 0000000..e6e8147 --- /dev/null +++ b/libraries/oscP5/examples/oscP5flush/oscP5flush.pde @@ -0,0 +1,38 @@ + /** + * oscP5flush by andreas schlegel + * example shows how to send osc messages without having to instantiate an oscP5 object. + * this can be useful if you are not listening for incoming messages and you + * want to avoid to have the additional oscP5 thread running listening for incoming + * message (which you wont need if you are only sending messages). + * oscP5 website at http://www.sojamo.de/oscP5 + */ + +import oscP5.*; +import netP5.*; + + +NetAddress myRemoteLocation; +void setup() { + size(400,400); + frameRate(25); + /* set up a remote location */ + myRemoteLocation = new NetAddress("127.0.0.1",12000); +} + + +void draw() { + background(0); +} + + +void mousePressed() { + /* create a new OscMessage with an address pattern, in this case /test. */ + OscMessage myOscMessage = new OscMessage("/test"); + + /* add a value (an integer) to the OscMessage */ + myOscMessage.add(100); + + /* send the OscMessage to the remote location. + */ + OscP5.flush(myOscMessage,myRemoteLocation); +} |