Script operating very slowly

127 views
Skip to first unread message

TMS

unread,
Jan 30, 2021, 8:04:03 PM1/30/21
to QLab
I have a script which doesn't do all that much but in the workspace where I want to use it, it takes a very long time to execute (like 10 seconds). When I put this script into other workspaces it operates nearly instantly. The workspace does contain a couple hundred cues, but none of them are running when this script is active.

The script simply moves the selection and sends the names of "next, current, and previous" cues to labels via osc.

Here's the full script:
tell application id "com.figure53.QLab.4" to tell front workspace
    set userdelay to 0.1
    moveSelectionDown
    
    set theselectedcue to first item of (selected as list)
    set thenextcue to cue after theselectedcue
    set thepreviouscue to cue before theselectedcue
    try
        set theselectedcuename to q list name of theselectedcue
    on error
        set theselectedcuename to "SelectedQ"
    end try
    try
        set thenextcuename to q list name of thenextcue
    on error
        set thenextcuename to "NextQ"
    end try
    
    try
        set thepreviouscuename to q list name of thepreviouscue
    on error
        set thepreviouscuename to "PrevQ"
    end try
    
    try
        set custom message of cue "OSCIPAD" to "/n/CueNamePrevious " & quote & thepreviouscuename & quote
        start cue "OSCIPAD"
        delay userdelay
        set custom message of cue "OSCIPAD" to "/n/CueNameNext " & quote & thenextcuename & quote
        start cue "OSCIPAD"
        delay userdelay
       
        set custom message of cue "OSCIPAD" to "/n/CueNameSelected " & quote & theselectedcuename & quote
        start cue "OSCIPAD"
    end try
    
end tell 



When I run this script from script editor I can see that the slowdown is happening when it gets to:
set thenextcue to cue after theselectedcue
    set thepreviouscue to cue before theselectedcue

Rich Walsh

unread,
Feb 1, 2021, 11:09:06 AM2/1/21
to ql...@googlegroups.com
Getting the "cue after" or "cue before" seems to require getting all the cues and then processing that list, which will take longer and longer depending on how large the list that needs to be loaded into the script runner is. You could avoid one instance of this processing hit by observing that you already know "thepreviouscue" as it was selected before you moved the selection down!

set userdelay to 0.1

tell application id "com.figure53.QLab.4" to tell front workspace


set thepreviouscue to first item of (selected as list)


moveSelectionDown


set theselectedcue to first item of (selected as list)


set thenextcue to cue after theselectedcue


--etc…

Mind you, if you're OK with moving the selection about this will be even quicker as there is no large list to handle:

set userdelay to 0.1

tell application id "com.figure53.QLab.4" to tell front workspace


set thepreviouscue to first item of (selected as list)


moveSelectionDown


set theselectedcue to first item of (selected as list)


moveSelectionDown


set thenextcue to first item of (selected as list)


moveSelectionUp


--etc…

Rich

TMS

unread,
Feb 1, 2021, 5:22:45 PM2/1/21
to QLab
Thanks Rich, I don't mind it flickering back and forth to send out these labels

Johan

unread,
Feb 2, 2021, 4:23:58 PM2/2/21
to QLab
This looks like a very useful script once its done and working.
I wonder - what does your cue called "OSCIPAD" then do with it ?
and how do you get these messages to show up in your iPad?

TMS

unread,
Feb 2, 2021, 10:14:35 PM2/2/21
to QLab

At this point that cue does a bunch. I have spent the last week working towards an TouchOSC controller that I can use for the purpose of speeding up the show programming stage of theatrical work.
buttons to open a few common programs ( wireless workbench, smaart, supperrack, osculator)

The qlab file stores actor names, instruments, and some other common terms in memo cues and the OSCIPAD cue is used to send the names of those to labels on the ipad.

During a designer run of the show I record the audio output of the keyboardist, and use the now custom labeled buttons on the tablet to input marker names labeled with the actor's name or items of concern that I otherwise wouldn't even have time to even write down. I can also use those to hightlight moments I definitely want to check in the mic check. Then during the sound check I can playback their actual keyboardist for them so that the actors aren't just giving me 70-80% of real output.

The file also has a few more bells and whistles:
A script that opens reaper and prompts to name the new file with the show/act/date
A qwerty keyboard that can be used to type in the qlab computer from the tablet
Insert markers in reaper file with measure numbers or letters a-z
Transport controls for itunes (which I almost never use, and spotify which is not totally uncommon for walk in music)
Snapshot forward and previous for a few consoles. 
Snapshot recall for my template snapshots
Buttons to trigger cues by number 1-48 and a script that labels those buttons with the q name if it exists
Talkback mic on and off for me and musical directors on each console
the next and previous cue and cue list scripts we've recently discussed here
triggering the midi learning on a selected cue,
setting the midi channel of the trigger for a selected cue
buttons to open a few common programs ( wireless workbench, smaart, supperrack, osculator)
A tool I call Big Friendly Buttons - which I can give separately to a savvy stage manger - gives go control over a few cues and labels them on that layout so they can rehearse a moment even if I need to be talking with someone else.

I'm working up a layout that will point to Digico SD macros that will assign my usual actor channels to the control groups I commonly use for actors


It's very much a work in progress, but I'd love to hear what other sound designers would want in a layout like this,
Screen Shot 2021-02-02 at 6.55.54 PM.pngScreen Shot 2021-02-02 at 6.56.05 PM.pngScreen Shot 2021-02-02 at 6.56.00 PM.pngScreen Shot 2021-02-02 at 6.56.14 PM.pngScreen Shot 2021-02-02 at 6.56.19 PM.pngScreen Shot 2021-02-02 at 6.56.23 PM.png

Reply all
Reply to author
Forward
0 new messages