OSC Plugin, calculating the 16 bit checksum of the OSC string

Ask a generic question about the usage of QLC+, not related to a particular operating system
Post Reply
gabonacorp
Posts: 3
Joined: Fri Sep 21, 2018 8:41 pm
Real Name: Andras Heilig

Hi all,

I try to control a software with QLC+ via OSC. With createing an input profile and useage of the input - feedback combo I already reached my goal. I can capture the OSC strings and their custom channel numbers with the input profile wizard but now I have a problem.

Technically I capture the OSC feedbacks of the software. But there are some feature in the software which can be fired via OSC but it is not sends back any feedback so I can not capture it. I found this thread http://www.qlcplus.org/forum/viewtopic. ... 418#p39418 where Massimo mentioned this:
So, how did I resolved paths into QLC+ numbers ? By calculating a 16bit checksum of a string !
A purist might say this is a weak mechanism, cause you can "easily" run into collisions, but I think 65535 cases should be enough to avoid bad statistics. ;)
When a OSC signal enters QLC+ the checksum is calculated, so you will see a number in the UI.
But the interesting thing is when a feedback goes out. Obviously OSC understand paths, not numbers, so I re-use the original OSC path !
I know the OSC string which I sould have it's custom channel number so now I just need a tool where I can get the unique 16 bit checksum aka the custom channel.

Dear developers, could you somehow create a holy place where I can translate my OSC strings and get this unique channel numbers? I would be really gladful!

Thanks and wish you the best,

Andras
janosvitok
Posts: 1325
Joined: Mon Apr 13, 2015 7:05 am
Location: Bratislava, Slovakia
Real Name: Jano Svitok
Contact:

Andras,

the hash is qChecksum from QT, and it is in fact CRC-16 with these parameters (see https://bugreports.qt.io/browse/QTBUG-8595):

const int order = 16;
const unsigned long polynom = 0x1021;
const int direct = 1;
const unsigned long crcinit = 0xffff;
const unsigned long crcxor = 0xffff;
const int refin = 1;
const int refout = 1;

I'm writing this so that if you have a CRC implementation that allows to choose parameters, you may compute the hash yourself.

Jano
janosvitok
Posts: 1325
Joined: Mon Apr 13, 2015 7:05 am
Location: Bratislava, Slovakia
Real Name: Jano Svitok
Contact:

You may check https://crccalc.com/ click CRC16 and use row CRC-16/X-25. I have not tested it though. If you do, please let us know if their result matches QLC+'s.

Jano
gabonacorp
Posts: 3
Joined: Fri Sep 21, 2018 8:41 pm
Real Name: Andras Heilig

Hi Janos (it would be really funny if you would be Hungarian just like me :) ),

First of all thank you for your help. I checked the site but I am not really familiar with checksums so I can not find a result what is matches with my test string.

My test string is /md/selected/opacity which has channel number 3192 in QLC.

But during my sleep I figured out a possible solution. I can send custom OSC strings with app called Vezér or with Qlab. So I made a test with the above string and QLC was able to capture it and the channel number result was the same so now I am gonna simply send and capture the needed OSC string via Vezér so I will have the channel number and I can manually enter it into my button. I hope it is gonna work.

I will keep you updated.

Thanks and wish you the best,

Andras
gabonacorp
Posts: 3
Joined: Fri Sep 21, 2018 8:41 pm
Real Name: Andras Heilig

Yeah, my idea was compleately worked. I just finish the path of all the functions what I want to control with QLC.

Thank you for the help!
janosvitok
Posts: 1325
Joined: Mon Apr 13, 2015 7:05 am
Location: Bratislava, Slovakia
Real Name: Jano Svitok
Contact:

I'm not Hungarian, I'm from "next door" -- Slovakia. Jano is my name and Svitok surname.

Jano
Post Reply