OSCbundle

OSCbundle — Sends data to other processes using the OSC protocol by packing messages in a bundle.

Description

Uses the OSC protocol to send one or more messages to other OSC listening processes in a single bundle. Unlike OSCsend, it can be used to send multiple messages at the same time, but only standard OSC numeric types are allowed.

Syntax

OSCbundle kwhen, ihost, iport,
    Sdest[], Stype[],kArgs[][][,isize]

Initialization

ihost -- a string that is the intended host computer domain name. An empty string is interpreted as the current computer.

iport -- the number of the port that is used for the communication.

isize -- maximum packet size in bytes, defaults to 65536.

Performance

kwhen -- a bundle of messages is sent whenever this value changes. A message will always be sent on the first call.

Sdest[] -- an array of strings containing the destination address for each message. Length must agree with Stype[].

Stype[] -- an array of strings containing the types for each message. Only numeric types ('i' for integers and 'f' for floats) are supported. Length must agree with Sdest[].

kArg[][] -- a two-dimensional array containing the arguments for each message. Its dimension 1 (number of rows) must agree with Sdest[] and Stype[]. Its dimension 2 (number of columns) must be large enough to accommodate the message with the largest number of arguments. Each row should contain the arguments for the types of each message. If a row contains fewer arguments, any remaining data items are filled with zeros. Arguments in excess of what each type string requires are ignored.

Example

Here is an example of the OSCBundle opcode. It uses the file oscbundle.csd.

Example 692. Example of the OSCbundle opcode.

See the sections Real-time Audio and Command Line Flags for more information on using command line flags.

<CsoundSynthesizer>
<CsOptions>
-odac
</CsOptions>
<CsInstruments>

instr 1
Sdest[] init 2
Stype[] init 2
kdata[][] init 2, 2

Sdest[0] = "/test/floats"
Sdest[1] = "/test/ints"
Stype[0] = "ff"
Stype[1] = "ii"

kdata fillarray 1,2,3,4

OSCbundle  1, "localhost", 7000, Sdest, Stype, kdata
endin

</CsInstruments>
<CsScore>
i1 0 1
</CsScore>
</CsoundSynthesizer>


See Also

OSClisten, OSCinit

Credits

Author: Victor Lazzarini
2018