Crossfade between groups script

60 views
Skip to first unread message

José Miguel Mayoral

unread,
Dec 22, 2025, 11:35:12 AM (3 days ago) Dec 22
to QLab
Hi.
I need a script to crossfade between groups, stopping the previous one. It should do the same function as "Fade&stop," but with the cues within the group at the bottom and top. Micpool sent me one for Qlab 4 years ago, but I haven't been able to modify it to work in Qlab 5.
Thanks 

micpool

unread,
Dec 22, 2025, 1:31:50 PM (3 days ago) Dec 22
to QLab
The only previous post I can find from about 4 years ago which had something to do with crossfades and groups was this one


I'm not sure if that was the script you are referring to that doesn't work in QLab 5 but if it is,

Change QLab.4 to QLab.5

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

And, as Qlab fire_all cues became timeline cues in QLab 5, change this line 

set mode of groupCue to fire_all

to

set mode of groupCue to timeline


Mic

José Miguel Mayoral

unread,
Dec 22, 2025, 1:41:41 PM (3 days ago) Dec 22
to QLab
set inDuration to 5 --set fade in duration here
set outDuration to 10 --set fade in duration here
set minVolume to -60 --Set to match minimum volume set in settings/general

tell application id "com.figure53.QLab.5" to tell front workspace
try
set thecue to last item of (selected as list)
set q number of thecue to ""
if q type of thecue is "Audio" or q type of thecue is "video" then
make type "Fade"
set fadeOutCue to last item of (selected as list)
set the q number of fadeOutCue to ""
set cue target of fadeOutCue to thecue
set duration of fadeOutCue to outDuration
set stop target when done of fadeOutCue to true
set q name of fadeOutCue to "Fade out " & q list name of thecue & " (" & outDuration & "s)"
set audioCueLevel to thecue getLevel row 0 column 0
if q type of thecue is "video" then
set thecueopacity to the opacity of thecue
set the opacity of fadeOutCue to 0
set the do opacity of fadeOutCue to true
end if
fadeOutCue setLevel row 0 column 0 db minVolume
moveSelectionUp
make type "Fade"
set fadeCue to last item of (selected as list)
set q number of fadeCue to ""
set cue target of fadeCue to thecue
set duration of fadeCue to inDuration
fadeCue setLevel row 0 column 0 db audioCueLevel
thecue setLevel row 0 column 0 db minVolume
if q type of thecue is "video" then
set the opacity of fadeCue to thecueopacity
set the opacity of thecue to 0
set the do opacity of fadeCue to true
end if
set cuesToGroup to {thecue, fadeCue}
make type "Group"
set groupCue to last item of (selected as list)

set mode of groupCue to timeline
set q name of groupCue to "Fade in " & q list name of thecue & " (" & inDuration & "s)"
repeat with eachCue in cuesToGroup
set eachCueID to uniqueID of eachCue
move cue id eachCueID of parent of eachCue to end of groupCue
end repeat

end if
end try
end tell
 

I don't know if I'm missing something, but this isn't how it works.

micpool

unread,
Dec 22, 2025, 1:50:51 PM (3 days ago) Dec 22
to QLab
If it's not working for you, comment out the try and end try statements. i.e --try.  --end try and you will get an error message which may indicate what the problem is.

Mic

José Miguel Mayoral

unread,
Dec 22, 2025, 1:59:20 PM (3 days ago) Dec 22
to QLab
Yes, it works. The only thing is that it only works with a video cue. You select the video cue, and it fades in and fades out. I find it quite useful, but what I need is for it to crossfade in the same way as the fade&stop function, but with bottom and top layers within the same group.

micpool

unread,
Dec 22, 2025, 6:51:00 PM (3 days ago) Dec 22
to QLab
For a lot of uses, you don't need to have top and bottom layers to use with fade and stop group triggers. You can set all the video or text cues to bottom layer; they will stack top to bottom in the order they are in the group behind the currently displayed cues, which will fade to reveal the new layers when the new group is triggered.
Screen Recording 2025-12-22 at 23.44.34-HD 720p.mov

micpool

unread,
Dec 22, 2025, 7:33:08 PM (3 days ago) Dec 22
to QLab
This script will create an absolute fade in for any selected media and text cues and group each fade with its cue target. It will then group all these fade in groups inside another group cue and make a fade cue for that group. You can repeat this for each set of media cues and manually move the fade cue for the previous group into the new group as required:

set theTime to 5

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

set theCues to (selected as list)

set theGroupCueList to {}

repeat with eachCue in theCues

if the q type of eachCue is in {"video", "text"} then

set the opacity of eachCue to 0

set the selected to eachCue

delay 0.01

make type "Fade"

set theFadeCue to last item of (selected as list)

set the duration of theFadeCue to theTime

set the opacity of theFadeCue to 100

set the do opacity of theFadeCue to true

set the cue target of theFadeCue to eachCue

make type "group"

set theGroupCue to last item of (selected as list)

set the end of theGroupCueList to theGroupCue

move eachCue to end of theGroupCue

move theFadeCue to end of theGroupCue

end if

end repeat

make type "group"

set theGroupCue to last item of (selected as list)

repeat with eachGroup in theGroupCueList

move eachGroup to end of theGroupCue

end repeat

make type "Fade"

set theFadeCue to last item of (selected as list)

set the duration of theFadeCue to theTime

set the opacity of theFadeCue to 0

set the do opacity of theFadeCue to true

set the cue target of theFadeCue to theGroupCue

set the stop target when done of theFadeCue to true

end tell



Screen recording attached
Create fade groups.mov

José Miguel Mayoral

unread,
Dec 23, 2025, 8:21:42 AM (2 days ago) Dec 23
to QLab
I can usually work with bottom layers, but this script makes it easier to create fades when working with both bottom and top layers. 
Thanks.

Reply all
Reply to author
Forward
0 new messages