Page 1 of 1

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

Posted: Fri Sep 21, 2018 8:56 pm
by gabonacorp
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

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

Posted: Fri Sep 21, 2018 10:37 pm
by janosvitok
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

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

Posted: Fri Sep 21, 2018 10:40 pm
by janosvitok
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

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

Posted: Sat Sep 22, 2018 8:11 am
by gabonacorp
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

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

Posted: Sat Sep 22, 2018 2:09 pm
by gabonacorp
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!

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

Posted: Mon Sep 24, 2018 7:31 am
by janosvitok
I'm not Hungarian, I'm from "next door" -- Slovakia. Jano is my name and Svitok surname.

Jano