Page 1 of 1

QLC+ API Python

Posted: Sun Jul 07, 2024 4:18 pm
by LukHan
Hey,

hope someone can give me an overview. I try to control my light via Python. I found a workaround with the webAPI and a program called "postman". I would like to start/stop and also manipulate programs within Python to trigger the light based on decision made by a neural network.

Is there a kind of "live consol" wich I can use with c++?

Maybe someone recommend OLA? It seems like there is an integrated Python API for OLA.

Thanks for help!

Re: QLC+ API Python

Posted: Mon Jul 08, 2024 7:07 am
by mcallegari
[moderator] please read the "community" section description before posting. It's definitely the wrong place to post a support request. Moving to the proper area.

Re: QLC+ API Python

Posted: Mon Jul 08, 2024 10:14 am
by GGGss
LukHan wrote: Sun Jul 07, 2024 4:18 pm to trigger the light based on decision made by a neural network.
You got my attention now. ;-) I did create quite some solutions for when venue visitors transited from the foyer to the ballroom, mostly by using infrared detectors.
LukHan wrote: Sun Jul 07, 2024 4:18 pm Is there a kind of "live consol" wich I can use with c++?
Unless you fork deeply into the source code on github, there is no interaction possible except for the inbuilt tools, which are the web-API: https://www.qlcplus.org/Test_Web_API.html
LukHan wrote: Sun Jul 07, 2024 4:18 pm Maybe someone recommend OLA? It seems like there is an integrated Python API for OLA.
OLA is one thing; OSC is well-supported in Python and has built-in libraries at your disposal. I would keep your neural network separated, simply outputting commands to your light/sound/video QLC+ console. By using input profiles, you quickly will have a running solution.

Keep us posted about your progress.

Re: QLC+ API Python

Posted: Thu Jul 11, 2024 6:03 pm
by LukHan
Thanks for your contribution.
GGGss wrote: Mon Jul 08, 2024 10:14 am
OLA is one thing; OSC is well-supported in Python and has built-in libraries at your disposal. I would keep your neural network separated, simply outputting commands to your light/sound/video QLC+ console. By using input profiles, you quickly will have a running solution.
So in the Web API I see 14 functions I can use. Most of them are "get" functions. Do I have more options with OSC? My question is where do I have the most options to control and manipulate the functions in QLC+ with python. I am thinking of speed up or slow down functions, BPM adaption and so on. Not only activate or deactivate a button.

Just an overview question before I start to deep dive into that stuff.
GGGss wrote: Mon Jul 08, 2024 10:14 am Unless you fork deeply into the source code on github..
.. and thats the part I would love to skip :D I think my C++ skills are way too basic to understand the QLC+ source code in that way.

Re: QLC+ API Python

Posted: Thu Jul 11, 2024 6:10 pm
by LukHan
mcallegari wrote: Mon Jul 08, 2024 7:07 am [moderator] please read the "community" section description before posting. It's definitely the wrong place to post a support request. Moving to the proper area.
how do I move the request?

Re: QLC+ API Python

Posted: Thu Jul 11, 2024 8:10 pm
by janosvitok
It's already done.

Re: QLC+ API Python

Posted: Fri Jul 12, 2024 8:43 am
by GGGss
LukHan wrote: Thu Jul 11, 2024 6:03 pm
So in the Web API I see 14 functions I can use. Most of them are "get" functions. Do I have more options with OSC? My question is where do I have the most options to control and manipulate the functions in QLC+ with python. I am thinking of speed up or slow down functions, BPM adaption and so on. Not only activate or deactivate a button.

Just an overview question before I start to deep dive into that stuff.
Study the OSC plugin and you will notice that you can address individual channels over multiple universes - if that is what you are after: https://docs.qlcplus.org/v4/plugins/osc
The next decision that needs to be made is whether your application will be responsible for everything. IMHO, the better workload would be to let your neural network do its thing and send out commands where the more powerful functions of QLC+ can be easily addressed. I wonder if you are willing to reinvent an RGB matrix.
Regarding your comment about speed control, the timer widget also accepts external commands, so yes, it can be solved. Actually, almost every control in QLC+ has an external input (or a solution where this can be affected).