COUNTDOWN

For conferences a frequent request is a countdown timer that can be displayed on a screen for the presenters.

Here’s just such a system in action (Best viewed full screen):

A script cue that can be copied and pasted starts a countdown timer on a video display. The countdown time is the post wait time of the script cue.

When the timer reaches zero it displays a message.

How it works:

The cue that starts the countdown is a script cue

tell application id “com.figure53.QLab.4” to tell front workspace
stop cue “COUNT”
set the notes of cue “COUNT” to the post wait of (last item of (active cues as list)) as text
start cue “COUNT”
end tell

It stops the counter cue if it is running, then sets the notes of the counter cue to its own post wait time. It then starts the counter cue.

Countdownroutine

The SECS script cue secs sets the time by setting the memo cue VAR to the number of seconds from the value the calling cue stored in the notes of cue count

tell application id “com.figure53.QLab.4” to tell front workspace
set q name of cue “VAR” to notes of cue “COUNT”
end tell

The Main Loop then starts.

The script cue numbered PROG gets the countdown time from the q name of  cue VAR decrements it by 1 and stores it back there.

The time is then formatted by padding single digits and inserting colons

This time is then included in an instruction which sets the custom OSC message of a network cue, which is started to  set the text of a title cue to the formatted time

If the time has reached 0 then the title cue is set to the end of countdown message

A start cue then restarts the loop cue.

tell application id “com.figure53.QLab.4” to tell front workspace
set countdown to q name of cue “VAR”
if countdown is not “0” then
set totalSeconds to countdown
set countdown to countdown – 1
set q name of cue “VAR” to countdown
set theHours to (totalSeconds div 3600)
set theRemainderSeconds to (totalSeconds mod 3600)
set theMinutes to (theRemainderSeconds div 60)
set theRemainderSeconds to (theRemainderSeconds mod 60)
if (count characters of (theHours as text)) = 1 then
set theHours to “0” & (theHours as text)
end if
if (count characters of (theMinutes as text)) = 1 then
set theMinutes to “0” & (theMinutes as text)
end if
if (count characters of (theRemainderSeconds as text)) = 1 then
set theRemainderSeconds to “0” & (theRemainderSeconds as text)
end if
set theTimeString to theHours & “:” & theMinutes & “:” & theRemainderSeconds as text
set thecustommessage to “/cue/TIME/text \” ” & theTimeString & “\””
set the custom message of cue “OSC” to thecustommessage
else
set thecustommessage to “/cue/TIME/text \”THANK YOU YOUR TIME IS UP\””
set the custom message of cue “OSC” to thecustommessage
stop cue “COUNT”
end if
end tell

To ensure all elements of the loop have completed a short prewait is set at the start of the loop. We want the loop to repeat once every second so we set the pre wait to .1 secs and the pre wait of the start cue that will restart the loop to .9 secs.

timerloop

This is not the most compact means of achieving a countdown but it allows all the variables and OSC  to be seen working quite clearly  which makes it reasonably easy to customise.

You can download the example workspace here

If you want a version that counts up instead of down you are in luck! you can download it here

Image Credit: Noahh Jeppson
Creative Commons Licence Attribution-NonCommercial-ShareAlike 2.0 Generic
(CC BY-NC-SA 2.0)

MenuGraphic