Implementing the OSC messages receiver
To implement the receiving of OSC messages in the VideoSynth
project, perform the following steps:
Include the
ofxOsc
addon's header to theofApp.h
file by inserting the following line after the#include "ofxGui.h"
line:#include "ofxOsc.h"
Add a declaration of the OSC receiver object to the
ofApp
class:ofxOscReceiver oscReceiver;
Set up the OSC receiver in
setup()
:oscReceiver.setup( 12345 );
The argument of the
setup()
method is the networking port number. After executing this command,oscReceiver
begins listening on this port for incoming OSC messages. Each received message is added to a special message queue for further processing.Note
A networking port is a number from 0 to 65535. Ports from 10000 to 65535 normally are not used by existing operating systems, so you can use them as port numbers for OSC messages. Note that two programs receiving networking data and working on the same computer must have different port numbers.
Add the processing of incoming...