oscsend
Sends data to other listening processes using the OSC protocol.
Note
Up to Csound 6, this opcode was called OSCsend.
Syntax
Initialization
ihost -- a numeric IPv4 address or localhost. Use oscsendlo for hostname lookup or an empty string for the local computer.
iport -- the number of the port that is used for the communication.
idestination -- a string that is the destination address. This takes the form of a file name with directories. Csound just passes this string to the raw sending code and makes no interpretation.
itype -- a string that indicates the types of the optional arguments that are read at k-rate. The string can contain the characters "abcdfilmstAG" which stand for audio, Boolean, character, double, float, 32-bit integer, 64-bit integer, MIDI, string, timestamp, k-rate array and ftable. The OSC message may not have any types, in which case, it will consist only of the destination address.
Performance
kwhen -- a message is sent whenever this value changes. A message will always be sent on the first call.
The data is taken from the k-values or a-value that follow the format string. In a similar way to a printf format, the characters in order determine how the argument is interpreted. Note that a time stamp takes two arguments.
Examples
This instrument sends one message with three arguments to UDP port 7770 on the local computer. The receiver must listen for /foo/bar with types sis.
Here is a complete example of the oscsend opcode. It uses the file oscsend-modern.csd.
Here is a complete example of the OSCsend opcode. It uses the file OSCsend.csd.
See also
oscsendlo uses liblo and differs in its Boolean and timetag formats. See its comparison table before changing senders.
More information on this opcode: http://www.youtube.com/watch?v=JX1C3TqP_9Y, made by Andrés Cabrera
Credits
Author: John ffitch
2005
Data types a, A and G were added in 6.07; they send data via blobs and are only really useful to other Csound instances or custom listeners.