Setting all audio levels to same value in multiple cues

625 views
Skip to first unread message

Katharine Horowitz

unread,
Oct 29, 2021, 11:18:54 AM10/29/21
to QLab
I'm working on a re-mounted show from 2011 and there are hundreds of cues that need to be re-set from their old levels to INF, in order to start over. What script do I write to do this? (FYI: Writing scripts is not my forté.)

Just a preface: I did do a search for how to do this and found a post from several years ago with the following code (which I slightly re-wrote to fit to relevant channels), but it only applies to individual cues, one-by-one. SO CLOSE! Blargh.

tell application id "com.figure53.QLab.4" to tell front workspace
set selectedCues to last item of (selected as list)
set level3 to selectedCues getLevel row 0 column 3
repeat with i from 3 to 24
selectedCues setLevel row 0 column i db level3
end repeat
end tell

Katharine Horowitz

unread,
Oct 29, 2021, 11:23:54 AM10/29/21
to QLab
PS. I also need to set all associated crosspoints to 0. (Basically, this is a show that was created in SFX in 2011, then transferred to QLab just now.)

micpool

unread,
Oct 29, 2021, 11:29:50 AM10/29/21
to QLab
Hi Katherine

Leaving aside your script, I don’t really understand why you would want to  clear all the existing levels to inf. Surely the last used levels are a much better starting point than a blank sheet. There are many ways of changing an existing show to use different loudspeaker layouts or output channel counts,  either by using the device matrix, scripting or OSC. 

Mic




micpool

unread,
Oct 29, 2021, 11:31:45 AM10/29/21
to QLab
How did you transfer the show from SFX? Did you use Gareth Fry’s nifty program to do it?

Chris Ashworth

unread,
Oct 29, 2021, 11:32:03 AM10/29/21
to Katharine Horowitz, ql...@googlegroups.com
Hi Katharine,

No scripting required!

In Workspace Settings —> Cue Templates —> Audio —> Audio Levels set the default levels you want to use as your starting point.

In your workspace, select all cues. Then, in the Basics tab, narrow the selection down to just the Audio cues.

In the Audio Levels tab, press “Set Default Levels”

All levels for all selected cues will then be set to the defaults you chose in the cue templates

Best,
Chris

Katharine Horowitz

unread,
Oct 29, 2021, 11:38:02 AM10/29/21
to QLab
The system settings and layout in the theatre are vastly different than what they were ten years ago, and though I used the word "remount" it's more like a "re-imagining." Additionally, the old cue-list is still available in Lists for reference.

Katharine Horowitz

unread,
Oct 29, 2021, 11:38:35 AM10/29/21
to QLab
That's a damn good question. Sten (Severson) did the basic, initial transfer. 

Katharine Horowitz

unread,
Oct 29, 2021, 11:39:59 AM10/29/21
to QLab
Awesome! Let me give that a shot. (Though I'm bummed I can't try my hand at scripting.)

Katharine Horowitz

unread,
Oct 29, 2021, 11:48:33 AM10/29/21
to QLab
This worked, of course, but it worked a little too well. I should have implemented this prior to regular rehearsals, when I was simply re-setting levels for stereo outs 1 and 2 and the master level for the purposes of simple playback during scene runs.

The point we're at now is that I need to set all levels for channels 3-24 to INF, but leave the Master and channels 1 and 2 alone.

On Friday, October 29, 2021 at 10:32:03 AM UTC-5 Chris Ashworth wrote:

micpool

unread,
Oct 29, 2021, 3:11:34 PM10/29/21
to QLab
Happy to script this for you.

Before I do I just need to know how you want the crosspoints set. Are all files stereo? Or Some mono and some stereo? Do you want all outputs 3-24  to have mono sends  of either a mono or both channels stereo file, or do you want each pair of cue outputs to be fed in stereo from stereo files, or is it different for specific cue outputs? 

On Friday, October 29, 2021 at 4:23:54 PM UTC+1 k_hor...@comcast.net wrote:

Katharine Horowitz

unread,
Oct 29, 2021, 3:25:35 PM10/29/21
to QLab
Mic, thank you. 
All files are stereo. All outputs (3-24) should be the former: mono sends  of either a mono or both channels stereo file

micpool

unread,
Oct 29, 2021, 5:10:11 PM10/29/21
to QLab

Run this on a copy of your workspace first in case it doesn’t do what you want!



--set levels of  cue outputs 3 to 24 of every audio cue  in current cue list 

--sliders to inf,  input 1+2  matrix sends to 0

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

set thecues to (cues of current cue list whose q type is "audio")

repeat with eachcue in thecues

repeat with thecueOP from 3 to 24

setLevel eachcue row 0 column thecueOP db -120

setLevel eachcue row 1 column thecueOP db 0

setLevel eachcue row 2 column thecueOP db 0

end repeat

end repeat

end tell



Mic

Adam (AJ) Johnson

unread,
Oct 29, 2021, 5:20:20 PM10/29/21
to Katharine Horowitz, ql...@googlegroups.com
It’s a bit of a hack but I believe this, in a script cue on a hotkey, accomplishes your desired end state for all selected cues - faders 3-24 to -INF and crosspoints of inputs 1 and 2 to outputs 3-24 to 0.

tell application id "com.figure53.QLab.4" to tell front workspace
repeat with i from 3 to 24
set mySliderOSC to "/cue/selected/sliderLevel " & i & " inf"
do shell script "echo " & mySliderOSC & " | nc -u -w 0 127.0.0.1 53535"
repeat with k from 1 to 2
set myCrosspointOSC to "/cue/selected/level " & k & " " & i & " 0"
do shell script "echo " & myCrosspointOSC & " | nc -u -w 0 127.0.0.1 53535"
end repeat
end repeat
end tell

~~~AJ

---
Adam W. Johnson
Sound Designer/Engineer
--
Contact support anytime: sup...@figure53.com
Follow QLab on Twitter: https://twitter.com/QLabApp
User Group Code of Conduct: https://qlab.app/code-of-conduct/
---
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/qlab/24686f43-9018-49fe-9b1e-d6934d8528f3n%40googlegroups.com.

Adam (AJ) Johnson

unread,
Oct 29, 2021, 5:22:56 PM10/29/21
to ql...@googlegroups.com
Sorry, hadn’t seen Mic’s response.

~~~AJ

---
Adam W. Johnson
Sound Designer/Engineer


--
Contact support anytime: sup...@figure53.com
Follow QLab on Twitter: https://twitter.com/QLabApp
User Group Code of Conduct: https://qlab.app/code-of-conduct/
---
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.

Rich Walsh

unread,
Oct 30, 2021, 6:36:05 AM10/30/21
to ql...@googlegroups.com
Alternatively, you could select all the Audio Cues in the workspace at the same time and use the batch editing functions of the Inspector to set what you need:

tell application id "com.figure53.QLab.4" to tell front workspace to set selected to (cues whose q type is "Audio") as list

Haven't tested what happens across multiple cue lists if you do this…

You can also do some repeat looping actions via OSC by running a 1D fade of integers from 3 to 24 for the method "/cue/selected/level/0/#v# -inf". You need a duration and rate setting to get all the messages (eg: 1s @ 30fps would work in this case). OSC can be quicker than AppleScript if you have a lot of cues: it can address them all at once instead of iterating through them one at a time.

I couldn't extrapolate that to 2D though…

It's a bit of a behemoth and has been rattling around for over a decade (untouched for nearly 3 years), but I built a batch adjusting tool back in QLab 2: https://wiki.allthatyouhear.com/doku.php#batch_adjust_selected.

Rich

micpool

unread,
Oct 30, 2021, 7:51:07 AM10/30/21
to QLab
On Saturday, October 30, 2021 at 11:36:05 AM UTC+1 Rich Walsh wrote:
Alternatively, you could select all the Audio Cues in the workspace at the same time and use the batch editing functions of the Inspector to set what you need:

tell application id "com.figure53.QLab.4" to tell front workspace to set selected to (cues whose q type is "Audio") as list

Haven't tested what happens across multiple cue lists if you do this…

I'm not sure this works  on a 1000 cues even in a single list, the first crosspoint you option click on , will take an age to effect the change across the 1000 cues or more likely will crash the workspace.

OSC cues still have an appreciable  execution time if addressed to /cue/selected  or /cue/* I'd be interested to know what the time taken using OSC would be for 90 cross points in  1000 cues, but as my script only takes a minute to execute, I don't think there would be a significant advantage  to the extra complexity

Mic

Rich Walsh

unread,
Oct 30, 2021, 9:16:33 AM10/30/21
to ql...@googlegroups.com
You're right: the interface becomes totally unusable before you get to even 500 cues selected at once (fair enough, really). I was paying more attention to whether I could get the OSC to work in principle…

As usual, AppleScript is the best approach after all.

Rich

Katharine Horowitz

unread,
Oct 30, 2021, 11:09:11 AM10/30/21
to QLab
Oddly, Mic your script did not do anything. I'd run it on all audio cues (and tried individual ones) and nothing happened. What am I missing?

AJ, your script DID work. Although I'm realizing I misspoke, re: crosspoints: What I need is indicated in the attached photo, which I THINK (?) is
all outputs 3-24 should have mono sends." Is this correct?
Screen Shot 2021-10-30 at 10.06.46 AM.png

I also realized that I could do a version of what Chris was speaking of above by selecting all audio cues and then *manually* setting each level to -INF, crosspoints to what I want. (This isn't a huge show so the wait time is manageable.)

However, I really appreciate this discussion. Coding and script is not where it's at for me but I'd very much like to have at least a basic grasp of it. 

Adam (AJ) Johnson

unread,
Oct 30, 2021, 1:01:32 PM10/30/21
to Katharine Horowitz, ql...@googlegroups.com
Revised (and with better commenting and intelligible variable names) version of my previous script:

tell application id "com.figure53.QLab.4" to tell front workspace
-- divided and offset to allow for math later
repeat with everyOtherOutput from 1 to 11
repeat with theOffset from 1 to 2
-- start with channel 3
set theChannel to (everyOtherOutput * 2 + theOffset)
-- set all sliders 3-24 to -inf
set mySliderOSC to "/cue/selected/sliderLevel " & theChannel & " inf"
do shell script "echo " & mySliderOSC & " | nc -u -w 0 127.0.0.1 53535"
-- set all input 1 odd crosspoints and all input 2 even crosspoints to 0, theOffset also serves as the argument for the input channel
set myCrosspointOSC to "/cue/selected/level " & theOffset & " " & theChannel & " 0"
do shell script "echo " & myCrosspointOSC & " | nc -u -w 0 127.0.0.1 53535"
end repeat
end repeat
end tell

Couple of notes:

- The “do shell script” messages are not actual OSC messages but taking advantage of the fact that, per the QLab 4 OSC dictionary,  QLab “listens for plain text on UDP port 53535, and attempts to interpret it as OSC.”

- I personally prefer OSC (or this ‘pseudo-OSC’) to scripting when I can for batch edits as I find the format less verbose and more forgiving. As Mic said in the QLab Cookbook, "If you send an OSC command to a cue that doesn’t understand it, then it just politely ignores it without any drama. If you do the same with a Script cue, it […] decompiles itself.” The flip side of this is that this script would affect, for instance, audio levels of selected mic or video cues as well, rather than only audio cues the way Mic’s does - any selected cue that responds to these OSC methods.

- In the line starting “set mySliderOSC” the last piece of the message is only “ inf” for clarity - per the OSC API, if the last argument is any string, QLab will use the minimum decibel value set in workspace settings.

- I would have read what you needed for crosspoints as, from Mic’s earlier list of options, "each pair of cue outputs to be fed in stereo from stereo files.” One thing with this version of the script is that these crosspoints will only work for stereo files - any mono files will only be sent to every other output. If you don’t have any mono files, you should be good to go.

~~~AJ

---
Adam W. Johnson
Sound Designer/Engineer

micpool

unread,
Oct 30, 2021, 1:03:10 PM10/30/21
to QLab
Where did you run my script from?
The script acts on all the cues of the current cue list. I.e if you cant see the cues you want to change nothings going to happen.
So you can run it from script editor, with QLab open and the audio cues being in the cue list in the QLab window, or you can put the script in a script cue  in the same cue list as the audio cues( although you would want to delete it afterwards, as it would reset your cues if accidentally run again,

If you want it to do all cues in the  workspace then just change the line to set thecues to cues whose q type is “audio”

I would describe your crosspoint arrangement in this post as stereo in pairs of cue outputs, you asked for mono to each cue output, which to me implies that each cue output has a mono mix of L+R inputs.

Have you achieved what you wanted using The select and batch edit, or do you need a revised script?

Mic

micpool

unread,
Oct 30, 2021, 1:45:33 PM10/30/21
to QLab
You still need to set every crosspoint to a new value i.e if you set the odd numbered cross points on input 1 to  0 you need to explicitly set the  even numbered ones to inf otherwise they will be left at whatever level they were before.

The script to set all audio cues of an entire workspace to stereo pair routing with the sliders out  is:

--set levels of  cue outputs 3 to 24 of every audio cue  in workspace

--sliders to inf  

--input 1 to 0 in odd number cue outputs,and inf  in even number cue outputs

--input 2 to 0 in even number cue outputs,and inf  in odd number cue outputs



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

set thecues to (cues whose q type is "audio")

repeat with eachcue in thecues

repeat with thecueOP from 3 to 24 by 2

setLevel eachcue row 0 column thecueOP db -120

setLevel eachcue row 0 column thecueOP + 1 db -120

setLevel eachcue row 1 column thecueOP db 0

setLevel eachcue row 1 column thecueOP + 1 db -120

setLevel eachcue row 2 column thecueOP db -120

setLevel eachcue row 2 column thecueOP + 1 db 0

end repeat

end repeat

end tell



Mic


Katharine Horowitz

unread,
Oct 30, 2021, 4:33:20 PM10/30/21
to QLab
Adam: That worked! Thank you!

Mic: I put the script in its own "Script Cue List", not the Main Show List with the audio cues in it. So: good to know. However, when I added it to the Main Show list and ran it, it still didn't do anything. (It's running but has no effect.)

In any case, yes: between Adam's script and "select all Audio cues" and batch editing, I'm able to get what I want. Thank you, everyone! 

micpool

unread,
Oct 30, 2021, 5:00:18 PM10/30/21
to QLab
My second script certainly works and does exactly what you wanted. Screen recording attached.

The first script likely didn't work because your cues are contained in groups and cues within groups are not considered cues of the cue list but of the group. So changing the line as I suggested to 

set thecues to cues whose q type is “audio” would have fixed it.
Mics Script.mov

Katharine Horowitz

unread,
Oct 30, 2021, 5:53:41 PM10/30/21
to QLab
I attempted again and it worked. Thank you, Mic.
Reply all
Reply to author
Forward
0 new messages