CSNG (File Format)

The CSNG format contains MIDI data. It appears in Metroid Prime 1 and 2. It is essentially MusyX's SON music format, with a custom header.

Format
All offsets are relative to the start of the main header (after the custom header).

Custom Header
This 0x14-byte header isn't part of the MusyX format; it appears at the start of the file. After parsing this the rest of the file is copied into a buffer and then passed to the MusyX functions.

Data
The data in the files is very similar to MIDI, however it is formatted by word, rather than MIDI's byte formatting.

After the data for the instruments are defined, there is a table of offsets for data through out the SON data. Each chunk of data starts with a long 0x8, usually followed by another absolute offset that points to the end of the chunk.

Notes durations are controlled by 96 ticks per beat.