Mario64 Sequenced Music format by messiaen at 11:35 AM EDT on October 22, 2008
Hello, first post here!

I've been researching Mario64's sequenced music format. It doesn't use MIDI or the 'compact' sequence format found in other N64 games, but rather some custom format.

This is so far what I have discovered:

My very incomplete specs

I created a simple parser tool to help me, you can download it along with ripped 'sequences' (the .m64 files) in this folder.

Depending on the track, it can output a fairly good result, but there are many details I'm still mising. Here are some practical examples of music modification in SM64:

"Flag" theme from SMB1

Super Mario Bros "water" theme

So, if anyone feels like helping, just drop a message :).

edited 11:34 AM EDT October 22, 2008
by F3582 at 5:02 PM EST on November 4, 2008
Nice stuff, indeed.
by nensondubois at 6:27 PM EST on November 4, 2008
heh, this is pretty amazing.

edited 6:49 PM EST November 4, 2008
by messiaen at 9:23 PM EST on November 10, 2008
The format used in Mario Kart 64 and Wave Race 64 is pretty similar, so here's one practical application of this program:

http://www.youtube.com/watch?v=vTR1mJTkYMo
http://www.youtube.com/watch?v=7ynL2WM8jHU

(Mario Kart 64 music playing in Mario 64 after some manual editing).

I have to upload a more recent specification to my site, I discovered a lot more about the format.
by unknownfile at 9:45 AM EST on November 11, 2008
The music driver is probably shared across several N64 games, probably both LoZ games and Starfox. This is probably not the N64 generic driver, but very nice stuff nonetheless.
by messiaen at 2:31 PM EST on November 11, 2008
Zelda already uses a different sequence format (haven't checked if it's CSeq), so I guess this could be a very early Nintendo format.

Here are the most recent specs.

Now if my programming wasn't so bad I would write a MIDI importer :), but I guess I'll just have to leave that for someone more experienced.
by messiaen at 11:41 AM EST on November 21, 2008
Sorry to double post, just wanted to share these two music hacks:

Super Mario Bros 3 overworld music:

http://br.youtube.com/watch?v=kCEOI0cwZQs

Mario Galaxy's "Good Egg Galaxy":

http://br.youtube.com/watch?v=kCEOI0cwZQs
by hcs at 11:50 AM EST on November 21, 2008
Awesome!

Did you mean to link this one for SMB3?
http://br.youtube.com/watch?v=69-CPbZkPxE

I love this project, keep up the good work and don't worry about double-posting. That really only applies to multiple posts when you could edit a single one, and this is your thread anyway.
Wave Race 64 Offset by jurassicPieter at 12:36 PM EST on November 23, 2008
It would be cool to have a midi converter or anything. Anyway the Wave Race 64 US version 1.1 sequence bank offset is 7AE8B0 and has 33 sequences. 3 more than the USF.
Also what procedure do you use to find these sequence bank offsets yourself?

I just found it by opening the rom, enter the offset of super mario 64 and look for the nearest 0003 signature that worked well(which sadly is very common in the rom)
by unknownfile at 12:53 PM EST on November 23, 2008
The USF set was ripped using the Shindou Edition, so it's natural that tracks are missing.

So, I have christened this driver "Nintendo generic", since it is used across several games, but is not like the other N64 generic driver (alSeqp, "Smashy").

You want to give us details on the driver subroutines?
by MarkGrass at 1:17 AM EST on November 24, 2008
Excellent work, messiaen.

I love this project as well, so please, keep it up!
by messiaen at 4:11 PM EST on November 24, 2008
Thanks everybody for the support :), I sure learned a lot while trying to understand this format.

To find the sequence "bank", you can either search for "00 03 00 xx" [xx being the sequence count (hex) you can get from the USF] or for the
sequences themselves - which always begin with 0xD380, 0xD360 or 0xD320 - and scroll up from there. There is an utility in my site (seq_rip.exe) which will rip the sequences into individual files.

I'm not sure if I would call this format "generic" because these may be the only three games that use it (but I'm not 100% sure about it), because this is an very
early format. Something I want to look now is at the sequences from the PAL version of Mario64 (it uses a few different commands) and provide a better support in my parser for Mario Kart/Wave Race.

I can't provide much technical information besides the specs I posted because pretty much I've discovered was by experimenting with the sequences themselves or by looking at portions of the sequence player to find some command lenghts.
by jurassicPieter at 6:33 AM EST on November 26, 2008
hm, looking for the sequence bank by just checking the rom is like looking for a needle in a haystack. 00 03 00 xx is very common, D3 80, D3 60 and D3 20 are all very common too.
And xx is not always certain(think of removed non-working songs, dynamic songs, different version etc.)

And i think it might work on other games but that the revision byte 03 is probably different( 00,01 and 02 are probably only used in super mario 64 beta's running on emulators because the real hardware was not made yet).

It's impossible to write a program that will find it all automatically, but i could write a program that will give all possible occurences and the human can pick which one it probably is.

See if i can make that. Would be cool to see if other games are using it. And might give you something extra to figuring out the midi.
by messiaen at 7:45 AM EST on November 26, 2008
I was looking at some of the Zelda 64 sequences and turns out that the format is more similar than I once thought, so with some modifications the parser might be able to tacke Zelda64 as well.

However I can't understand the "sequence bank" pointers. 0x30860 is the first sequence, so I think they are located between 0x303B0 and this.

This is for the normal (non-debug) Ocarina of Time ROM, it would be probably better to look for that on a Debug ROM as it might be more useful for hacking, but I couldn't find it yet (anyone wants to give some help on that?)

Edit: With some manual modifications, I got a Zelda64 sequence to run on Mario 64 :). Some of the sequences are more close to the Mario Kart64/Wave Race64 format, while others use a structure which is a bit different.

JurassicPieter: that's a nice idea. You can try also searching for 0xD320D7 or 0xD320D5, 0xD5 and 0xD7 being the two commands you would normally expect on the sequence beggining. The "20" after 0xD3 can be exchanged with 60 or 80. Also, usually all sequences start on an offset multiple of 0x10.

edited 10:07 AM EST November 26, 2008
by unknownfile at 1:34 PM EST on November 26, 2008
Can you check Starfox64? Pretty sure it uses the same stuff...
by messiaen at 4:09 PM EST on November 26, 2008
Indeed it uses the same format (first sequence at 0xFB220) !! So, it's really a generic Nintendo format, although not all games use exactly the same format.

So far, there are apparently three different versions:

Mario 64 (probably the first version)
Mario Kart 64 / Wave Race 64 / Star Fox 64
Zelda (the most different but still pretty close)

Edit: Some Starfox sequences begin also with 0xD3E0.

Here is a starfox sequence played from Mario64:
http://br.youtube.com/watch?v=kjLqJYWQgQE

Edit2: Yet another (1997 Nintendo) game which uses the same format: Yoshi's Story.

edited 6:29 PM EST November 26, 2008
by snakemeat at 12:50 AM EST on November 27, 2008
It's impossible to write a program that will find it all automatically, but i could write a program that will give all possible occurences and the human can pick which one it probably is.

I wrote a similar program to scan RAM dumps while doing some Hoot related stuff. Maybe it can help you out.

It takes the hex string (0x not needed) and a file extension (for multiple file checking) and returns a list of offsets to the queried hex bytes. If you want the source, just let me know. Just some pretty straight forward stream examination.

Grab it here.

edited 12:49 AM EST November 27, 2008
by messiaen at 12:21 PM EST on November 27, 2008
That's a interesting tool, and as someone who's just giving his first steps in programming I'd like to see the source. If anyone wants to use that method be sure that the ROM is in ABCD order. The z64 or v64 extension doesn't always means a specific byte order. AFAIR, there are some byte-swappers at dextrose.com.

I have found that 1080 Snowboarding also uses the same base format. Each game presents some minimal variations, but I'll try to cover some of them in my WIP specification (link on previous posts).

edited 12:20 PM EST November 27, 2008
by snakemeat at 1:40 PM EST on November 28, 2008
That's a interesting tool, and as someone who's just giving his first steps in programming I'd like to see the source.

I've updated the source with some comments to help explain things. One thing I noticed while reviewing the source is that you can enter multiple search strings separated by commas. I'd forgotten I added that. Be sure to put the whole list of search strings in quotation marks so the app doesn't get the arguments confused. BTW: This is a C# app and I use Visual C# 2008 Express Edition to build it.

Grab the source here.

If anyone wants to use that method be sure that the ROM is in ABCD order.

Agreed. This tool searches in sequential order, so if the bytes are reversed in your game image, be sure to reverse the search string bytes to match that.

edited 1:41 PM EST November 28, 2008

edited 1:41 PM EST November 28, 2008
by messiaen at 3:19 PM EST on December 4, 2008
Thanks for the source, I think I'll try something similar in C for misc romhacking purposes :).

I was looking at the USF Rip (I gotta learn to do this kind of stuff :D) of Mario 64 and I was wondering what are these alternate versions of Hazy Maze Cave and Dire Dire Docks? Also, why is the sequence 01 "End Level" missing?

Something very strange is that the first sequence (number 00) is rather akward. What happens is that this sequence is played all the time, along with the regular ones, kind like a second music layer. I don't know if it's used to initialize stuff or what, and it doesn't seem to support any instrument besides a simple "click". Any idea what may be the use of this? First I thought it could be used to initialize stuff, but I'm not sure about it, it doesn't seem to have any purpose.
by jurassicPieter at 2:12 PM EST on December 6, 2008
Hm, almost forgot about this. I prefer C++ over C sharp, but i'll take a look. Tomorrow i'll post a working version.
by jurassicPieter at 4:47 PM EST on December 6, 2008
Have been working on it. I tested it on the Super Mario 64 rom, said it should look for mininum number of songs 35 and maximum 35 and that offsets should be incrementing. Only one result came out of it.

Now all i need is make it possible to add arguments instead of changing the programming code.
Zelda branch by messiaen at 4:11 PM EST on December 7, 2008
A branch of the parser tool:

Zelda 64 Sequenced Music Parser 0.1

It works on many Ocarina of Time/Majora's Mask sequences, but some of them use a few commands I haven't dealt with and won't be parsed correctly.

And here is Zelda's Main Theme from OOT in Mario 64 :D.

edited 4:10 PM EST December 7, 2008
by jurassicPieter at 6:55 PM EST on December 9, 2008
Lol, keep breaking promises and delaying. No progress and only some time this thursday.I tested it on many roms even some of the older nintendo games, but so far no luck in most games. Should check pilotwings though, i think it will probably work on that game.

I keep having fun with a youtube fad i created which is expanding, just look for kk slider parody to know what i mean.

Good work Messiaen with the parser tool working on oot.
by hcs at 7:06 PM EST on December 9, 2008
Pilotwings shouldn't be using the same format as this.
by messiaen at 12:31 AM EST on December 12, 2008
Zelda 64 Sequence Ripper v0.1. It extracts all the sequences from the Debug ROM.

I couldn't finding the sequence pointer table in Ocarina of Time (maybe its compressed?).
by messiaen at 8:59 AM EST on December 22, 2008
Bump for good :).

I'm working on a importer tool using the MML parser of Addmusic. The output is almost decent, this is one sample of it:

A bunch of custom music in Mario 64 --> http://br.youtube.com/watch?v=NaZGlj0D8Hw
by anewuser at 11:51 AM EST on December 22, 2008
oh, scary...now there's a mml experimental work for the n64 :/ (congrats for that)

ps: oh addmusic is mml for snes, btw.

edited 11:55 AM EST December 22, 2008
by nensondubois at 10:31 PM EST on December 22, 2008
Addmusic is currently only for super Mario World.
by SH&E at 6:46 PM EST on December 30, 2008
Sorry, random, but could someone check whether Animal Forest *dobutsu no mori", uses this Generic Nintendo format? It IS made by Nintendo EAD... So it might do :). I know for sure it doesn't use the smashy one...

If no one can, could you tell me how I could find out?

EDIT: okay, I doubt it does, because the instruments sound nothing like those in Mario 64... xD

But still =P

edited 6:39 AM EST December 31, 2008
by messiaen at 1:36 PM EST on January 6, 2009
To my surprise, Animal Forest really does use the same format. It seems to be exactly the same branch as used in Zelda 64 OOT / Majora's Mask.

By the way, here's the first release of the .mml importer for Mario / Zelda 64:

http://sites.google.com/site/messiaen64/parsed-music-files/mml2m640.1b.zip?attredirects=0

There is also a "inserter" tool to save the custom sequences in Mario 64, so it should be pretty simple to use it.
by SH&E at 2:53 PM EST on January 6, 2009
Oh my wow! That's amazing! Thank you for looking into that messiaen! :)
Does that mean I can use one of your tools to rip the music out? Or will you have to update it first?
by SH&E at 3:43 PM EST on January 6, 2009
"I keep having fun with a youtube fad i created which is expanding, just look for kk slider parody to know what i mean."

Yeah, I made one of those: http://uk.youtube.com/watch?v=i9-FWVrTkqA. I didn't realise it had already been done... But mines still pretty awesome ;], don't ya fink? :D xD

edited 4:00 PM EST January 6, 2009
by Elven Spellmaker at 6:16 PM EST on January 6, 2009
SH&E its pwnage, I love it! I hate Avenged Sevenfold, but this is something I'd listen to. Its brilliant =)
by SH&E at 5:05 AM EST on January 7, 2009
Paha, thanks :D. Now I gotta get on with some holiday work, and *not* get distracted by making more songs xD. My girlfriend has ordered me to, or else I can't see her this Saturday.. Now that's a good way to get me doing it =P.

I've created some custom hourly tunes using the method described in my YouTube reply to you aswell: http://vgobsession.homeip.net/acproject/

edited 5:27 AM EST January 7, 2009


Go to Page 0

Search this thread

Show all threads

Reply to this thread:

User Name Tags:

bold: [b]bold[/b]
italics: [i]italics[/i]
emphasis: [em]emphasis[/em]
underline: [u]underline[/u]
small: [small]small[/small]
Link: [url=http://www.google.com]Link[/url]

[img=https://www.hcs64.com/images/mm1.png]
Password
Subject
Message

HCS Forum Index
Halley's Comet Software
forum source