For some IO-Connections are special functions avaiable.
OSC:
OSC.send("address", variable);
To send a OSC value from a script you need to define the address/path and a value what you whant to send.
The type of the value is depending of the type of your variable.
Example Float:
If you want to send the value 123,456 to the OSC address/path “/SP/Test” it need to look like these:
OSC.send("/SP/Test", 123.456);
Example Int:
If you want to send the value 123 to the OSC address/path “/SP/Test” it need to look like these:
OSC.send("/SP/Test", 123);
Example String:
If you want to send the value “Hello” to the OSC address/path “/SP/Test” it need to look like these:
OSC.send("/SP/Test", "Hello");
Example Color:
If you want to send the value green to the OSC address/path “/SP/Test” it need to look like these:
[R, G, B, A]
OSC.send("/SP/Test", [0, 1, 0, 1]);
Example Vector:
If you want to send the value X=1, Y=2, Z=3 to the OSC address/path “/SP/Test” it need to look like these:
[X, Y, Z]
OSC.send("/SP/Test", [1, 2, 3]);
Example Point:
If you want to send the value X=1, Y=2 to the OSC address/path “/SP/Test” it need to look like these:
[X, Y]
OSC.send("/SP/Test", [1, 2]);
Example Bool:
If you want to send the value “true” to the OSC address/path “/SP/Test” it need to look like these:
true = 1, false = 0
OSC.send("/SP/Test", 1);
UDP:
UDP.send(variable);
To send a UDP variable from a script you need to the following:
UDP.send(123.456); for a Float
UDP.send(123); for a Integer
UDP.send("Hello"); for a String
UDP.send([variable0, variable1, …, variableN]); for a Array
UDP.send(1); for a Bool
UDP.sendBytes([byte0, byte1, …, byteN]);
To send bytes with the UDP sender.
UDP.sendHex("7370"); or UDP.sendHex("0×7370");
To send “sp” as Hex with the UDP sender.
TCP:
TCP.send(variable);
To send a TCP variable from a script you need to the following:
TCP.send(123.456); for a Float
TCP.send(123); for a Integer
TCP.send("Hello"); for a String
TCP.send([variable0, variable1, …, variableN]); for a Array
TCP.send(1); for a Bool
TCP.sendBytes([byte0, byte1, …, byteN]);
To send bytes with the TCP sender.
TCP.sendHex("7370"); or UDP.sendHex("0×7370");
To send “sp” as Hex with the TCP sender.