Master Marker Manipulation

[Requires QLab 4.1.2 or later]

This chapter deals with ways of importing markers from other programs, (including ProTools session markers),  as slices in QLab and exporting slice markers from QLab for use with other programs.

Many of  the examples  use Twisted Wave as the audio editor. It is beyond the resources of this article to test and provide solutions for every Mac audio editor.  I use Twisted Wave as a lightweight editor that is well suited for most audio editing tasks in conjunction with QLab, is reasonably priced and has a 30 day trial. Other editors may well provide similar capabilities with markers, but you will need to explore and test these your self. Slice export from QLab methods described here  produces standard .xml files that may work with other editors.

Example 1: Import markers in Twisted Wave as slices in QLab.

This is, to begin with, a straightforward process.

If you place markers in Twisted Wave and save the file  they show up as slices in Qlab audio cues that target those files.


If you have markers that have been added in other programmes that Twisted Wave recognises and displays as markers, those will work in exactly the same way.

For as long as the slices in the QLab cue  and the audio file are the same, you can edit markers in the audio file and the QLab file will update immediately.

As soon as this is no longer the case the relationship breaks.

Things that will cause this to happen include;

•     Any slice editing in the QLab cue

•     Editing play counts in the QLab cue

•     Editing the marker positions in the audio cue, when the workspace that has cues               .     that target the audio file is not open.

and there may well be others.

Once QLab decides the sync relationship is broken, then those slice marks will persist in that QLab cue forever unless deleted or moved. Retargeting an existing cue will not import any new markers as slices. And targeting a cue with no markers will not clear existing markers.

Example 2: Import markers from a ProTools session.

In ProTools markers are created in the session, on a ruler, rather than in individual audio files.

PT Markers

Bouncing down a workspace to an audio file does not include the session markers in the bounced audio file.

You can however through a slightly involved process get your session markers converted to audio markers that QLab will convert to slices when a cue is created that targets that audio.

Here’s the ProTools checklist

Ensure all markers are absolute (i.e not bar|beat)


Ensure your bounced or exported audio file starts at session time 0:00:00

Bounce or export your audio from ProTools to an audio file

Export session info as text (From the File menu) and deselect everything apart from Include Markers Time format should be Mins:Secs, Text Format should be  TextEdit text.

exportsession text

The text file will look something like this:


You then need to open the audio file in an audio editor capable of recognising and parsing a ProTools session text file. (Twisted Wave will do nicely, and is used in this example).


In Twisted wave Import Markers….   from the Marker window, and select the session info text file from ProTools


Save the audio file, and you now have a markered file that QLab will convert to slices in the normal way.


Example 3: Import Chapters in a .mov file  as slice markers to  a QLab video cue 

This opens the target video file of the selected cue in QuickTime Player, and sends the key combination to QuickTime player to step through the chapters until there are no more, gets each chapter time and puts a slice in the cue.

Here it is in action (Best viewed full screen):

How it works:

set oldtime to -1
set thetime to -2
tell application id “com.figure53.QLab.4” to tell front workspace
set thecue to last item of (selected as list)
set thetarget to file target of thecue
tell application “Finder” to open thetarget
delay 2
tell application “System Events” to key code 124 using {command down, shift down}
tell application “QuickTime Player”
delay 0.1
set thetime to current time of front document
if thetime = oldtime then exit repeat
end tell
tell application id “com.figure53.QLab.4” to tell front workspace
set oscCmd to “/cue/selected/addSliceMarker ” & (thetime as text)
do shell script “echo ” & the quoted form of (oscCmd) & ” | nc -u -w 0 53535″
set oldtime to thetime
end tell
tell application “QuickTime Player”
tell application “System Events” to key code 124 using {command down, shift down}
end tell
end repeat
tell application “QuickTime Player”
end tell
end tell


First we get the selected cue

We open it’s target (I am assuming it will open in the default for a video cue i.e QuickTime Player X)

We go to the next chapter mark (which will probably be chapter 2 as chapter 1 will start at the beginning of the file) by sending the right arrow keyed with command and shift keys down.

We get the current time of QuickTime Player.

Currently there is no applescript to add a marker in QLab, but there is an OSC message that will do this. We use a shell script to send a plain text OSC message to localhost port 53535. (Port 53535 is a special QLab port which allows plain text to be used as an OSC message instead of  properly formatted OSC messages which would be received on port 53000)

We then repeat this until the current  time returned from QuickTime Player is the same as the previous iteration of the repeat loop, indicating their are no more chapters in the .mov file.

You can download the workspace here

Example 4; Export slice marker times from QLab to .xml file

This opens the targeted audio file of the selected cue in an audio editor, and if there are slice markers in the cue exports the slice number and it’s location both as samples and time to a .xml file that can be read by Twisted Wave

How it works:

set theDAW to application “TwistedWave” — Name of your editor goes here!
set thexml to “” & return
tell application id “com.figure53.QLab.4” to tell front workspace
set thecue to last item of (selected as list)
set thefile to (file target of thecue) as alias
if q type of thecue is “Audio” then
ignoring application responses
tell theDAW
open thefile
end tell
end ignoring
end if
set myslices to slice markers of thecue
set listnumber to number of items in myslices
if listnumber is 0 then return
set sampleRate to do shell script “mdls ” & quoted form of POSIX path of thefile & ” | grep \”kMDItemAudioSampleRate\” | awk ‘{print $3}'”
repeat with eachcue from 1 to listnumber
set thexml to thexml & “” & return & “Marker ” & (eachcue as string) & “” & return & “” & (sampleRate * (time of item eachcue of myslices) as integer) & “” & return & “” & ((time of item eachcue of myslices) as text) & “” & return & “” & return
end repeat
end tell
set thexml to thexml & “”
tell application “System Events” to set target_file to ((((path to desktop folder) as string) & (name of thefile) & “Markers.xml”))
set append_data to false
set the target_file to the target_file as string
set the open_target_file to open for access file target_file with write permission
if append_data is false then set eof of the open_target_file to 0
write thexml to the open_target_file starting at eof
close access the open_target_file
return true
on error
close access file target_file
end try
return false
end try

The script gets the selected cue from the QLab workspace

It opens the cue in the audio editor set at the top of the script

If there are slice markers in the cue then it counts them

It then gets the sample rate of the file. This is quite tricky as a lot of the applescript methods to do this don’t work as expected.

set sampleRate to do shell script “mdls ” & quoted form of POSIX path of thefile & ” | grep \”kMDItemAudioSampleRate\” | awk ‘{print $3}'”  works and can also be applied to  other multimedia file types

We need the sample rate so we can include the sample number for the position of the marker in the .xml file

We then construct the contents and formatting  of the .xml file which looks like this

and output it to an .xml file named so as to identify which file it refers to e,g

PNO Finale PNOSHORT.wavMarkers.xml

This can then be imported into Twisted Wave. In Twisted wave Import Markers….   from the Marker window, and select the .xml file. When the file is saved in Twisted wave the markers are then embedded for use in future cues. Twisted wave can also split a file by markers so you can easily create a file for each section between slices.

You can download the workspace here


Chapter Graphic based on a  photo by Kkdu101 sourced from commons and licensed and redistibruted  under the Creative Commons Attribution-Share Alike 3.0 Unported license.

All Trade Marks Acknowledged

Twisted Wave is a registered trade mark of TwistedWave Software LTD. 398 – 2416 Main street Vancouver B.C. V5T 3E2 Canada

ProTools is a registered trade mark of  Avid Technology, Inc