====== Mario 64 Music Commands ======
The M64 commands are used in creating sequences in Super Mario 64, it has a midi-like structure, except more compressed. Some of these commands can vary in how many bytes long they could be.
In M64, we have the header, the track and music event, the header is the beginning of the M64, what all M64s must have, it contains necessary information about the M64, like the NLST, amount of channels, tempo and master volume, the track contains all necessary information about the M64, like pointing to the music event address, setting track volume and so on, the music event contains all the play note(0x00 - 0xBF), transposition(0xC2) and rest commands(0xC0).
===== Header Format and Commands =====
==== 0x90-0x9F: OFFSET ====
Points to track data for a specific channel, indicated by the second nibble of status byte, a track offset is started with a 0xC4 command.
''90 [AA AA]''
| A | Offset to load track from |
Example: Load track data from offset 0x16
90 00 16
==== 0xD3: M64 Flags ====
Flags for the M64 file.
''D3 [AA]''
| A | Flag ID |
List of Flags(Hexadecimal);
|80| Music pauses when the game is paused |
|60| Unknown. |
==== 0xD6: CHANNEL FLAGS ====
Used to disable channels.
''D6 [AA AA]''
| A | Disable channels flag. Each bit = one channel. |
Example: Disable channel 0
D6 00 01
==== 0xDB: MASTER VOLUME ====
Volume for the whole M64.
''DB [AA]''
| A | Master volume. |
Example: Set master volume to 50
DB 50
==== 0xDD: TEMPO ====
Tempo in BPM.
''DD [AA]''
| A | Tempo. |
Example: Set tempo to 120
DD 78