A cue sheet has thirteen commands. Each one occupies its own line. For where they may
appear, see contexts and
order; for the values of their
code arguments, see File types, track modes and
flags. Details were checked against Appendix A of the CDRWIN User’s Guide
(version 3.8, an Internet Archive copy of Golden Hawk’s cdrwin.pdf), which
lists the same thirteen commands.
FILE
FILE file-name file-type
Names the file that the INDEX commands of the following tracks read
from, and opens the file context. It may appear many times. The name must be quoted
if it contains a space. The type is one of the
file types. Example:
FILE "The Free Software Song.wav" WAVE. CDRWIN’s guide adds that the
name may include a device and directory, and that FILE commands must
come before any other command except CATALOG and CDTEXTFILE.
It also says the compiler expects TRACK to follow straight after
FILE.
TRACK
TRACK number mode
Starts a track and opens the track context. Parent: FILE. It may appear
many times, and should appear at least once. The number is from 1 to 99, usually
written with two digits, and each number must be one more than the previous. The
first may be above 1. The mode is one of the
track modes. Example:
TRACK 01 AUDIO. CDRWIN: at least one track per file; the first track
number may be above one but each later one must be sequential.
INDEX
INDEX number mm:ss:ff
Marks a position in the current file. Parent: TRACK. It may appear many
times. The number is from 0 to 99, usually with two digits; its
meaning is set by its value.
The time is an offset from the start of the current file, with 75 frames per second.
The first index of a track must be 0 or 1, and each later index must be one more than
the one before. Example: INDEX 01 00:02:00.
The first-index rule. Both the CDRWIN guide (“The first index of a track
must start at 00:00:00”) and GNU’s manual (the first INDEX of a
TRACK “must start at 00:00:00”) word it for a track, and both say a time is an
offset from the start of the file. The CDRWIN guide’s examples give each file one track.
What it means for several tracks in one file, and what libcue and mpv do, is on
The first index, and several
tracks in one file. The first index number is 0 or 1, and later ones count up by 1
(CDRWIN, ccd2cue, and RFC 9639 for a FLAC cue sheet block).
PREGAP
PREGAP mm:ss:ff
Sets the length of the track’s pregap. The audio is generated, and no data is read
from the file. Parent: TRACK. Once per track, before any
INDEX. Example: PREGAP 00:02:00.
POSTGAP
POSTGAP mm:ss:ff
Sets the length of the track’s postgap. The audio is generated, and no data is read
from the file. Parent: TRACK. Once per track, after all
INDEX commands. Example: POSTGAP 00:02:00.
FLAGS
FLAGS flag flag …
Sets the track’s sub-code flags, one
or more, separated by spaces. Parent: TRACK. Once per track, before any
INDEX. Example: FLAGS 4CH PRE.
CATALOG
CATALOG mcn
The disc’s Media Catalog Number: 13 characters (GNU and CueSharp: decimal digits; RFC 9639
says a CD-DA number is 13 digits), encoded by
UPC/EAN rules. Disc level, once. GNU puts it before everything else except
REM; CDRWIN allows it anywhere in the sheet, “usually placed in the first
line”. Example:
CATALOG 3203040601052.
ISRC
ISRC code
The International Standard Recording Code of the current track: 12 characters, the
first five alphanumeric and the last seven digits only (CDRWIN guide; its example is
ISRC ABCDE1234567). GNU ccd2cue writes the layout as
CCOOOYYSSSSS: country code (2), owner code (3), year (2), serial number
(5), which is 12 characters; RFC 9639 also says 12 characters for a FLAC cue sheet. The
template CCOOOOYYSSSSS on CueSharp’s page has four O and so 13
characters, which no other source supports. Audio tracks only.
Parent: TRACK. Once per track, before any INDEX. Example:
ISRC DKKH50800101.
CDTEXTFILE
CDTEXTFILE file-name
Points to an external file of CD-Text information, conventionally with the
.cdt extension. Disc level, before the first FILE. The name
must be quoted if it contains a space. CDRWIN uses it only with files made by its own
CD-Text editor or generated when copying a CD-Text disc, usually writes it at the top
immediately before the first FILE, and ignores it if the recorder lacks
CD-Text. The guide does not document the .cdt file’s contents.
TITLE, PERFORMER and SONGWRITER
TITLE text, PERFORMER text,
SONGWRITER text
CD-Text fields for the whole disc when placed before the first TRACK
(GNU ccd2cue puts them before FILE; the libburn example puts a disc
TITLE between FILE and TRACK, and libcue reads it as
the disc’s), or for a track when placed inside it (before its
INDEX commands). The text must be quoted if it contains a space. A
string is 1 to 80 characters for each of the three (CDRWIN guide). Before any
TRACK the text belongs to the whole disc, after one to the current
track; CDRWIN ignores all three when the recorder lacks CD-Text. Each may appear once per context. The same data can be
supplied through CDTEXTFILE. Example:
TITLE "Por Quem os Sinos Dobram".
More CD-Text keywords
ARRANGER, COMPOSER, MESSAGE, DISC_ID,
GENRE, TOC_INFO1, TOC_INFO2, UPC_EAN and
SIZE_INFO, each followed by text, as TITLE. They are not in the
CDRWIN guide, whose recorder dialogs name genre, identifier, composer, arranger, message and
UPC/ISRC; CueSharp’s table of the CD-Text types lists them (it calls
TOC_INFO1 TOC_INFO) and libcue reads the nine. mpv lists
MESSAGE and MCN and ignores both; libburn also
supports ARRANGER, COMPOSER and MESSAGE. The binary
types (DISC_ID, GENRE, TOC_INFO1,
TOC_INFO2, SIZE_INFO) cannot carry binary data in a text sheet.
libcue reads ISRC followed by a quoted value as the CD-Text field
ISRC, which shares its slot with UPC_EAN; an unquoted
ISRC is the track’s code. See the
CD-Text keyword table.
REM
REM text
A comment, of any length, anywhere, any number of times. CDRWIN does not compile
such lines, and each continuation line must itself begin with REM. Programs put metadata here by
convention; see non-standard
sheets. Wikipedia says to avoid a REM with nothing after it, which some applications treat
as a syntax error.
Conventions that a reader acts on, from libcue’s scanner (a keyword counts only as the
first word after REM, in any case; any other REM line is skipped
whole, so a comment that merely mentions a genre sets nothing):
| REM keyword | Read as |
|---|---|
DATE | Date of the disc or track (text) |
GENRE, COMPOSER, DISCID | The CD-Text fields genre, composer and disc ID |
COMMENT | A comment (text) |
DISCNUMBER, TOTALDISCS | The disc’s number and the number of discs in the set (text) |
REPLAYGAIN_ALBUM_GAIN, REPLAYGAIN_ALBUM_PEAK, REPLAYGAIN_TRACK_GAIN, REPLAYGAIN_TRACK_PEAK | ReplayGain values: only the first word after the keyword (so -6.5 dB gives -6.5) |
Any other keyword (libcue’s scanner names ORIGINALDATE and
MUSICBRAINZ_DISCID as examples) is defined in none of the sources read,
and libcue skips such a line whole, as a comment.