Page 1 of 1

OSC ouput don't work with old python script

Posted: Sun Jan 03, 2016 2:37 pm
by sbenejam
Today I tested an old python script that I made to control an external program. And did not work. Something is changed on qlcplus versions since 4.9. The script works with qlcplus 4.8.5 and don't work with newer versions.
The python script uses python-liblo, I tested too with a python script that uses pyOSC module and I get this error: "OSCMessage's typetag-string lacks the magic ','". I tested qlcplus 4.10.2 and I can send osc data from my laptop to a qlcplus on other computer. I tested too qlcplus with TouchOSC input and feedback and this setup works. My laptop runs Xubuntu 15.10 and the desktop Ubuntu 14.10.
I think something changed in OSC plugin since qlcplus 4.9.

Re: OSC ouput don't work with old python script

Posted: Sun Jan 03, 2016 4:26 pm
by janosvitok
Santiago,

can you please attach your script (or a simplified one) that reproduces the problem? Ideally both versions (using liblo and pyOSC).

Re: OSC ouput don't work with old python script

Posted: Sun Jan 03, 2016 4:26 pm
by sbenejam
janosvitok wrote:Santiago,

can you please attach your script (or a simplified one) that reproduces the problem? Ideally both versions (using liblo and pyOSC).
Hi Jano,
Hera are the files, remove the final ".txt"

Re: OSC ouput don't work with old python script

Posted: Sun Jan 03, 2016 5:48 pm
by sbenejam
I have found this in osc_lib.py file of pyOSC package.

if not typetags.startswith(","):
raise OSCError("OSCMessage's typetag-string lacks the magic ','")

Re: OSC ouput don't work with old python script

Posted: Mon Jan 04, 2016 10:39 am
by mcallegari
Hi Santiago

The OSC plugin has been completely rewritten on version 4.9.0. However it works with TouchOSC and PureData

This is where the "," is added
https://github.com/mcallegari/qlcplus/b ... er.cpp#L48

It is annoying, but what you can do is to save two traces with wireshark: one with QLC+ 4.8.5 and one with 4.10.2b and compare the packets.
I expect the syntax to be the same, but let's double check it.

[EDIT] Also, are you using a custom Input Profile ? If so, can I have a look please ?

Re: OSC ouput don't work with old python script

Posted: Mon Jan 04, 2016 6:53 pm
by sbenejam
A quick look to the packets captured seems that the packets length are not exactly the same. Remove .txt extension.
I hope that helps to identify the problem

Re: OSC ouput don't work with old python script

Posted: Tue Jan 05, 2016 8:28 pm
by mcallegari
Thank you very much Santiago.
The traces show indeed a difference of bytes after the OSC path.
In QLC+ 4.8.5 there are four zeroes after /0/dmx/0, while on QLC+ 4.10.2 there is none.
Most likely it is wrong according to the OSC specifications.

Please try this.
Change this line:
https://github.com/mcallegari/qlcplus/b ... er.cpp#L45

Like this one:
https://github.com/mcallegari/qlcplus/b ... er.cpp#L70

And see if it works.

Re: OSC ouput don't work with old python script

Posted: Wed Jan 06, 2016 7:20 am
by sbenejam
It works. ;-)
Changed the line compiled qlcplus 4.10.3 GIT. Now works ok.

Thanks Massimo.

Re: OSC ouput don't work with old python script

Posted: Thu Jan 07, 2016 6:48 am
by sbenejam
One more question on this topic. In qlcplus 4.8.5 the values sent are between 0.0 - 1.0 in qlcplus 4.10.3 are 0.0 - 255.0.

Is this correct?.

Re: OSC ouput don't work with old python script

Posted: Fri Jan 08, 2016 7:27 am
by mcallegari
Uhm...well, technically a float number can range between 0 and 255, but if QLC+ 4.8.5 (which used liblo) ranged from 0 to 1.0, then we should probably go back to that behaviour.

I'll come up with a fix as soon as I can

Re: OSC ouput don't work with old python script

Posted: Fri Jan 08, 2016 7:45 am
by plugz
mcallegari wrote:I'll come up with a fix as soon as I can
Done.

Re: OSC ouput don't work with old python script

Posted: Sat Jan 09, 2016 7:16 am
by sbenejam
Tested, works ok.
I will publish later a python script that can be used to convert QLC+ OSC output to OSC strings to control other programs, for example non-mixer.