Send OSC Function

Christie Widget Designer Version 6 - Q&A

Moderator: Moderator Group

Forum rules
When asking make sure to include the operating system and the revision of Widget Designer you are using.

Send OSC Function

Postby Benni_M » Sun Oct 11, 2020 1:34 pm

Hello guys,

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.
Benni_M
 
Posts: 148
Joined: Thu Apr 12, 2012 3:45 pm

Return to Widget Designer V6

Who is online

Users browsing this forum: No registered users and 1 guest