A SID file does not say how long a song lasts: the code would play forever. The High Voltage SID Collection
(HVSC), which holds most SID tunes in circulation, keeps that and other information about its tunes in text
files in its DOCUMENTS folder, next to the C64Music tree of .sid files. A
player looks the tune up in them; a single dropped file has no folder to look in, so the explorer does not.
The collection’s layout
The tunes sit in /DEMOS/, /GAMES/ and /MUSICIANS/ (a folder for each composer, the
files named after the tune), with the letter folders 0-9, A-F, G-L and so on
below the first two. A tune for more than one SID chip is named with _2SID or _3SID before the
extension, for example Hallows_Eve_2SID.sid. Paths in the documents start with / and name the
file from the collection’s root, with the capital letters the folder has.
Songlengths.md5
The song length database in use since HVSC #71. It is an INI-style text file: the first line is
[Database], lines that start with a semicolon are comments, and above each entry a comment gives the tune’s path
in the collection. An entry is a key and a value:
; /MUSICIANS/H/Hubbard_Rob/Commando.sid
c4c5ff8cfefdf683c50e66775cfac1ee=3:57 1:02 0:06 0:02 0:01 0:01 0:02 0:04 0:03 0:02 0:03
- The key is the MD5 hash, 32 hexadecimal digits, of the whole SID file including its header. A tune changed in any byte has a different key.
- The value is the length of each song, separated by spaces:
mm:sswith an optional.SSSof one to three digits for the milliseconds;mmnever has a leading zero, and the shortest length is one second when there are no milliseconds.1:02,1:02.5and1:02.500are valid. - The lengths belong to the PAL or NTSC machine the tune was made for. Played on the other one, the song is longer or shorter.
Songlengths.txt, the old format
Players that predate the new format read Songlengths.txt, which HVSC no longer ships but a script generates from
the .md5 file. It has the same file structure, but the key is an MD5 over a particular calculation (the data from the data offset,
then the init address, play address and song count low byte first, then 32 values of 0 or 60 for the VBI or CIA speed of each
speed bit, then 2 for an NTSC tune), the lengths are mm:ss without milliseconds, and a length may be followed by
a letter in brackets: (G) all three voices had the gate off, (M) the master volume went to 0,
(Z) all three voices were silent, (B) the tune does bad things in memory or the time is an estimate.
SSL files
For players that run on a C64, which cannot hold the whole database, a script writes one .ssl file for each tune into a
SONGLENGTHS folder beside it (the folder may be hidden). The file has two bytes for each song, in BCD:
minutes then seconds, no milliseconds, at most 256 songs (512 bytes). The Commando entry above gives
03 57 01 02 00 06 00 02 00 01 00 01 00 02 00 04 00 03 00 02 00 03.
Lengths inside the file (version 5)
A version 5 file may carry its own lengths: with bit 10 of the flags set, the last songs × 4 bytes of the file are a
table, one entry for each song, and it is not part of the C64 data. An entry is two big-endian words in binary-coded decimal: the first
holds the minutes and seconds (0x0234 is 2:34), the second the milliseconds (0x0500 is 500 ms, with the top
digit 0). The ranges are 00 to 99 minutes, 00 to 59 seconds and 000 to 999 milliseconds. The format document’s example is
“Human Race” by Rob Hubbard, six songs:
02 44 05 54 01 16 08 10 01 04 01 58 02 59 04 22 01 43 04 23 02 09 06 17
STIL.txt
The SID Tune Information List holds what the header cannot: the name a tune was given in the game or demo, the composer of one song
of several, covers and the music they are taken from, and comments. It is a flat text file. An entry starts with the path of the tune,
then one block, or for a tune with several songs a block for each song that has something to say, introduced by a line (#n)
in ascending order; an optional comment above the first (#n) belongs to the whole file.
/MUSICIANS/C/Crowther_Anthony/From_Ratt_To_You.sid
COMMENT: The tune names are listed, if they were given a name, ...
(#13)
NAME: Tocca
TITLE: Toccata from Toccata and Fugue in D Minor (BWV 565)
ARTIST: Johann Sebastian Bach
The fields are, in this order when more than one is used: NAME (what the song was called), AUTHOR (its
composer, when the file has several), TITLE (the music it covers, with the album in square brackets and an optional
timestamp in round ones), ARTIST (the original artist) and COMMENT. Each is written with its name right-aligned in
a field of seven characters followed by a colon and a space, so NAME has three spaces before it. The text of a NAME field is 90 characters or fewer.
BUGlist.txt
The list of tunes still in the collection that are known to misbehave in Sidplay2 or on a real C64: out of step, a wrong note, a
crash, an incomplete rip. Each entry is the tune’s path, a BUG: description that may run on over several lines, and the name
of the person who reported it in brackets. The list is a reason to doubt a tune that plays badly, not a format.