Points of Required Attention™
Please chime in on a proposed restructuring of the ROM hacking sections.
Views: 88,485,716
Main | FAQ | Uploader | IRC chat | Radio | Memberlist | Active users | Latest posts | Calendar | Stats | Online users | Search 04-26-24 06:40 AM
Guest: Register | Login

0 users currently in ROM Hacking | 3 guests | 2 bots

Main - ROM Hacking - Capcom Music Engine document + Tutorial New thread | New reply


za909
Posted on 01-19-14 10:04 AM Link | Quote | ID: 155485


Cheep-cheep
Level: 32

Posts: 169/196
EXP: 189069
Next: 17373

Since: 04-27-11

Last post: 3052 days
Last view: 2763 days
Hello people! Now that I finally have the process of hacking a music track in the common Capcom sound engine (used in MM3-6) down, I thought I'd throw this together, so if you're interested, you can learn it as well!

Please keep in mind that this requires some experience with Famitracker, as well as general hex editing.

In this document, you can learn everything through a tutorial, which helps you hack the Megaman 4 stage selec music to sound like the Megaman 2 stage select music.

Get the tutorial pack here

kuja killer
Posted on 01-19-14 09:21 PM Link | Quote | ID: 155486


Level: 55

Posts: 356/628
EXP: 1243857
Next: 70332

Since: 03-20-07
From: Lake Havasu City, Arizona

Last post: 281 days
Last view: 7 days
this is extremely useful. maybe i might be able to put in songs now for megaman odyssey if someone's made one for our hack in Fami Tracker..

but.. what about other Fami Tracker commands and stuff. do you plan someday to cover those too ?? about how to translate them to "what" hex numbers in the mm3-6 music format.

like for example when i look at some megaman songs people made on the famitracker forums, and look at it in fami tracker, there's all sorts of other crazy commands people use.

like "A 00, P 72, G 01" .. not the actual notes, just those settings next to them in fami tracker.

what would all these mean, to the capcom format ? :|

za909
Posted on 01-19-14 10:38 PM Link | Quote | ID: 155487


Cheep-cheep
Level: 32

Posts: 170/196
EXP: 189069
Next: 17373

Since: 04-27-11

Last post: 3052 days
Last view: 2763 days
A lot of these can't be perfectly recreated. The Pxx in famitracker is the same as the fine tuning in the capcom engine, the only difference is that Pxx uses a the more common signed 7-bit value, so 80 is the default pitch, 7F is a bit lower, and 81 is a bit higher, than a normal note. The capcom engine has 00 as default

Axy in fami is a slow fade in, or fade out. You can't do this with the capcom engine, as the only way to control the volume of your sound is through instrument settings, or the volume command.

Gxx delays the row it's on by xx video frames. The capcom engine doesn't allow you to do such things, the only thing you can do, is delay something using a short rest, and then making sure you end up with the same lenght as the other channels, at the end, otherwise you'll desync everything.

Famitracker is simply a user-friendlier environment, which also allows you to do basically anything with the sound hardware, where as the Capcom engine was designed to fulfill the needs of the composers back in the day. In famitracker, everything is about frames, and timing, and in the Capcom engine, everything is based around time signatures and note durations.

kuja killer
Posted on 01-19-14 10:55 PM (rev. 3 of 01-19-14 10:59 PM) Link | Quote | ID: 155488


Level: 55

Posts: 357/628
EXP: 1243857
Next: 70332

Since: 03-20-07
From: Lake Havasu City, Arizona

Last post: 281 days
Last view: 7 days
oh, i see. ok.

i actually seen some of these commands i mentioned, also in the Necro Man song -- when "mexican sunflower" converted kevinnnn's "fruit loops" version or whatever to Fami Tracker.

I see all these G's, and P's and stuff in alot of places.

matrixz was the one who then converted the Fami Tracker, to NES mm3-6 format, for my game.

So i wouldnt have the slightest clue what he did to account for all these G's and P's and stuff..

that's why i asked in first place. "I guess"...just these alternate ways you said

DurfarC
Posted on 01-20-14 06:36 PM (rev. 2 of 01-20-14 06:38 PM) Link | Quote | ID: 155493


Shyguy
Level: 24

Posts: 35/97
EXP: 71899
Next: 6226

Since: 10-23-08
From: Norway

Last post: 1957 days
Last view: 355 days
Nice! This guide is certainly going to be useful to a lot of people. As you might know, I'm familiar with this stuff already, but I never bothered with changing the instruments before, so if I'm going to do that at some point I'm definitely going to use this guide. Hopefully there will be some more people changing the music in their Mega Man hacks from now on. Thanks for sharing this with us.

I especially like how you provided an example of MM2s stage select theme with it, both as a file and as a part of the text tutorial itself, this should make it easier for people to learn how it all works. Though, if I shall be really picky, I would say that the notes in the melody and noise channels and most of the bass channel should be 8th notes, not half notes, as "the tempo you hear" is (roughly) 180 beats per minute, not 4 times as much (720 bpm, which sounds insane enough I guess ). It could be that it's written like this in MM2 of course, and that you did the same because of that. And it wouldn't sound different after all. I guess it's just the musical geek in me coming out.

Basically, what I mean is that a quarter note in musical terms is one quarter of a bar (a bar almost always consists of 4 beats (4/4 time signature), unless it's a waltz, then it's 3 beats per bar (3/4)), not quarter of a beat, like you wrote in your guide. 4 rows in the Famitracker remake of the stage select theme would in other words be one quarter note, not a whole note, and the melody would therefore be in 8th notes. But, as I already implied, it doesn't matter that much, as it will sound the same. I'm struggling a bit with explaining it, but hopefully you get what I mean. If you were going to fix it you would have to rewrite the whole guide though, which you shouldn't do, but maybe you should mention "your definition" of a beat in it somewhere.

Something that's also worth mentioning is that it might be easier for some people to use a score sheet/piano roll based music software when making a reference music file, instead of a "tracker" music maker. Personally I was never a fan of the latter, as I find it much harder to both write the song and read from it when determining what the hex data should be. However, if you want to emulate the NES soundchip as much as possible even when composing the track, Famitracker is indeed the way to go.

Of course, writing music in hex will never really be a user friendly task. I guess I am extremely lucky to have perfect/absolute pitch, so that I can write any song I have in my head into the NES file without having an original music file or music score beside me. So in a way, some of my opinions may not count for most others, I guess.

Don't be discouraged by all this junk I just wrote though. It's a very user friendly guide, as I already pointed out, and I'm sure it will get lots of people into music hacking more easily.

tomaitheous
Posted on 01-20-14 09:02 PM Link | Quote | ID: 155494


Level: 9

Posts: 8/11
EXP: 2235
Next: 927

Since: 01-13-14
From: a desert-y place

Last post: 3725 days
Last view: 3754 days
Why not make a simple script compiler for this? I made for Air Zonk sound engine and I'm gonna re-use that source code for MM1/2 NES music engine format.

____________________
http://pcedev.wordpress.com

Matrixz
Posted on 01-21-14 06:24 PM Link | Quote | ID: 155498


Ninji
Level: 35

Posts: 224/225
EXP: 266370
Next: 13566

Since: 04-07-07
From: Norway

Last post: 3106 days
Last view: 1783 days
Someone was working on a converter/inserter from MML (Music Macro Language) to this engine's format but.. it was never completed or released AFAIK.

This guide looks easy to understand, and in a tone not overly technical (not intimidating).. the images are a good addition. I always found it easier to learn by illustrated images myself.

za909
Posted on 01-22-14 05:53 AM Link | Quote | ID: 155501


Cheep-cheep
Level: 32

Posts: 171/196
EXP: 189069
Next: 17373

Since: 04-27-11

Last post: 3052 days
Last view: 2763 days
It was your documents I learned it from in the first place. The only things I never managed to get were speed related things, like what the exact definition is of 05 xx and how fast the instrument envelopes work (The 5-bit values must be there to add extra "smoothness" by having slower fade times, othwise they would be pointless, since all the volume on hardware level is 4-bit)

I've also been meaning to add a DPCM playback feature to this, using your disassembly of the engine for MM4. Thanks to you I was able to locate the 04 xx bitflags command handler in a hex editor, and NOP-d out all the code, and then tried to replace it with a DPCM channel reset by writing $0F and then $1F to $4015. Nothing was really broken, except the music tracks used the wrong octave sometimes, as the command was not working anymore.
The only thing I really have to figure out now, is how to get around the DPCM glitch corrupting the controller input and/or writes to the PPU, before I start writing a proper sample playing routine. (And also find out how much junk data there is loaded in the $C000-$FFFF area for me to replace it with samples.

But basically the routine would simply check which one of two samples would have to be played, and what pitch to use. Bit 7 being the sample ID, and Bits 3-6 the playback rate. So simple DPCM bass fill-ins are possible!

infidelity
Posted on 01-22-14 02:30 PM Link | Quote | ID: 155503


Fuzz Ball
Level: 66

Posts: 477/968
EXP: 2368019
Next: 93832

Since: 05-24-07

Last post: 958 days
Last view: 814 days
I have DPCM coexisting within my modified 6C80 engine within my Zelda hack.

za909
Posted on 01-22-14 04:52 PM Link | Quote | ID: 155505


Cheep-cheep
Level: 32

Posts: 172/196
EXP: 189069
Next: 17373

Since: 04-27-11

Last post: 3052 days
Last view: 2763 days
I know, and that's really cool! But the thing is, I want to add it to a game that didn't have it originally, and thus, the PPU, and controller reading routines were not designed to deal with the DPCM glitch. And that is what I have to get around somehow.

infidelity
Posted on 01-22-14 05:39 PM Link | Quote | ID: 155506


Fuzz Ball
Level: 66

Posts: 478/968
EXP: 2368019
Next: 93832

Since: 05-24-07

Last post: 958 days
Last view: 814 days
So of i was to insert the DPCM asm that Zelda uses into, lets say, Megaman 4, would the be considered something of usefulness to your document/implementation? Or are you just trying to do a DPCM from scratch?

Sorry if im not undestanding your direction. And also idk what this DPCM glitch is you are talking about. Im only familiar with the Zelda 1 DPCM engine.

za909
Posted on 01-22-14 07:36 PM (rev. 3 of 01-22-14 07:42 PM) Link | Quote | ID: 155508


Cheep-cheep
Level: 32

Posts: 173/196
EXP: 189069
Next: 17373

Since: 04-27-11

Last post: 3052 days
Last view: 2763 days
Yes, I want to program a DPCM engine into either Megaman sound engine (probably 3 though because I'm more familiar with how that game works)

And I could do that no problem, by simply overwriting one of the song effect programs and tell it to jump to my own subroutine somewhere else instead, to play a sample. That's the easy part.
The thing is, that all 2A03 processors have a bug, whenever a DPCM sample is played because the CPU goes ahead to do other things while the 8 bits from the currently loaded sample are played, and the sample buffer needs the next 8 bits to play. However, there's some technical thingo with the data bus having low voltage when reading the PPU and the controller ports in a few CPU cycles. And if a read happens to be in these cycles, the data read will get corrupted. (Bits shifted around and all kinds of randomness)

In the first version of Rockman 4 MI, this bug was there, and the cursor in weapon menu could move randomly on its own as a result. Puresabe fixed it afterwards.

Main - ROM Hacking - Capcom Music Engine document + Tutorial New thread | New reply

Acmlmboard 2.1+4δ (2023-01-15)
© 2005-2023 Acmlm, blackhole89, Xkeeper et al.

Page rendered in 0.023 seconds. (339KB of memory used)
MySQL - queries: 77, rows: 109/109, time: 0.016 seconds.