Level Playing Field Question

33 views
Skip to first unread message

Tom Colburn

unread,
Aug 30, 2026, 12:09:52 AM (yesterday) Aug 30
to ql...@googlegroups.com

Hi Mic, 

I have a question for you about Level Playing Field.

First, I did something without thinking and that’s ALL on me. However, I was wondering if anyone else has run across this before.

My mistake was highlighting a number of group cues, filtering by audio cues and then executing the script without thinking about the fact that some of those audio cues did not have target files yet. They were placeholders while waiting for the files to come in. 

What happened is the files before the cues with no target were leveled properly and others that followed cues with no target didn’t get adjusted at all. I didn’t take time to really troubleshoot to see if the script hung at that point, skipped one or two, etc., so I don’t really know the extent of what happened.

In this particular case, as the files were really hot and QLab’s Master level was set at zero, adjustment was significant, -22db in some multiple cases. That resulted in a need to increase the gain on the USB input of QLab on the Wing audio board. It had been -17, an indicator of the overdriven signal from QLab. 

So, I think you can imagine what happened to hot files that weren’t leveled, playing through on the audio board that had had the gain level brought up from -17 to 0. The hot files were even hotter. Again that’s on me for not paying attention to the cues l was grabbing. 

I was wondering if anyone has run across this issue before. Might there be a fix, or just a warning dolts like me, lol.

Tom

micpool

unread,
Aug 30, 2026, 5:50:04 AM (yesterday) Aug 30
to QLab
There is a logical reason for the problem you encountered. Because the QLab Cookbook is an exploration of topics, rather than completely developed solutions, exhaustive error checking for every possibility  is not generally included in example Applescripts, because it can complicate and   obscure the flow of the programming.

This script contained rudimentary error handling, in the form of a try block containing all the programming after the initial dialog. If at any point the script failed no further processing of cues would take place.

The script also tested to see if all the selected cues were audio cues and only tried to apply the level setting if this was the case.

What you encountered was the try block failing on an audio cue without a file target, which would have halted the script meaning any cues after a cue with no file target would not have their levels set.

Two changes to the Applescript could catch this error.

You can change this line

if q type of eachcue is "audio" then

to

if q type of eachcue is "audio" and broken of eachcue is false then

which would then not apply level setting to any broken cue (e.g because it did not have a file target)

You could also use another try block within the repeat with eachCue block. This would mean that if any cue could not have it's level set because of an error, the script would continue processing further cues after ignoring the specific cue that could not have its level set.

The script with both these additions would be:

--2024 version usable in regions all regions regardless of decomal separator in use.

set theReferenceLevel to -24 --set desired LUFS level

set thefaderLevel to -10 --set the main fader level to your preferred output level for cues with an LUFS at the reference level

set currentTIDs to AppleScript's text item delimiters


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

display dialog "WARNING: This will change the main levels of all selected cues" & return & return & "A dialog will signal when the level setting is complete." & return & return & "PROCEED?"

try

set theselected to the selected as list

if (count of items of theselected) > 0 then

repeat with eachcue in theselected

try

if q type of eachcue is "audio" and broken of eachcue is false then

set currentFileTarget to quoted form of POSIX path of (file target of eachcue as alias)

set theLUFS to (do shell script "/usr/local/bin/r128x-cli" & " " & currentFileTarget as string)

--parse theLUFS to extract the actual LUFS from a very long string

--replace every occurrence of "+" with "plus"

set AppleScript's text item delimiters to "+"

set the item_list to every text item of theLUFS

set AppleScript's text item delimiters to "plus"

set theLUFS to the item_list as string

--replace every occurrence of "-" with "minus"

set AppleScript's text item delimiters to "-"

set the item_list to every text item of theLUFS

set AppleScript's text item delimiters to "minus"

set theLUFS to the item_list as string

set AppleScript's text item delimiters to currentTIDs

--get the third word from the end

set the theLUFS to word -3 of theLUFS

--replace the string "minus" in theLUFS with "-"

if character 1 of theLUFS = "m" then

set theLUFS to "-" & characters 6 thru -1 of theLUFS

else

--replace the string "plus" in theLUFS with "+"

set theLUFS to "+" & characters 5 thru -1 of theLUFS

end if

-- check for decimal localisation and convert to comma separator if neccesary

set o to (offset of "." in theLUFS)

if ((o > 0) and (0.0 as text is "0,0")) then set theLUFS to (text 1 thru (o - 1) of theLUFS & "," & text (o + 1) thru -1 of theLUFS)

set theadjustment to (theReferenceLevel - theLUFS) + thefaderLevel

set the notes of eachcue to theLUFS & " " & theadjustment

eachcue setLevel row 0 column 0 db theadjustment

end if

end try

end repeat

display dialog "Level Setting Complete" buttons "OK" default button "OK"

end if

end try

end tell



MIc
Reply all
Reply to author
Forward
0 new messages