News:

Don't forget to visit the main site! There's lots of helpful docs, patches, and more!

Main Menu

[SM] [MUSIC] Custom music in Super Metroid?

Started by messiaen, December 25, 2012, 04:17:11 PM

Previous topic - Next topic

messiaen

I think I remember hearing some custom music in some Super Metroid hack, but I'm not sure. Anyway, recently I have been playing lots of cool Super Metroid hacks and I think this is something that is often overlooked. I found Kejardon notes, which seem very comprehensive, so I though I could give a shot working on some tool for it (a .mml converter) to give something back to this community.

Can somebody point me to a list of offsets for the different songs in the game? Also, I have next to zero experience in SNES hacking, would moving all the music data somewhere it can be freely expanded be something easy? Also, song size must be restrained by SPC RAM size, right? How much data is allocated for the sequenced data?

Phazar

I know that Sadyztik Fish/Scyzer knows quite a bit about Super Metroid's SPC music programming.  If I recall she created a patch to put the Super Mario theme music into Super Metroid.  And I would totally go for making a music editor for the game if you can, and wish you the best of luck, as this is the type of stuff that has been discussed for quite a while but has never truly had a solution found.  Composing for/editing SPC music tends to boggle the minds of many Super Metroid hackers.

Quietus

Quote from: Phazar on December 25, 2012, 07:07:17 PMIf I recall she created a patch to put the Super Mario theme music into Super Metroid.
Said patch can be found here, along with the LOL one. :^_^:

messiaen

Thanks, I'll look later at that patch, now I'm trying to grasp the escape sequence. Fortunately, this data isn't compressed, I hope other songs aren't as well.

So far, song structure seems pretty straightforward. What Kejardon calls "conductor instructions" is more commonly known as "patterns" in tracker software.

And, gosh, how I hate little-endian pointers :D.

GF_Kennon

Dont know how much this would help but check onwards from my log on bank CF, I hope it helps.

http://gfkennon.metroidconstruction.com/temp.php

messiaen

#5
So, upon further inspection, it turns out that Super Metroid uses pretty much the same N-SPC variant as used in Super Mario Kart. And guess what, years ago I tried a converter for Mario Kart and got it to work reasonably, so it should be basically a matter of adjusting a few lines of code as far as the basic music data goes.

Actually importing the songs to the ROM will be another matter, but this some of the more experienced SM hackers here can work out. I'll see if I can get some proof of concept stuff working soon.

Edit: Yep, it SORTA worked replacing the escape sequence :).

Smiley

Looks like we're going to get something like AddMusic for Super Metroid sometime in the near future.

Also, sorta?

messiaen

#7
Not really someting like AddMusic, but actually a dumbed down version directly derived from AddMusic code.

Here's a little test replacing escape sequence (yes, many channels were removed and I didn't bother looking for correct instruments), but at least the conversion seems ok. Got the ..mml file from SMW Central.

https://dl.dropbox.com/u/55900077/StupidMusicTest.ips

Edit: something a bit more complex (SMW underwater), using loops for optimization Super Metroid Custom Music test

Lunaria

Secret of mana shit

^ Blackhole did this years ago, not sure it really matters much whatsoever, but I felt I should mention it.

DSO

I know my biggest issues with music hacking are keeping track of loop lengths for all the different channels and importing and fine-tuning the pitch of imported custom instruments to match whatever key the current song is in. I'm probably not as excited about this as some others are because I don't think this address those particular issues, but I'm still looking forward to giving this a try.
JAM and I had planned to add a music editor to SMILE JX at some point, maybe the code for this could be ported into SMILE?

Quietus

Progress is progress.  It's just been one part of SM hacking that's been avoided for so long, due to difficulty, and it'd be nice to see it done :^_^:

messiaen

What do you mean by different loop lenghts? I did notice that if tracks of a pattern don't have the same duration the first one to end will make everything else restart. Is this what you mean? If so, it should be a matter of keeping track of pattern duration and adding rests at the end if necessary.

I'm actually not breaking stuff into multiple patterns but rather importing everything as a big chunk of data. I may add "intro" support exactly like the SMW, so in that case there will be just 2 main patterns per song.

The "hacking" part of custom music is actually rather easy, as the N-SPC music engine has been documented for so many years and is pretty much the same on multiple games, but indeed it requires some work by users. Hopefully the existing documents, tutorial and .mml files in the SMW community will be of help.

Crashtour99

"Intro" support would probably be a really good thing.  As I recall, most songs in Super Metroid consist of an A part and a B part.  With some of these, the A part is simply a fade-in and seamlessly transitions to the B part (like the music in Green Brinstar, or the title music (the video that Crys posted has an edited A part with the B part being silence)).  With others they appear to be completely different "songs" though, and I really don't know how those work.

messiaen

What emulator does supports viewing/modyfing SPC-RAM in realtime as well as settings breakpoints on it? I just use ZSNES for playing and editing the ROM is getting tiresome, plus I need to know where those SPC blocks are being uploaded from so I can replace another songs.

Expanding song data may be necessary, is there space in the ROM for it? I never hacked the SNES or NES so I don't understand understand much how banks or data is set. Someone posted a ROM Map in this thread, it seems that songs are scattered ammong diferent banks so does it means that having bigger data will depend on the specific bank each song is in?

Mon732

I believe Geigers Snes9X debugger can view Audio Ram (ARAM), I don't know if that's the same as Spc-Ram.

messiaen

I may be blind, but I can't find a ROM/RAM viewer in SNES9x, kind like those of FCEUDX!

Tried also downloading BSnes debugger, but I can't figure out how to run it (seriously). First tried regular BSnes, did the totally bullshit SFC conversion, then downloaded the debugger version which simply asks me for a folder and then quits. Thought it should be missing some files, so I download v0.86, the equivalent of the debugger version, and placed the exe on the same folder. Didn't work. C'mon, it shouldn't be that hard!

Mon732

Geigers debugger should have a second window with debug options on.
Load a ROM and it should appear then press "Show Hex" to open the hex editor. Remember to press run to let the game play.

Qactis

no no, there is a custom modded SNES9x 1.43 called Geiger's and it has a debugger
http://geigercount.net/crypt/



Scyzer

Do NOT get 1.51. For some reason, it fucks up snes graphics. Not sure if anyone else actually got that problem, but anytime I loaded up Super Metroid, Donkey Kong Country, etc, the graphics were rendered wrong (different format, but I didnt bother looking into it). Took forever to find 1.43 again :|

Plutia

Quote from: Scyzer on January 05, 2013, 11:57:21 AM
Do NOT get 1.51. For some reason, it fucks up snes graphics. Not sure if anyone else actually got that problem, but anytime I loaded up Super Metroid, Donkey Kong Country, etc, the graphics were rendered wrong (different format, but I didnt bother looking into it). Took forever to find 1.43 again :|
What are you talking about? I've always used 1.51 for emulation, and I've never run into this problem.
I've played several metroid romhacks and the DKC series, so it must just be you.

P.JBoy

It messes up some backgrounds, but it has superior debugging so ¯\_(ツ)_/¯

Quietus

Perhaps Cirno is on about the standard 1.51, not the debugging version, which is what I presume Scyzer was on about.

Crashtour99

In my experience 1.43 is the latest version of the debugger that doesn't glitch up the gfx.