Ticker tape animated titles with QLab

Written by Posted on Categories: Events Tags:

Recently I was working on a show which required hundreds of animated ticker tape style animated titles. I could have created these in any NLE, such as Final Cut Pro or Premiere, but for speed and customisability I used QLab.

Simplest Solution

The first solution I created is very easy to implement for one-offs:

  1. Create a text cue with your desired text & formatting
  2. Add a script cue using the script below
  3. Modify the textCue variable in the script cue to the cue number of the text cue you’d like animated
  4. Run the script cue
QLab Ticker Tape Simple Demo
Example use of simple ticker tape AppleScript

Download example QLab script

This is the script, which should be fairly self-documenting:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
-- Project: Ticker Tape
-- Version: 0.1
-- Author: Gareth Nunns
-- Usage: change textCue to desired cue

tell application id "com.figure53.qlab.4" to tell front workspace
  set textCue to cue "2"
 
  -- get the text of the cue
  set title to text of textCue
 
  -- clear the text of the cue and replace with first character
  set text of textCue to (item 1 of characters of title)
 
  start textCue
 
  -- loop through the characters in the cue
  repeat with i from 2 to (length of characters of title)
    set char to item i of characters of title
    if char is not " " then
      delay 0.17
    end if
    set text of textCue to (text of textCue) & char
  end repeat
end tell

I found it looked odd when there was a pause for space characters, hence the purpose of the conditional:

20
21
22
    if char is not " " then
      delay 0.17
    end if

Please Note

This script works by modifying the text cue – if you hit the panic the cue whilst it is animating then the cue will be modified. This is easily avoidable during shows but could be an issue for rehearsals. The benefit of this method is that you can easily edit the text cue and the script will adapt to it.

Generate Multiple

This would be time consuming for hundreds of titles, especially if they are spread over multiple lines as the anchor for text is vertically centred in QLab. This script is fairly easy to use:

  1. Create a .txt with your titles, with each title on a separate line and multiline titles separated by a forward slash – view example file
  2. Run the script below, either from QLab or Script Editor
  3. Delete the generator cue
QLab Ticker Tape Generator Demo
Example use of ticker tape show generator

Download example QLab script Download example titles file

The script works by generating a text cue for each line in the file, then creates a script cue for each title and adds a script to it similar to the one above. It also adds a fade out for each line of the title, as at the time of writing there is no way to fade the opacity of a group.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
-- Project: Ticker Tape Show Creator
-- Version: 0.4
-- Author: Gareth Nunns
-- Usage: Load in a text file with each title on a separate line - for multiline use '/' as a delimiter

set tickerSpeed to 0.1
set fontHeight to 70
set lineHeight to fontHeight + 20
set maxYPos to 440 - lineHeight

-- get the contents of the title file
set titlesFile to (choose file with prompt "Select .txt with titles in" of type {"txt"})
set titles to paragraphs of (read (titlesFile as alias))

set AppleScript's text item delimiters to {"/"}

tell application id "com.figure53.qlab.4" to tell front workspace
  -- loop through all of the titles
  repeat with titleLines in titles
    -- create a group for each cue
    make type "Group"
    set titleGroupCue to last item of (selected as list)
    set q name of titleGroupCue to "Ticker: " & titleLines
    set q number of titleGroupCue to ""
    set mode of titleGroupCue to fire_first_go_to_next_cue
   
    set scriptCues to {}
   
    set numberOfLinesInTitle to number of text items in titleLines
   
    -- loop through lines in this title (delimited by '/')
    repeat with i from 1 to numberOfLinesInTitle
      set title to text item i of titleLines
     
      -- create script cue to fill later
      make type "script"
      set tempScriptCue to last item of (selected as list)
      set q name of tempScriptCue to "Animate on '" & title & "'"
      move cue id (uniqueID of tempScriptCue) of parent of tempScriptCue to end of titleGroupCue
     
      -- create text cue
      make type "text"
      set textCue to last item of (selected as list)
      set notes of textCue to "This assumes the surface is 1920x1080"
     
      -- set text of cue
      set text format of textCue to {fontFamily:"Courier New", fontStyle:"Bold", fontSize:fontHeight}
      set text alignment of textCue to "left"
      set fixed width of textCue to 1600
      set text of textCue to title
     
      -- position the title
      set full surface of textCue to false
      -- vertically centred:
      set yPos to ((round numberOfLinesInTitle / 2 rounding down) * lineHeight) - (i - 1) * lineHeight
      -- top align:
      -- set yPos to maxYPos - (i - 1) * lineHeight
      set translation y of textCue to yPos
     
      -- add to group
      move cue id (uniqueID of textCue) of parent of textCue to end of titleGroupCue
     
      -- keep track of the q numbers of the titles
      copy {q number of textCue, tempScriptCue} to the end of scriptCues
    end repeat
   
    make type "Group"
    set fadeGroupCue to last item of (selected as list)
    set q name of fadeGroupCue to "fade and stop Ticker:" & titleLines
    set q number of fadeGroupCue to ""
    set mode of fadeGroupCue to timeline
   
    -- go through and fill the script cues & fade outs now we know the title q numbers
    repeat with j from 1 to (length of scriptCues)
      set scriptCueList to item j of scriptCues
      set targetCue to item 1 of scriptCueList
      set scriptCue to item 2 of scriptCueList
     
      -- add fade outs for each line
      make type "fade"
      set fadeCue to last item of (selected as list)
      set cue target of fadeCue to cue targetCue
      set stop target when done of fadeCue to true
      set do opacity of fadeCue to true
      set opacity of fadeCue to 0
      set duration of fadeCue to 2
      -- add to group
      move cue id (uniqueID of fadeCue) of parent of fadeCue to end of fadeGroupCue
     
      -- add the script to the cue
      set script source of scriptCue to "
tell application id \"com.figure53.qlab.4\" to tell front workspace
  set textCue to cue \""
& targetCue & "\"
 
  -- get the text of the cue
  set title to text of textCue
 
  -- clear the text of the cue and replace with first character
  set text of textCue to (item 1 of characters of title)
 
  start textCue
 
  -- loop through the characters in the cue
  repeat with i from 2 to (length of characters of title)
    set char to item i of characters of title
    if char is not \" \" then
      delay "
& tickerSpeed & "
    end if
    set text of textCue to (text of textCue) & char
  end repeat
end tell
  "

      -- start the next line going if there's another line
      if j is not equal to length of scriptCues then
        set script source of scriptCue to (script source of scriptCue) & "
tell application id \"com.figure53.qlab.4\" to tell front workspace
  delay "
& tickerSpeed & "
  start cue \""
& q number of (item 2 of (item (j + 1) of scriptCues)) & "\"
end tell"

      end if
    end repeat
   
    collapse titleGroupCue
    collapse fadeGroupCue
  end repeat
end tell

display notification "All cues produced" with title "Ticker Tape by Gareth Nunns"

Please Note

This script uses the Timeline mode for groups so requires QLab 4.3+, or modify the script.

Hopefully this will help someone trying to create something similar or wants to use a snippet from it, enjoy! Feel free to contact me with any feedback/suggestions and I’ll update the post.