Navigation:  Widget Designer > Devices > OSC >


prev main next

Navigation:  Widget Designer > Devices > OSC >


prev main next


The OSC UDP device in the Configuration dialog allows to set up a connection to another OSC device with an enabled UDP server or client service. The IP and ports are scriptable, allowing the OSC UDP device to connect to various devices on the fly. Incoming messages, e.g. feedback or status information can be received via Event Listeners or the OSC UDP input node. Messages can be sent using Widget Designer's scripting or OSC UDP output node. Using the OSC Table is optional.

Note that the device is only available in the licensed Widget Designer edition, not the Free version.

Adding a New OSC UDP Device

To add an OSC UDP device, open the Devices menu and select "OSC > UDP > Create UDP". This will open the Configuration dialog. Alternatively, you can add a new OSC UDP device in the Configuration dialog with the "+" button when the dialog is already open.

In the dialog, the left side lists all devices and connections that were already added to the project. The circle in front of the entry symbolizes the current connection status; note that UDP is a stateless protocol and therefore has no connectivity status as known from the TCP protocol:


The OSC UDP device is enabled and active.


The connection or device is disabled, i.e. the "Enable" box is not checked.

On the right side you see several options:


The Type informs you about the type of device or connection.

The Name is the unique identifier for this object in WD and the general rules for naming objects apply here as well: only letters, numbers and underscores are allowed; the first symbol must be a letter.
It is possible to change the default name to a more descriptive one. When scripting, enter this Name to access available members or use the Project object and device Type instead; examples are shown further down.

The Id offers an alternative way to address the device when scripting.

The "Enable" check box is ticked per default and can be used to disable the device or connection internally.

Now, please enter the Local Port, which is the source port this device listens on. In addition, this defines the sending port in case you are sending messages.

Next, enter the IP Address and Remote Port (i.e. the receiving port) of the remote UDP server. This defines the destination of messages you are sending.

Now, please enter the IP Address and Port of the remote OSC UDP device.

The option "Send each message as bundle" toggles whether outgoing values are sent as OSC (single) messages or OSC bundles. Some OSC devices can only receive bundles.

Click the "Apply" button to save any changes done here. The shortcut [Ctrl + Enter] can also be used to apply changes. Once the settings are applied, the dialog can be closed. The newly created connection will also be added to the Devices menu > OSC > UDP and can be opened from here or with the Devices menu > Configuration.

Using the Device in Regular Scripting

As soon as a device is created, it can be addressed via scripting.

To send messages to the connected OSC UDP device, for example, create a CustomScript button or use anything with a scripting field. Enter the device's identifier name into the script field (per default that is "OSC_UDP1") and Script Assist will offer a list of all OSC UDP Members.

To send a message, you have two choices. The first is using the member "Send" which refers to an "OSC Table" where you can define the OSC address and parameter types and refer to them as aliases; see description "Send").
The second scripting possibility allows to define all this information in one step. Again, there is a verbose description for the member "SendRaw". In short, the following example uses the OSC address "/1/fader1", defines the following parameters as a string (=s) and integer (=i) and sends the values wrapped in a list: "Hi" and 10.

Literal text should always be enclosed in either single or double quotation marks; otherwise, the text is handled like a variable. The next example sends only one value (still in the list format) and shows how to convert the global variable "Now", which holds the current date and time, to a string.


As an alternative to explicitly naming the connection, the "Project" object can be used. Choose the connection type and address the connection by entering its ID or name. Script Assist then offers you the same list of members. This is the alternative for the first example from above:

Substituting the ID with a dynamic variable allows automation. Actions can be performed on many connections of the same type simultaneously, e.g. by using for-loops:
For i = 1 to 10 {



The chapter "Project and Context Member" shows more examples with for-loops and if-clauses; of course, normal variables can also be used.

Using the Connection with Event Listeners

Event Listeners can be added in the Configuration dialog and provide the easiest way to handle incoming messages.

Please see the chapter Event Listener for a detailed description of its functionality and OSC UDP Events for an overview (with examples and description) of the available events.

Using the Device in the Node System

The OSC UDP input node refers to this device connection when the according ID is entered. It shows incoming messages. In the same way, the OSC UDP output node refers to this connection and sends messages. In difference to the input node, the OSC Code Table is not only optional but essential.
Please see the chapter "Tutorial: Nodes" for information about the node system.