Python, OSC and QLab

1,220 views
Skip to first unread message

Angus Turner

unread,
Nov 24, 2013, 6:19:40 PM11/24/13
to ql...@googlegroups.com
Hey Guys,
Written a short(ish) post about my experiences with running OSC, Python and QLab together, and thought it might be good for people looking tog et started on scripting. 

Me and Mark had an interesting time getting it started so thought some of the gotchas should be documented.

Link is here.

Any feedback is welcome - this is really my first piece of proper technical writing, so i'm still getting used to it. My private email is below for off-list stuff!

Thanks
Angus Turner
h...@theangus.org

Mike P

unread,
Nov 24, 2013, 6:47:55 PM11/24/13
to ql...@googlegroups.com
Bringing back an old topic:

One of my theatres picked up a Behringer X32 and are using it for live mix as well as the Audio Interface from a very beefy QLab rig (12 core, 16GB RAM, 512MB SSD). That rig also drives 4 video projectors on, unfortunately, 5780s and links via MIDI to lighting control.

At this time, those who have tried can't seem to get the X32 to send MIDI commands so the workaround has been a Presonus Firestudio to drive the MIDI. No audio from the Presonus, just MIDI. It works, but we all feel like we should get the Presonus out of the system to simplify.

So questions: A previous discussion gave a general Thumbs Up to the X32 as an Audio Interface and this one seems to be working pretty well. Does anyone have any war stories to tell here? Problems like maybe incompatibility with Presonus drivers on the same box?

Also, has anyone driven MSC from QLab through the X32? Any tricks to get this to happen? I haven't looked at it yet, but digital boards aren't my forte and I thought I should see if anyone has any pointers.

Mike Post
(601) 307-8657
mdp...@mac.com
http://mdpostdesign.com

Paul Gotch

unread,
Nov 24, 2013, 7:09:14 PM11/24/13
to ql...@googlegroups.com
On Sun, Nov 24, 2013 at 06:47:55PM -0500, Mike P wrote:
> At this time, those who have tried can't seem to get the X32 to send
> MIDI commands

I don't think you can do this. The X32 only appears as a audio
interface to the computer not a MIDI interface.

I think you are always going to need a separate interface, however MIDI
is so simple that you can do this absurdly cheaply and small enough to
fit in to the cable itself for example:

http://alesis.com/usbmidicable

-p
--
Paul Gotch
--------------------------------------------------------------------

Mike P

unread,
Nov 24, 2013, 7:14:47 PM11/24/13
to ql...@googlegroups.com
Nice. I've been a fan of the MOTU FastPath (I know, but it works...) This cuts the cost in half. Thanks!
> --
> --
> Change your preferences or unsubscribe here:
> http://groups.google.com/group/qlab
>
> Follow Figure 53 on Twitter: http://twitter.com/Figure53
>
> ---
> You received this message because you are subscribed to the Google Groups "QLab" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to qlab+uns...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Sam Kusnetz

unread,
Nov 24, 2013, 7:42:18 PM11/24/13
to ql...@googlegroups.com

> Nice. I've been a fan of the MOTU FastPath (I know, but it works...) This cuts the cost in half. Thanks!
>
> http://alesis.com/usbmidicable

Danger Will Robinson!

With the exception of a second generation ADAT recorder back in the 90s,
I am yet to encounter an Alesis product that was trouble-free.

If you've got to stay super cheap, I'd recommend Roland over Alesis any
day. Even M-Audio, which I make no secret of disliking, makes the
MIDISport which I would trust more than Alesis' widget.

NB: this is not the official position of Figure 53. This is advice from
me based on my experience.

Cheerio
Sam
--
Sam Kusnetz
QLab Field Operative
s...@figure53.com

Paul Gotch

unread,
Nov 24, 2013, 8:12:10 PM11/24/13
to ql...@googlegroups.com
On Sun, Nov 24, 2013 at 07:42:18PM -0500, Sam Kusnetz wrote:
> Danger Will Robinson!
>
> With the exception of a second generation ADAT recorder back in the
> 90s, I am yet to encounter an Alesis product that was trouble-free.

I'm going to counter that I suspect that this ~$40 cable is actually
OEMed in china and is actually probably identical internally to
something like a ~$4

http://www.amazon.com/SANOXY-Cable-Converter-Keyboard-Window/dp/B0017H4EBG/ref=sr_1_4?ie=UTF8&qid=1385340861&sr=8-4&keywords=USB+MDI

Also I've had several situations where devices wouldn't talk to an
expensive multiport MOTU interface but would talk to a generic
chinese import cable.

Since all these things use generic USB class drivers which are built in
to the OS the the vendor can't even screw that up.

A whole bunch of the M-Audio equivalent (Midisport Uno) really did have
a design flaw which caused enough crosstalk to cause random midi
messages to be sent.

The only reason I linked to a brand name in the first place is that you
can possibly less variation in quality and even if it's ten times the
price of the generic product it's nothing compared with the cost of a
failure on site.

However people should go with whichever brand they trust there are many
such all in one USB cables on the market from pro audio brand names.

The trouble with the no-name chinese imports is that you never quite
get the same product twice.

Andy Lang

unread,
Nov 25, 2013, 1:59:45 AM11/25/13
to ql...@googlegroups.com
Thanks for this, Angus, that's fantastic! Would you be up for adding this to the wiki as well, or letting us port it over?

-Andy


--

Andy Lang

unread,
Nov 25, 2013, 2:34:01 AM11/25/13
to ql...@googlegroups.com

On Sun, Nov 24, 2013 at 7:42 PM, Sam Kusnetz <s...@figure53.com> wrote:
If you've got to stay super cheap, I'd recommend Roland over Alesis any day. Even M-Audio, which I make no secret of disliking, makes the MIDISport which I would trust more than Alesis' widget.

I would, however, chime in offering that we've confirmed multiple times that the MIDIsport devices may work ok for musical MIDI messages, but do not handle MTC or other long SysEx well, if at all. I've personally confirmed this over many generations; I believe they just use older microcontrollers without the speed/memory to handle these, and have never updated that part of them.

I actually just purchased two of iConnectivity's interfaces to set up at the office and test. On my desk are the $35ish mio, which is one of the molded cable types, and the $99ish iConnectMIDI2+, a 2x2 unit that also connects to two computers separately and can act as a MIDI and audio router between them. I'll report back with the results in a couple days. So far I've only unboxed them, so all I can offer is that externally, the iConnectMIDI2+ is built like a TANK. 

(I'd hoped to be able to test the iConnectMIDI4+ as well, which also adds the ability to receive MIDI via an ethernet connection, but that one seems to still be vaporware. Cue sad trombone.)

For a long time, the Roland UM series was the reliable standby that would work well with MTC. They've discontinued most of the line, except for the UM-ONEmk2, which just recently replaced the UM-ONE (not to be confused with the former UM-1 models, which were not a cable form factor). I have not tested that model personally, but initial reports from a couple customers are that they work well with MTC as well.

Finally, I spoke with the engineers from ESI at AES last month, who assure me that their units work great with MTC. I'm working on getting a couple of their models to test, as well.

Best,
Andy

Angus Turner

unread,
Nov 25, 2013, 3:36:35 AM11/25/13
to ql...@googlegroups.com
I've created a request for the wiki, but feel free to port it if you beat me to it!

Thanks
Angus Turner
angus...@gmail.com



On Mon, Nov 25, 2013 at 7:34 PM, Angus Turner <h...@theangus.org> wrote:
Port Away!

Thanks
Angus Turner
e:  h...@theangus.org


Harry Percival

unread,
Aug 29, 2016, 4:26:40 AM8/29/16
to QLab
Hi everyone, hope you don't mind me bringing up an old thread!

Experienced python programmer, first-time QLab user. 

Am trying to find good ways of importing and exporting text cues from Qlab.  Thanks to Angus's excellent post (btw the version on the wiki is all broken, formatting problems), I've managed to get a basic Python-OSC client working, and I've managed to get it to create a new queue.

What I haven't managed to figure out is how to get any output back out of it?  Running methods like /version and /cueList isn't returning anything that I can see.  Do I need to run my own UDP OSC server to receive replies?  Any pointers on how to do that?

cheers!
Harry


On Monday, 25 November 2013 09:36:35 UTC+1, Angus Turner wrote:
I've created a request for the wiki, but feel free to port it if you beat me to it!

Thanks
Angus Turner




Port Away!
To unsubscribe from this group and stop receiving emails from it, send an email to qlab+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

--
--
Change your preferences or unsubscribe here:
http://groups.google.com/group/qlab
 
Follow Figure 53 on Twitter: http://twitter.com/Figure53
 
---
You received this message because you are subscribed to the Google Groups "QLab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qlab+unsubscribe@googlegroups.com.

Harry Percival

unread,
Aug 29, 2016, 4:54:04 AM8/29/16
to QLab
Answering my own question here, it looks like I *do* have to run my own socket server, on port 53001, in order to receive replies.  Not the simplest thing to use but it could be worse!

import socket
import sys
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
server_address = ('localhost', 53001)
print('starting up')
sock.bind(server_address)
while True:
    data, address = sock.recvfrom(4096)
    # print('received {} bytes from {}'.format(len(data), address))
    print(data.decode('utf8'))



Next question -- according to the docs, the '/new' address lets me create a new queue of many different types, including audio, video, etc.  But apparently not "Title"?

http://figure53.com/docs/qlab/v3/scripting/osc-dictionary-v3/

Harry Percival

unread,
Aug 29, 2016, 5:01:40 AM8/29/16
to QLab
OK, answering my own question again, apparently is *is* possible to create titles cues using the '/new' method, the correct string is 'titles', it's just not documented apparently.

Next I want to see if I can programatically create fade queues to follow my title queues.  Doesn't look like the API supports associating a fade with another queue, or setting the fade-opacity, or the 'stop target when done' setting?

Chris Ashworth

unread,
Aug 29, 2016, 8:21:29 AM8/29/16
to Harry Percival, ql...@googlegroups.com
Hi Harry,

QLab will work over a TCP connection as well, which can be a bit easier to manage (and critical in some cases where the OSC reply can in some cases exceed the size of the maximum allowed UDP datagram).

If using TCP, messages are framed using the double-END SLIP protocol.  Links available at the top of this page: http://figure53.com/docs/qlab/v3/scripting/osc-dictionary-v3/ 

-C

Chris Ashworth

unread,
Aug 29, 2016, 9:46:35 AM8/29/16
to Harry Percival, ql...@googlegroups.com, Sam Kusnetz
Hi Harry,

On August 29, 2016 at 5:01:42 AM, Harry Percival (harry.p...@gmail.com) wrote:

OK, answering my own question again, apparently is *is* possible to create titles cues using the '/new' method, the correct string is 'titles', it's just not documented apparently.

FWIW, the string to use is the name of the cue type, which you can see a list of in the toolbox panel by pressing Command-K.



Next I want to see if I can programatically create fade queues to follow my title queues.  Doesn't look like the API supports associating a fade with another queue, 


It looks like the OSC docs are missing a bunch of fade cue methods, thanks for the catch! In the mean time:

You can set the methods “cueTargetNumber” or “cueTargetId” to set the cue target 

or setting the fade-opacity, 

That’d be “opacity”:

e.g. /cue/1/opacity 0

or the 'stop target when done' setting?

“stopTargetWhenDone” 

/cue/1/stopTargetWhenDone [0 or 1]


Until we get the docs updated, here’s a cut-n-paste of the code defining fade cue OSC (beyond the basics for all cues):


    [methods setObject:@{ @"type" : @"property", @"arguments" : @[number] } forKey:@"stopTargetWhenDone"];


    // Audio methods

    [methods setObject:@{ @"type" : @"property", @"arguments" : @[number] } forKey:@"mode"];

    [methods setObject:@{ @"type" : @"property", @"arguments" : @[number] } forKey:@"doRate"];

    [methods setObject:@{ @"type" : @"property", @"arguments" : @[number] } forKey:@"rate"];


    [methods setObject:@{ @"type" : @"custom" } forKey:@"sliderLevels"];

    [methods setObject:@{ @"type" : @"custom", @"arguments" : @[number, wildcard] } forKey:@"sliderLevel"];

    [methods setObject:@{ @"type" : @"custom" } forKey:@"levels"];

    [methods setObject:@{ @"type" : @"custom", @"arguments" : @[number, number, wildcard] } forKey:@"level"];

    [methods setObject:@{ @"type" : @"custom", @"arguments" : @[number, wildcard, string] } forKey:@"gang"];

    [methods setObject:@{ @"type" : @"custom", @"arguments" : @[number] } forKey:@"liveRate"];


    // Video methods

    [methods setObject:@{ @"type" : @"property", @"arguments" : @[number] } forKey:@"geoMode"];

    [methods setObject:@{ @"type" : @"property", @"arguments" : @[number] } forKey:@"doOpacity"];

    [methods setObject:@{ @"type" : @"property", @"arguments" : @[number] } forKey:@"opacity"];


    [methods setObject:@{ @"type" : @"property", @"arguments" : @[number] } forKey:@"doTranslation"];

    [methods setObject:@{ @"type" : @"property", @"arguments" : @[number] } forKey:@"translationX"];

    [methods setObject:@{ @"type" : @"property", @"arguments" : @[number] } forKey:@"translationY"];


    [methods setObject:@{ @"type" : @"property", @"arguments" : @[number] } forKey:@"doScale"];

    [methods setObject:@{ @"type" : @"property", @"arguments" : @[number] } forKey:@"preserveAspectRatio"];

    [methods setObject:@{ @"type" : @"property", @"arguments" : @[number] } forKey:@"scaleX"];

    [methods setObject:@{ @"type" : @"property", @"arguments" : @[number] } forKey:@"scaleY"];


    [methods setObject:@{ @"type" : @"property", @"arguments" : @[number] } forKey:@"doRotation"];

    [methods setObject:@{ @"type" : @"custom", @"arguments" : @[number, number, number, number] } forKey:@"quaternion"];

    [methods setObject:@{ @"type" : @"custom", @"arguments" : @[number] } forKey:@"rotateX"];

    [methods setObject:@{ @"type" : @"custom", @"arguments" : @[number] } forKey:@"rotateY"];

    [methods setObject:@{ @"type" : @"custom", @"arguments" : @[number] } forKey:@"rotateZ"];

    [methods setObject:@{ @"type" : @"custom" } forKey:@"resetRotation"];


Not the most readable thing in the world, but some raw info until we get it a better format in the documentation.


Cheers,

C

Harry Percival

unread,
Aug 29, 2016, 10:50:07 AM8/29/16
to QLab, harry.p...@gmail.com, s...@figure53.com
Magic, thanks Chris.  Great support!  Will have a crack at getting fades working now.  Any thoughts on how to work with groups?

Harry Percival

unread,
Aug 29, 2016, 11:10:29 AM8/29/16
to QLab, harry.p...@gmail.com, s...@figure53.com
OK, progress, I can create fades, and I can correctly set their targets with "cueTargetNumber", and the action length by setting "duration".  But "stopTargetWhenDone" doesn't work, and neither does "opacity".  (if I was doing these in the UI, I would be setting them via the "Geometry" menu in the UI.  Is that relevant?)

Maybe a list of similar methods for fades?

Thoughts re: groups still appreciated.

Harry Percival

unread,
Sep 7, 2016, 6:28:23 AM9/7/16
to QLab, harry.p...@gmail.com, s...@figure53.com
For anyone interested, I've been working with Python and OSC for a few days now, and I built a little "interace" helper class or two.

https://github.com/hjwp/python-osc-qlab-interface/blob/master/qlab_interface.py

question:  is there any way to "copy and paste" a cue, or duplicate one, somehow, via OSC?

Chris Ashworth

unread,
Sep 7, 2016, 9:22:06 AM9/7/16
to Harry Percival, ql...@googlegroups.com, s...@figure53.com
Hiya Harry,

Very cool, thanks for sharing this!

There is not currently a way to copy/paste via OSC but I can add that to the tracker to think about it.

Cheers,
Chris

Ben Finkelstein

unread,
Oct 11, 2016, 12:27:01 PM10/11/16
to QLab
Hello, Angus, I'm trying to use a Raspberry Pi P3 as a media server to run QLab to multiple projectors. I'm having troubles with QLab and my Pi communicating. I'm using PiPresents as a media slideshow. Any suggestions? Feel free to email me at benfinke...@gmail.com
Reply all
Reply to author
Forward
0 new messages