OSC (vuo.osc)
Nodes for sending and receiving Open Sound Control (OSC) messages.
These nodes allow your composition to send messages to and receive messages from OSC-enabled devices and applications. Devices include sound synthesizers, stage lighting equipment, and control surfaces (including iPhone/iPad and Android apps). Applications include TouchOSC, Lemur, and Vezér.
To use a device or application to remote-control your composition, do one of the following:
- If the device or application supports Bonjour, run the composition, then, in the device or application, select the Vuo composition from its list of available hosts.
- In the device or application, find the UDP port that it’s sending on. In the composition, create a Specify OSC Input node with that port number, and connect it to the Receive OSC Messages node.
- In the composition, create a Specify OSC Input node and set it to use a UDP port of your choice (typically 1024 or higher), then connect it to the Receive OSC Messages node. In the device or application, set it to send on that UDP port.
To use your composition to control a device or application, do one of the following:
- If the device or application supports Bonjour, run the composition, then, in the device or application, select the Vuo composition from its list of available hosts.
- In the device or application, find the UDP port that it’s listening on. In the composition, create a Specify OSC Output node with that port number, and connect it to the Send OSC Messages node.
- To send to just a single device or application, find the IP address and UDP port that it’s listening on. In the composition, create a Specify OSC IP Output node with that IP address and port number, and connect it to the Send OSC Messages node.
- In the composition, create a Specify OSC Output node and set it to use a UDP port of your choice (typically 1024 or higher), then connect it to the Send OSC Messages node. In the device or application, set it to listen on that UDP port.
The UDP port is a number that represents the connection between the OSC sender and receiver. The sender and receiver both need to use the same UDP port. The UDP port is either set manually by the user or discovered automatically through Bonjour.
Each OSC message contains an address and, optionally, one or more data values.
The address is a piece of text beginning with /
. Often, it looks like a file path or part of a URL, for example /1/fader
. It may be used to describe how the data values should be interpreted, for example as positions of a fader control. When using the Filter Address node, Vuo supports case-sensitive wildcard matching.
Each data value is a simple piece of information (integer, real, boolean, or text). For example, a data value of 0.3 accompanying the address /1/fader
could indicate that a fader control has been set to position 0.3.
These nodes are based on the OSC 1.0 specification.
Data types
When receiving OSC values, the following type tags are supported: nil (N
), true (T
), false (F
), float32 (f
), float64/double (d
), int32 (i
), int64 (h
), and OSC-string (s
).
Make Message and Get Message Values nodes have one or more Value
ports with changeable data types. By changing the data types (for example, by right-clicking on the port and selecting from the Set Data Type submenu), you can control the types of OSC data that the node sends or receives.
When you use a Get Message Values node, Vuo converts the OSC data to each Value
port’s data type if possible. For example, if a Value
port is set to the Vuo type Real, then it can handle OSC data of type float64/double, float32, int64, int32, or string, converting it if necessary from an integer or text to a real number.
When sending OSC values, the same data types, except nil, are supported. When you use a Make Message node, Vuo chooses the OSC data type based on each Value
port’s data type together with the corresponding Type
port’s value. When the Type
port is set to Auto
, Vuo uses the following mappings:
Vuo Type |
OSC Data Type |
Boolean |
true (T ) or false (F ) |
Integer |
int64 (h ) |
Real |
float64/double (d ) |
Text |
OSC-string (s ) |
That is, Vuo sends 64-bit integer and real values by default. To send 32-bit values, change the Type
port to Integer (32-bit)
or Floating point (32-bit)
and set the Value
port’s type to Integer
or Real
accordingly.
Example composition:
- Receive OSC: Sets up an OSC server. The OSC messages received cause the rectangle to move. This composition uses TouchOSC installed on a device in the same network as the device running the Vuo composition.
Run the composition. Under the TouchOSC settings, find the OSC: xxx.xxx.x.x connection and choose it. Choose the "Vuo OSC Server." Set up the Layout for "Simple." There are several pages in this layout. Find the one with a yellow rectangle and crosshairs. Move the square at the intersection of cross hairs to see the Vuo rectangle move.
Nodes:
- Filter by Address (vuo.osc.filter.address): Only lets an OSC message pass through if its address matches the Address input port.
- Find OSC Inputs by Name (vuo.osc.find.input.name2): Given a list of OSC input devices, finds the devices whose names match a specified name.
- Find OSC Outputs by Name (vuo.osc.find.output.name2): Given a list of OSC output devices, finds the devices whose names match a specified name.
- Get Message Values (1) (vuo.osc.message.get.1): Outputs the OSC message’s address and first data value.
- Get Message Values (11) (vuo.osc.message.get.11): Outputs the OSC message’s address and first 11 data values.
- Get Message Values (2) (vuo.osc.message.get.2): Outputs the OSC message’s address and first 2 data values.
- Get Message Values (3) (vuo.osc.message.get.3): Outputs the OSC message’s address and first 3 data values.
- Get Message Values (4) (vuo.osc.message.get.4): Outputs the OSC message’s address and first 4 data values.
- Get Message Values (List) (vuo.osc.message.get.list): Outputs the OSC message’s address and a list containing its data values.
- Get OSC Input Values (vuo.osc.get.input): Gives information about an OSC input device.
- Get OSC Output Values (vuo.osc.get.output): Gives information about an OSC output device.
- List OSC Devices (vuo.osc.listDevices): Gives a list of OSC devices on the local network that are capable of sending or receiving data.
- Make Message (1) (vuo.osc.message.make.1): Creates an OSC message with 1 data value.
- Make Message (11) (vuo.osc.message.make.11): Creates an OSC message with 11 data values.
- Make Message (2) (vuo.osc.message.make.2): Creates an OSC message with 2 data values.
- Make Message (3) (vuo.osc.message.make.3): Creates an OSC message with 3 data values.
- Make Message (4) (vuo.osc.message.make.4): Creates an OSC message with 4 data values.
- Make Message (List) (vuo.osc.message.make.list): Creates an OSC message with a list of data values.
- Receive OSC Messages (vuo.osc.receive2): Fires events when OSC messages are received from an input device.
- Send OSC Messages (vuo.osc.send): Sends OSC messages to the network.
- Specify OSC IP Output (vuo.osc.make.output.ip): Connect this node to Send OSC Messages to dynamically choose an OSC device to send to.
- Specify OSC Input (vuo.osc.make.input): Connect this node to Receive OSC Messages to dynamically choose an OSC port to listen on.
- Specify OSC Output (vuo.osc.make.output): Connect this node to Send OSC Messages to dynamically choose an OSC port to broadcast on.