Appendix F - File formats

This section has been added just for technical purposes.

Desktop Tracker files &CB6

OffsetDescription
00..03Header ”DskT• (&546B7344)
04..43Name (64 bytes)
44..83Author (64 bytes)
84..87Flags (1 word)
88..8BNumber of voices (1 word)
8C..8FMusic length (1 word)
90..97Initial stereo (8 bytes, Acorn voices)
98..9BInitial speed (1 word)
9C..9FRestart (1 word)
A0..A3Number of patterns (1 word)
A4..A7Number of samples (1 word)
A8...Positions (ARRAY, 1 byte per music length)
ALIGN
mm...Pattern offsets (ARRAY, 1 word per pattern)
nn...Pattern lengths (ARRAY, 1 byte per pattern)
ALIGN
jj...Samples information (ARRAY, 16 words per sample)
pp...Patterns
ss...Samples

The sample information blocks are stored like the Desktop Tracker samples (see later), except the header is missing; all the data is shifted up 1 word, and there is a pointer to the sample data at the end of block. If the tune is compressed, then the header will be ”EskT•. If any pointer in a compressed file is negative, then it points (invertedly) to the compressed block, with the first word being the decompressed size, the second word the compressed size, and the data following the compressed data.

Desktop Tracker samples &CB5

OffsetDescription
00..03Header ”DskS•
04Note
05Volume
06..07Not used (0)
08..0BPeriod
0C..0FSustain start
10..13Sustain length
14..17Repeat start
18..1BRepeat length
1C..1FSample length
20..3FSample name
40...Sample data

If the sample is compressed, then the header will be ”EskS•, and the sample data will be:

40..43Decompressed size
44..47Compressed size
48...Compressed data

Pattern format

OffsetDescription
00..Voice 1 word, event 00
..Voice 2 word
....Voice n word
..Voice 1 word, event 01
....Voice n word
....Voice 1 word, event lg *
....Voice n word

* lg=pattern length

The word can be either 1 32-bit word, or two, if the number of effects is four.

1 Effect:

BitsDescription
00..05Sample number
06..0BNote number
0C..10Effect number
11..17Zero
18..1FData byte

4 Effects:

BitsDescription
00..05Sample number
06..0BNote number
0C..10Effect 1 number
11..15Effect 2 number
16..1AEffect 3 number
1B..1FEffect 4 number
00..07Data byte for effect 1
08..0FData byte for effect 2
10..17Data byte for effect 3
18..1FData byte for effect 4

The recommended method of detecting between 1 and 4 effects is summarised in the following ARM code:

; R0 is word
TST R0,#&1F<<17
BEQ is_1_effect
BNE is_4_effects

Note: There was a problem with the original Desktop Tracker release. A different header was used with the samples on the samples discs. Their headers are ”DSmp•, and their volumes is twice as big as they should have been. If you load one of these, both Desktop Tracker, and !DTTSounds will automatically divide by two. They will save under the new format,