Sidplayer is a music editor and player for the C64 published by COMPUTE! in 1986 (“Enhanced
Sidplayer” by Craig Chamberlain). A tune made with it is saved as a music file, .mus,
that the Sidplayer program plays: the file holds notes, not 6510 code. A tune for a second SID
chip is a second file of the same layout, .str (stereo). The HVSC stores such
tunes as ordinary SID files with the MUS flag set (flags
bit 0), and a SID player merges its own copy of the Sidplayer routine to play them. This page covers the
layout that open players read. How the note events themselves are encoded is not described.
The file
| Offset | Size | Name | Description |
|---|---|---|---|
| 0 | 2 | Load address | Little-endian, as in a PRG file. The Sidplayer routine expects the data at $0900 (the loader of the open players puts it there whatever the file says). |
| 2 | 2 | Voice 1 length | Little-endian: the length of the voice 1 data in bytes, including its halt command. |
| 4 | 2 | Voice 2 length | The same for voice 2. |
| 6 | 2 | Voice 3 length | The same for voice 3. |
| 8 | … | Voice 1 data | The notes, rests and commands of voice 1, ending with the two bytes $01 $4F, the halt command. |
| … | … | Voice 2 data, voice 3 data | The same, one after another. |
| … | … | Credits | Up to five lines of PETSCII text, each ended by $0D (or $00), and a last empty line (a $00). Usually the title and the author. |
There is no signature. A reader recognises a MUS file by its structure: adding the three
lengths to offset 8 stays inside the file, and the two bytes before the end of each voice’s data are
$01 $4F. The explorer uses exactly that test, so a file named .mus that is
something else (a Doom music file, a Tyrian music file) is not shown as one.
Stereo: MUS and STR
A stereo Sidplayer tune is two files: the .mus for the first SID and a .str of
the same layout for the second, which the open players put at $D500.
The two can be joined into one: the second part starts right after the first part’s credits, with its own
load address. The explorer’s tree names it “Second SID part (STR)”.
In a SID file
A PSID file with bit 0 of the flags set holds the MUS data (the whole file, including its load address,
when the header’s load address is 0) as its C64 data. The init and play addresses must be 0: the external
Sidplayer routine supplies the entry points. The open players (libsidplayfp) place the MUS data at
$0900 and a copy of the Sidplayer routine above $E000, with init at
$EC60 and play at $EC80 for one SID, or at $FC90 and
$FC96 for the two-SID player. The explorer draws the MUS layout in the tree for such a file,
with the load address, the three voice lengths and voice data and the credits.
The voice data
Each voice’s data is a sequence of events: notes with a duration and an instrument or voice setting, rests, and commands that set the tempo, the volume, the filter and so on, ending with the halt command. The meaning of the event bytes is the Sidplayer’s own, held in the player routine. It is not described here, and the explorer shows the bytes of each voice as one block.
The credits
The lines are PETSCII: the codes $20 to $5F are printable (letters are the
upper-case set $41 to $5A; a byte $9D, cursor left, steps back
over the previous character). The explorer shows each line as text.
Playing it
The explorer does not play MUS data: the Sidplayer machine code that does is the work of
Craig Chamberlain and is not part of the file or of this site. A SID file with the MUS flag
therefore opens with its tree and its credits and no sound. The .wds companion file that some
Sidplayer tunes come with is not read, and its layout is not described here.