Skip to content
DorianXGH edited this page Jul 1, 2020 · 5 revisions

The music format is custom and uses the following structure :

File header :

Offset Size Content
0x00 0x02 16 bit boundary channel 1
0x02 0x02 Scale descriptor pointer channel 1
0x04 0x02 Timing descriptor pointer channel 1
0x06 0x02 Melody table pointer channel 1
... ... Channel n
END 0x02 0xFFFF

Scale descriptor :

The order is little endian.

Offset Size Content
0x00 0x02 5 bits flags , 11 bits frequency note 0
0x02 0x02 5 bits flags , 11 bits frequency note 1
.. 0x02 5 bits flags , 11 bits frequency note n
0x1E 0x02 5 bits flags , 11 bits frequency note 15

Flags : | SILENCE | reserved | reserved | reserved | reserved |

Timings descriptor :

T = X/4096 s.

Offset Size Content
0x00 0x02 16 bit length 0
0x02 0x02 16 bit length 1
.. 0x02 16 bit length n
0x1E 0x02 16 bit length 15

Melody table :

Offset Size Content
0x02 0x01 4bits scale entry; 4bits timing entry
... ... ...
Clone this wiki locally