How to form OSC Command TO QLC+4

Ask a generic question about the usage of QLC+, not related to a particular operating system
Post Reply
chq
Posts: 3
Joined: Wed Apr 21, 2021 2:48 pm
Real Name: Stuuu

Hi. I hope this is in the right place.

I'm on Windows and have been using QLC for years, but recently we're looking to explore the possibility of UDP commands using the OSC input. I've searched the forum but can't seem to hit the nail on the head.

Must confess to being a complete novice, so apologies about that. I've managed to successfully send commands to QLC and get them to turn on - and reliably too.


Sent via python-

Code: Select all

message= "Test Button 2\0,i\0\0\0\x00\x00\xFF"
Once I map this button using the input profile editor (wizard mode where it auto detects), I can run the above script in python and it will toggle the button (so turn it on if its off and run again to reverse it) in Virtual Console.

This bit of code (

Code: Select all

message= "Test Button 2\0,i\0\0\0\x00\x00\xFF"
) I found on the forum, and after lots of trial and error it worked.

My question is, what is the code doing? What information is QLC expecting and in what order? Is there a list of information somewhere in a help doc?

Our ideal is to have a panel of buttons on the Virtual control panel which can be controlled in person OR via UDP/OSC command.

Any help appreciated.
User avatar
mcallegari
Posts: 4711
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

There's no "help doc" for everything.
You're developing something and, as such, you're supposed to look also at the code on the other end:
https://github.com/mcallegari/qlcplus/t ... lugins/osc

Also, I suggest to study a bit how OSC works:
https://web.archive.org/web/20030914224 ... -spec.html

QLC+ accepts any OSC path in input. You can detect them via input profile wizard.
Launching QLC+ with the -d option will also give you some more information about data received.

There are a few discussions in these forums about OSC and developments
chq
Posts: 3
Joined: Wed Apr 21, 2021 2:48 pm
Real Name: Stuuu

Very much appreciate the reply, I understand I'm a novice at this stuff haha.

I'll dive in to the resources and see if I can enhance my understanding.
Bigfoot
Posts: 2
Joined: Mon Jan 04, 2021 5:17 pm
Real Name: Pascal Lefèvre

Maybe I can be of help with my very first post :shock: in this forum even though the question from chq is already 2 months old.

QLC+ is really a great piece of software and OSC is in addition a very cool and easy possibility to remote control QLC+. The OSC specification is not too complex and you even need just a subset from it as several options are not needed for QLC+.

The message you need to send is composed from 3 parts:
1. OSC Address Pattern
2. OSC Type Tag String
3. OSC Arguments

- The OSC Address Pattern is a simple 4-byte aligned text string terminated by \0 (zero character) starting with the character ‘/’ (forward slash) followed by any text. As OSC is organized hierarchically it makes sense to build the strings like this: “/<root>/<subroot>/.../<leaf>” (e.g. “/homecinema/light/ambient/full”).
- The OSC Type Tag String is a 4-byte aligned character string starting with ‘,’ specifying the OSC Arguments. For QLC+ only ‘i’ (int32) is useful from my perspective as ‘s’ (string) is not handled by OLC+ and other types doesn’t make sense. With the 4-byte alignment you’ll have a character sequence like this: “,i\0\0” (characters ‘,’ and ‘i’ followed by 2 zero characters)
- The OSC Argument(s) is with the knowledge of the OSC Type Tag String just one (32-bit) Integer in our case. If you want to trigger a button just use a fixed value of 255 (Hex: 0xFF). In case you want to remote control a slider any value from 0 to 255 is fine depending where the slider should go. The representation of a 32-bit Integer with value 255 is: “\0x00 \0x00 \0x00 \0xFF”.

Now we have all the components and can combine the String for the message which would look like this in our example: “/homecinema/light/ambient/full\0\0,i\0\0\0x00\0x00\0x00\0xFF”. :!: Note the two zero characters behind the address. One is the required termination character and the second one is the padding zero to get the address aligned to 4 Bytes (32 Bytes in total).

If you search the internet there are a several code snippets available in different languages creating a OSC message from these 3 components taking care for padding the correct number of zeros into the message string.

I’m wondering that the given example from this thread works as the alignment is not correct for the OSC Address Pattern.

I hope this will be of help
chq
Posts: 3
Joined: Wed Apr 21, 2021 2:48 pm
Real Name: Stuuu

Hey Bigfoot!

Thanks for the response - I'll always take the advice!

Thank you for breaking it down - I was trying to understand what I was telling it to do (as I found the command online).

I've managed to incorporate it into our project and now it can command buttons from our 3rd party piece of software that I'm making.
Keith
Posts: 8
Joined: Sun Feb 27, 2022 6:00 pm
Real Name: Keith

Hello I know it's been a while since this was posted but I am starting down this road of controlling qlcplus from Python and wondered if you could give more details on how you did it. I do not have OSC installed so I need to start there.
Post Reply