Node: OSC Output

From Waltz
Revision as of 20:16, 28 July 2019 by Patrick Angle (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The OSC Output Node allows you to send OSC messages to a remote device or devices. Support for OSC Bundles are present, as is compatibility modes support for disguise media servers and converting Numbers to a compatible type.

OSC message values must be Booleans, Numbers, Strings, a List of those types, or a Map of those types (optionally further nested inside a List). See the Example Usage section for examples of how different combinations of these input types are actually sent as message(s) via OSC.

Settings

Expected Type Details Default
localInterface LocalInterface The local network interface that will be used to send OSC messages. LocalInterface("0.0.0.0")
remoteAddress RemoteAddress/IP The address to which OSC messages should be sent. This can be a unicast or broadcast address. IP("10.10.1.1", 7001)
values Boolean, Number, String, List<Boolean, Number, and/or String>, or Map<Boolean, Number, and/or String> A value, list of values, or map of values to be sent. If a map is provided, its keys will be appended to the end end of the address path for each entry. If this value is left empty or otherwise unresolvable, no message is sent on that frame.
addressPath String The address path for the OSC message(s). If values is a Map, the key for each map entry will be appended to the end of the address path. "/waltz/osc"
d3SanitizationEnabled Boolean A compatibility option for the disguise (d3) media server, which requires all numbers to be represented as floats, all address path parts be lowercase, and each argument be provided in its own message. false
useBundlesEnabled Boolean When enabled, all messages in a frame or in a send(...) call are packaged inside a single OSC bundle. This is useful for applications the synchronize OSC data on the end of a bundle being received. true
castNumbersEnabled Boolean When enabled, Numbers that are backed by a Long or Double are converted to their 32-bit (Integer and Float) forms by means of a forced truncation. This maintains better compatibility with most OSC receivers. If disabled, Long and Double values are instead wrapped in a String and must be converted back to a number by the OSC receiver. true

Parameters

There are no parameters exposed by this node.

Functions

Argument(s) Type Returns Details
send() Void Send an OSC message to this node's destination using the properties configured on this node. This function override the default behavior of not sending a message without a parameter, allowing you to send one-time parameter-less messages.
send(values) Boolean, Number, String, List<Boolean, Number, and/or String>, or Map<Boolean, Number, and/or String> Void Send an OSC message (or messages) to this node's destination using the properties configured on this node. These are sent in addition to the values defined as in the values parameter for this node.

Example Usage

Note: Examples in this section show output messages by indicating the OSC address path, and the value(s) that will be sent via that message. Multiple arguments are serrated by a comma.

Send a single Boolean, Number, or String

Assuming all other parameters are set to their default, when a single Boolean, Number, or String is used in the values field, a single OSC message is sent from this node as follows:

Input values Output Message(s)
false /waltz/osc false
3.14 /waltz/osc 3.14
"Hello" /waltz/osc Hello

Send a List of values

When sending a list of values, each value is sent as an argument on a single message.

Input values Output Message(s)
List(false, 3.14, "Hello") /waltz/osc false,3.14,Hello

Send a List of values with d3SanitizationEnabled

When d3SanitizationEnabled is enabled, each argument that would generally be sent to the same address path will be split and named as follows:

Input values Output Message(s)
List(false, 3.14, "Hello") /waltz/osc0 false

/waltz/osc1 3.14

/waltz/osc2 Hello

Send a Map of values

As previously mentioned, sending a Map for the value will append the key of each entry to the address path, and handle the value as previously shown.

Given the following map of information:

Key Value
isWorking true
answerToLife 42
bestDog "Saint Bernard"
officeLocations List("NY", "SOJ, "TN", "OC", "SF")

The following output can be expected:

Input values Output Message(s)
Map as defined above. /waltz/osc/isWorking true

/waltz/osc/answerToLife 42

/waltz/osc/bestDog Saint Bernard

/waltz/osc/officeLocations NY,SOJ,TN,OC,SF

Send a Map of values with d3SanitizationEnabled

Again, d3SanitizationEnabled can effect a Map in several ways. Using our same sample map from the previous example, notice that the officeLocations entry is split into 5 OSC messages, keeping with the requirement for d3 that each message have a single argument. Also note how capital letters in the OSC address path are automatically converted to lowercase to comply with d3's byzantine stance on capital letters.

Input values Output Message(s)
Map as defined above. /waltz/osc/isworking true

/waltz/osc/answertolife 42

/waltz/osc/bestdog Saint Bernard

/waltz/osc/officelocations0 NY

/waltz/osc/officelocations1 SOJ

/waltz/osc/officelocations2 TN

/waltz/osc/officelocations3 OC

/waltz/osc/officelocations4 SF


Nodes
Devices ArtNet Input · ArtNet Output · Interactive LED Processor · NDI™ Input · NDI™ Output · OSC Input · OSC Output · Projector · SensorLink · TCP · TUIO Output · UDP Input · UDP Output · Watchout Media Server
Objects LED Tile Layout · List · Map · Random Number · Simulated Touch · Timer · Value · Wave
Operators Blend · Change · Clip · Cluster Tracker · DMX Multiverse Merge · Ease · Filter · Hold · JSON Mapper · JSON Stringify · Logic · Math · Proximity · Range · Rotate · Scale · Shear · Smooth · Touch Mapper · Translate
Scenes External Scene · Material Scene
Materials Graph · Touch Material
Scripting Script Function · Script
Comments Comment