Cue sheet

A cue sheet (or CUE file, CUE sheet, etc.) is a formatted plain text file which is used to provide index information for a large audio file. A cue sheet is generally used in conjunction with either extracting from, or burning to, CD. For example, a cue sheet can tell a media player to treat an audio CD ripped to a single file as if it were separate files, one for each track. Or it can be used to tell software extra details about the layout of a CD to burn. Cue sheets can be used when writing data CDs, but this document focuses solely on the audio-related commands.

The name & type of at least one file being indexed (an audio file, normally);

A numbered list of tracks each file corresponds to or contains;

The start point (index 01) for each track, time-wise (MM:SS:FF format).

Cue sheets may contain the following additional info:

CD-Text metadata such as performer, title, songwriter for the disc and/or each track;

ISRCs (sound recording IDs to burn)

Special flags for CD burning (e.g. for pre-emphasis)

Gap info (how much silence to insert before or after each track)

Comments (which are used by some programs to store nonstandard metadata like genre, freeDB disc ID, etc.)

A cue sheet isn't necessary to make an exact copy of the audio portion of a CD; ripping & burning software will get you the audio wave data and can figure out where each track starts. However, a cue sheet can be used to specify the location of the first track (if it deviates from the standard), as well as certain subcode information, such as non-01 index points, CD-TEXT (which may not exist on the original CD), UPC/ISRC data, and pre-emphasis information.

A cue sheet is required to burn "hidden track one audio" (HTOA), which is audio that can only be played after scanning backwards from the beginning of track 1. A cue sheet may be needed when silent frames have been omitted from the beginning or end of files to be burned; the cue sheet can be used to reconstruct the pauses by telling the burner or player where to insert silence. A cue sheet may also be needed when there is a mix of audio and data tracks to be burned (unless the burning software is told which tracks are which).

The cue sheet format was invented by Jeff Arnold of GoldenHawk Technology for use with his DAO (Disc At Once) and CDRWIN applications. The format has since been adopted as the de facto standard, and is used by various other applications, including foobar2000. The official cue sheet specification is widely accepted to be Appendix A of the CDRWIN User's Guide.

The name is taken from the SEND CUE SHEET command (as defined in the SCSI-3 Multimedia Commands specification), used for sending a binary-format cue sheet describing the disc layout to the drive before writing starts in SAO (Session-At-Once) write mode. The drive writes to the disc, using the cue sheet information to generate the P and Q subchannel data, and to retrieve the format and block size of the data transferred with the WRITE command.[1]

The DAO and CDRWIN software was developed for use on MS-DOS and early Windows systems, when it was common to refer to types of files by their file name extensions, in all-caps: TXT for text, DOC for Word document, and so on. Early references to cue sheets likewise referred to CUE files. This convention continues to the present day, but the cue in the term cue sheet is not an acronym and need not be capitalized.

The FILE command specifies the file that the cue sheet is currently referencing. Valid file types are WAVE, MP3, AIFF, BINARY and MOTOROLA. Other formats, such as the lossless formats WavPack or FLAC, can also be used under the WAVE file type.

INDEX

A number between 00 and 99. Index points are specified in MM:SS:FF format, and are relative to the start of the file currently referenced. MM is the number of minutes, SS the number of seconds, and FF the number of frames (there are seventy five frames to one second). INDEX 01 commands specify the beginning of a new track. INDEX 00 commands specify the pre-gap of a track; you may notice your Audio CD player count up from a negative value before beginning a new track - this is the period between INDEX 00 and INDEX 01.

PERFORMER

At top-level this will specify the CD artist, while at track-level it specifies the track artist.

PREGAP

Used to specify the length of a track pre-gap, in MM:SS:FF format. Although the SCSI specs reserve the term pre-gap for the pause before a data track, in a cue sheet the PREGAP command can be used to create a pause before any kind of track, data or audio.

REM

Used to record comments in a cue sheet. This command is often used to store additional meta data to TITLE and PERFORMER, e.g.: the date or genre of the disc.

TITLE

At top-level this will specify the album name, while at track-level it specifies the track name.

Line breaks must be used between commands. Spaces or tabs can be used to indent; they're ignored but can make the file easier to understand when viewing or manually editing. Customarily, for audio CDs, all the commands which apply to a particular file are indented under the FILE command, and those which apply to a specific track are further indented under the TRACK command.

The cue sheet above, created by EAC, shows the first two tracks of a standard single file cue sheet. Note the use of REM commands to record additional metadata, in the format REM <TAG> "<value>". The PERFORMER and TITLE commands at the top of the cue sheet detail the CD artist and album name respectively. The PERFORMER and TITLE commands at track-level specify the track artist and title.

TRACK 02's INDEX 01 entry does not state that the track is 4m 17.693s long, but that the beginning of the track is 4m 17.693s into the file (so TRACK 01 was in fact 4m 17.693s long). If TRACK 02 was 3m long exactly, TRACK 03's INDEX 01 value would be 07:17:52.

Also note the file reference specifying a relative path to the file (references can also be absolute) and the file type: WAVE.

The cue sheet above shows the first two tracks of a single file cue sheet for a disc with a hidden track at the start. Note that TRACK 01 INDEX 01 starts at 03:22:70 (3m 22.933s) instead of 00:00:00 as in the first example, and most cue sheets. The INDEX 00 index on TRACK 02 displays the more usual behaviour, being two seconds before INDEX 01.

As the INDEX 00 is on TRACK 01 you will not normally see the usual countdown from a negative value that you might see from an INDEX 00 command on a subsequent track. To listen to this track on a Audio CD player you will need to start the disc playing and press rewind, to rewind, essentially, from 3m 22s into the disc back to the true beginning.

Also note that the file referenced is FLAC, but the WAVE files type is used. For MP3 files the file type "MP3" should be used, for AIFF you should use "AIFF", but for all other types "WAVE" is used.

This mutiple file cue sheet, created by EAC, has gaps prepended to the next track. This method allows users to retain gaps, but by prepending the gap to the next track each track may begin with silence, which makes playback less satisfactory.

This mutiple file cue sheet, created by EAC, has removed the gaps, but artificially recreates silence between tracks using the PREGAP command. This is fine if the gap was silence, but unsatisfactory if it contained audio.

This mutiple file cue sheet, created by EAC, has gaps appended to the previous track, and is a favourite among users who rip to track files but wish to retain gap information. This format allows the user to retain gaps, but in a position in the track file that does not hinder playback. Unfortunately, this format is non-compliant, so applications that adhere to the specification, like foobar2000, will not be able to read it. EAC will obviously read these cue sheets, as will the CD burning application Burrrn.

Note that INDEX 00 of TRACK 02 is set while still referencing the first FILE.