Node: OSC Input
Note that this node has slightly different behavior across different platforms due to fundamental differences in how *nix and Windows-based systems handle receiving broadcast messages. See Platform Dependent Networking Quirks for more information.
The UDP Input node allows you to receive UDP messages from devices on your network, and process those messages as appropriate by defining a piece of script that handles incoming messages.
Incoming UDP messages must end with a \n
newline character. The newline character is stripped from the message and not included in the message provided for processing in the callback
.
Parameters
Expected Type | Details | Default | |
---|---|---|---|
localInterface
|
LocalInterface | The local network adapter that will be used to UDP messages. | LocalInterface("0.0.0.0")
|
localPort
|
Number | The local port on which UDP messages will be received. | 1234
|
callback
|
Any | A script in which a single additional variable, message , is present containing the message to be processed.
|
print(message);
|
Outputs
There are no outputs exposed by this node. Each received message is processed by the script defined as the callback
.
Functions
There are no functions exposed by this node.
Example Usage
Splitting values from messages
In situations where you are receiving multiple values in a single UDP message, for example a situation in which the x
, y
, and z
of a set piece is being sent to Waltz, you may need to split the message
into separate values. This can be easily achieved with a small Script Expression in the callback
.
Assuming the message
is 3,4,5
, the following script can separate the message
and store them to three different Value Nodes named xValue
, yValue
, and zValue
:
var values = message.split(","); $.xValue.valueExpression = values[0]; $.yValue.valueExpression = values[1]; $.zValue.valueExpression = values[2];
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 |