.chart file is text, divided into named sections. Each section holds one entry per line:
Encoding
Recommended: UTF-8, with or without a byte order mark. A file may also be UTF-16 or UTF-32, with a byte order mark. A scanner decodes a file by its byte order mark. It checks the marks in this order, so a file that starts withFF FE 00 00 is UTF-32, not UTF-16:
2B 2F 76.
Edge case: ISO-8859-1 reads each byte as the character with the same number. Bytes 80 to 9F are control characters, not the characters Windows-1252 gives them, such as €.
Sections
A section is a name in square brackets on its own line, then a body between curly brackets, each on its own line:- The name is every character between
[and], as written. Names are case-sensitive. - The
{is alone on the line after the name. - The
}is alone on the section’s last line, and is the section’s only}. - Between sections, a file holds only blank lines.
Section names
Eventsand the instrument sections followSyncTrack, in any order.- Required: each section name once.
Lines
- A line ends at a line feed, or at a carriage return followed by a line feed. A carriage return alone doesn’t end a line. Recommended: a carriage return and a line feed.
- Recommended: each entry indented with two spaces, and no blank lines inside a section.
- A
.chartfile has no comments.
0 = TS 4 with a space at the end is 0 = TS 4. An exporter ends each line with its last value.
Events
Every entry of theSyncTrack, Events, and instrument sections is an event:
- Tick: the position, written in the digits
0to9, without a sign. - Type: a code of one or two capital letters, such as
NorTS. - Values: whole numbers in the digits
0to9, or one text value in anEevent. Each type takes a set number of values, and an event has exactly that number.TSalone takes one or two: see Time signatures. - Spaces: exactly one space comes before and after the
=, after the type, and between values. - Required: every event in exactly this form.
SyncTrack and Events, only the types the table gives them.
A scanner ignores a note or phrase value that has no meaning on its instrument, and an event of another type in an instrument section.
Tick order
Required: within a section, each event’s tick the same as the previous event’s or later:SyncTrack.
Named entries
Each entry of theSong section names a value:
- The key is followed by exactly one space,
=, and one space. - Required: each key once in the section.
- Text values are written in quotation marks:
Name = "Song Name". Numbers are written without them:Resolution = 192. - Required: every entry in exactly this form.
Name = " Song Name " is Song Name. White space is every character that .NET counts as white space, such as a tab or a no-break space, U+00A0, but not a byte order mark, U+FEFF.
Text
Text events are written differently in the two kinds of section:- In
Events, the text is in quotation marks:0 = E "section Intro". - In an instrument section, the text has no quotation marks:
768 = E solo.
.chart file has no escape characters. Text can’t hold a line break, and a quotation mark inside the text is part of it.
Required: no quotation marks around the text in an instrument section.
Edge case: brackets in Events. A scanner removes spaces around the text, then one [ at its start and one ] at its end, so 0 = E "[section Intro]" means the same as 0 = E "section Intro". Older charts write the brackets. An exporter writes the text without them. A bracket anywhere else is part of the text, as in E "section Verse [2]".
Ignored
Atempo anchors inSyncTrack, such as0 = A 0. Chart editors such as Moonscraper write them to hold a tempo marker at a time in the audio. Games ignore them. An exporter may keep them.Hevents inEvents, from older charts.- A section with any other name.
Invalid forms
Bytes that aren't valid in the encoding of the byte order mark
Bytes that aren't valid in the encoding of the byte order mark
[Song], as scan-chart does. scan-chart keeps the bytes as they are when saving.2B 2F 76, the mark of UTF-7, at the start of the file
2B 2F 76, the mark of UTF-7, at the start of the file
[Song], as scan-chart does.Events out of tick order
Events out of tick order
SyncTrack or Events line that goes back in time. scan-chart reports unsortedChartLines, and saving puts the lines in tick order.Two tempo markers, or two time signatures, at one tick in SyncTrack
Two tempo markers, or two time signatures, at one tick in SyncTrack
A section name that appears twice
A section name that appears twice
[Song], [SyncTrack] and [Events] section into one, and the last Resolution counts. YARG’s chart loader reads the first [Song] and [SyncTrack], and joins the [Events] sections and the instrument sections of one name. Saving with scan-chart removes the others.No Song section
No Song section
[Song] section without Resolution. scan-chart’s saving adds a [Song] section with Resolution = 192.No SyncTrack section
No SyncTrack section
Song not first, or SyncTrack not second
Song not first, or SyncTrack not second
[Song] and [SyncTrack] wherever they are, and takes the song’s metadata from the file’s first section, whatever its name, as Clone Hero and scan-chart do. YARG’s chart loader refuses the file, and its song list reads [Song] only when the file starts with it. Saving with scan-chart puts them first.An event of another type in SyncTrack or Events
An event of another type in SyncTrack or Events
SyncTrack or Events. A scanner that reads it ignores the event, as YARG and scan-chart do. scan-chart keeps it, and writes it back as it is.A quoted text event in an instrument section
A quoted text event in an instrument section
768 = E "solo" as a solo. The same holds for soloend, mix and ld_range_shift events. scan-chart reports quotedChartTrackEvent, and saving removes the quotation marks.Other spellings, such as a missing = or extra spaces
Other spellings, such as a missing = or extra spaces