i wrote some functions to send OSC messages without to using a node.
For me it makes more sense to have a OSC function than a node.
just create a function and copy paste the code.
Name: OSCwithoutArguments
Parameters: address,port
- Code: Select all
var address_osc = address.ToString
var list = [0]
address_osc += list.DecodeBytes
for i = 0 to 4
{
var count = address_osc.EncodeBytes.Count
var modulo = Math.Mod(count,4)
if modulo = 0
{
break
}
else
{
address_osc += list.DecodeBytes
}
}
address_osc += ","
address_osc += list.DecodeBytes
UdpSendToPort(port.ToInteger,address_osc)
Name: OSCwithInt
Parameters: address, argument, port
- Code: Select all
var address_osc = address.ToString
var list = [0]
address_osc += list.DecodeBytes
for i = 0 to 4
{
var count = address_osc.EncodeBytes.Count
var modulo = Math.Mod(count,4)
if modulo = 0
{
break
}
else
{
address_osc += list.DecodeBytes
}
}
address_osc += ","
address_osc += "i"
address_osc += list.DecodeBytes
address_osc += list.DecodeBytes
var arg_result = ""
var list_arguments = argument.ToList
var arg = list_arguments[0].ToList.DecodeBytes
for i = 0 to 4
{
var arg_count = arg_result + arg
var count = arg_count.ToString.EncodeBytes.Count
var modulo = Math.Mod(count,4)
if modulo = 0
{
address_osc += arg_result + arg
break
}
else
{
arg_result += list.DecodeBytes
}
}
UdpSendToPort(port.ToInteger,address_osc)
Name: OSCwithString
Parameters: address, argument, port
- Code: Select all
var address_osc = address.ToString
var list = [0]
address_osc += list.DecodeBytes
for i = 0 to 4
{
var count = address_osc.EncodeBytes.Count
var modulo = Math.Mod(count,4)
if modulo = 0
{
break
}
else
{
address_osc += list.DecodeBytes
}
}
address_osc += ","
address_osc += "s"
address_osc += list.DecodeBytes
address_osc += list.DecodeBytes
address_osc += argument.ToString
for i = 0 to 4
{
var count = address_osc.EncodeBytes.Count
var modulo = Math.Mod(count,4)
if modulo = 0
{
break
}
else
{
address_osc += list.DecodeBytes
}
}
UdpSendToPort(port.ToInteger,address_osc)
Worked with Qlab and Companion for press buttons or Change button Text.
If you have questions let me know
Hope the OSC function in Widget Designer will be more nice in the upcoming releases
Best regards,
Benni M.