.SN file format description
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Header (16 bytes) :

bytes 0-3 - ASCII `TISN' (Texas Instruments SN)
byte 4 - speed (beats per second)
byte 5 - number of SN chips
bytes 6-8 - SN clock speed (4000000 for BBC)
byte 9 - file format version (1.x)
bytes 10-15 - unused

Each SN chunk consists of 11 bytes -

byte 0 - Channel 0 freq low (0-F)
byte 1 - Channel 0 freq high (0-3F)
byte 2 - Channel 0 volume (0-F)
byte 3 - Channel 1 freq low (0-F)
byte 4 - Channel 1 freq high (0-3F)
byte 5 - Channel 1 volume (0-F)
byte 6 - Channel 2 freq low (0-F)
byte 7 - Channel 2 freq high (0-3F)
byte 8 - Channel 2 volume (0-F)
byte 9 - Noise control
byte 10 - Noise volume (0-F)

If there is more than one chip, chunks are interleaved, ie for 3 chips :

Chip 1 chunk 1
Chip 2 chunk 1
Chip 3 chunk 1
Chip 1 chunk 2
Chip 2 chunk 2
Chip 3 chunk 2

etc
