News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Import midi into GBA game  (Read 10870 times)

soulred12

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Import midi into GBA game
« on: September 03, 2011, 06:41:53 pm »
Hi all.

I'm running Vista.  I'm trying to import midi files into a ROM so I can play them using the ROM's sound banks, which I can then record into an mp3 using separate software.  Unfortunately, I can't get Sappy (which I assume is what I need to use) to run.  When I click on the exe, it tells me: "Component 'comdlg32.ocx' or one of its dependencies not correctly registered: a file is missing or invalid".  I downloaded comdlg32.ocx and copied it to both System32 and SysWOW64 (my comp's 64 bit).  Still gives me the same message.

Any other way to do this (get my own midi into a ROM, specifically Megaman Battle Network 6, so I can record it being played with the BN6 instruments)?  Or any way to get Sappy working?

Thanks...!

Dwedit

  • Sr. Member
  • ****
  • Posts: 307
    • View Profile
    • Dwedit's Website
Re: Import midi into GBA game
« Reply #1 on: September 04, 2011, 04:08:15 pm »
I don't think Sappy will help you import MIDIs into a GBA game, unless I'm mistaken.
"We are merely sprites that dance at the beck and call of our button-pressing overlord."

soulred12

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: Import midi into GBA game
« Reply #2 on: September 04, 2011, 06:45:53 pm »
Oh.

Well then I guess I'm even further from my goal than I thought.

Any idea how I might go about doing this?

Bregalad

  • Hero Member
  • *****
  • Posts: 2751
    • View Profile
Re: Import midi into GBA game
« Reply #3 on: September 05, 2011, 02:21:11 pm »
You should use a program called "Mid2AGB" to do that. This program (which was leaked from Nintendo, so it's distribution is illegal but you can still find it with google) will basically compile a MIDI into assembly source code.

Then you need to compile the source with an assembler (which is usually as.exe which comes with Mid2AGB, it is basically GNU assembler ported to ARM). The object file will contain some header, the sequence data you're looking for and some footer.
By default the assembler outputs binary based at adress 0x0000. You need to make a small program to fix the adresses so you can eventually instert the data at the desired adress, then you just have to copy/paste the data.

This is not complicated but a good understanding of the sappy sound format is needed.

Jorpho

  • Hero Member
  • *****
  • Posts: 4781
  • The cat screams with the voice of a man.
    • View Profile
Re: Import midi into GBA game
« Reply #4 on: September 05, 2011, 07:33:12 pm »
I downloaded comdlg32.ocx and copied it to both System32 and SysWOW64 (my comp's 64 bit).  Still gives me the same message.
FYI, you have to register the component after you put it in the relevant directory: run "regsvr32 [path to file]\comdlg32.ocx".  I think in 7 it only works if it's in the appropriate SystemXX directory (which is where you put it).

It's probably going to ask you for more components afterwards, though.

Quote
(get my own midi into a ROM, specifically Megaman Battle Network 6, so I can record it being played with the BN6 instruments)
I'm guessing you could probably do things the other way around: extract the samples one way or another, and use them to make instrument banks/sound fonts that you can use in some other MIDI-playing program.  I know nothing of the details, though.
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

soulred12

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: Import midi into GBA game
« Reply #5 on: September 05, 2011, 09:04:06 pm »
FYI, you have to register the component after you put it in the relevant directory: run "regsvr32 [path to file]\comdlg32.ocx".  I think in 7 it only works if it's in the appropriate SystemXX directory (which is where you put it).
Ahh...I saw something about that in the link I posted in the first post, but I forgot to mention it kept telling me it couldn't find the file or something.  My comp's 64 bit though so that could be why.  Just for my own info, would I put regsvr64 then or something?

Quote
I'm guessing you could probably do things the other way around: extract the samples one way or another, and use them to make instrument banks/sound fonts that you can use in some other MIDI-playing program.  I know nothing of the details, though.
Supposedly, the programmer for the fangame I am trying to write music for "extracted" the instruments library somehow, but it is a "gsflib" file.  I have no idea what to do with it.  I'm currently in the process of googling the answer but if anyone knows offhand how I can use a gsflib file in a midi sequencer program, please let me know.  Thanks.  If nobody knows/responds, I'll post the answer here myself if and when I find it so others can see.  So if I haven't posted...I haven't found the answer yet.

EDIT: Also, @Bregland, thanks for the post but I don't know my head from a hole in the ground when it comes to the stuff you just typed about, at least in the second paragraph.  I think I've seen a link to midi2abg before, but I don't remember actually downloading it.  It may not matter though because as I've just alluded to I have no idea how to do the other things you're talking about. =/

Jorpho

  • Hero Member
  • *****
  • Posts: 4781
  • The cat screams with the voice of a man.
    • View Profile
Re: Import midi into GBA game
« Reply #6 on: September 06, 2011, 08:28:38 am »
Ahh...I saw something about that in the link I posted in the first post, but I forgot to mention it kept telling me it couldn't find the file or something.  My comp's 64 bit though so that could be why.  Just for my own info, would I put regsvr64 then or something?
No, the command is still regsvr32.  And checking again, it is definitely supposed to go in SysWOW64.

Quote
Supposedly, the programmer for the fangame I am trying to write music for "extracted" the instruments library somehow, but it is a "gsflib" file.  I have no idea what to do with it.
That's not really an instrument library; that's a standard music format for GBA games, if I'm not mistaken.  (Each different tune in the gsflib is accessed with a different "minigsf" file that points to an appropriate section of the gsflib.)
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

Dwedit

  • Sr. Member
  • ****
  • Posts: 307
    • View Profile
    • Dwedit's Website
Re: Import midi into GBA game
« Reply #7 on: September 06, 2011, 11:22:22 am »
If you want to get midi out, there's a friendly tool called "gba2midi" which will extract music from GBA roms which use the standard sound system.

Internally, GBA games use a special format for sequenced music.  It is converted from MIDI, but what's actually in the games looks nothing like MIDI.  I don't know offhand of any homemade utilities that convert to the GBA sequenced music format, but Nintendo gave their developers the music SDK, and that will do it.


A GSF file is a stripped ROM image and Savestate, which is then compressed.  The minigsf files just give it a slightly different savestate, which will make it play a different song.  It's a music rip format intended for playback only.
"We are merely sprites that dance at the beck and call of our button-pressing overlord."

henke37

  • Hero Member
  • *****
  • Posts: 643
    • View Profile
Re: Import midi into GBA game
« Reply #8 on: September 06, 2011, 12:21:15 pm »
He wants MIDI in, or alternatively, instrument definitions out.

soulred12

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: Import midi into GBA game
« Reply #9 on: September 11, 2011, 03:16:58 am »
Alright.

I've had 0 luck on this so far (aside from you fine people and your helpful posts ^_^).  I desperately want to be able to do this, but it's seeming more and more like unless I spend lots of time learning about hacking, I'm never going to be able to.

The closest thing I remember getting to what I want was when I used, I believe (it was quite a while ago), sappy.exe to export a midi, and saw that it had an "include samples" (or something similar) checkbox.  But whenever I checked the box and tried to export, it would crash.  It would export a midi if I didn't check the box, and the midi would match the actual tracks from the game exactly, but it would play using my sound card's instruments rather than the game's.

It's frustrating because I just can't seem to get a perfect copy of the instruments just by starting with a generator in Garageband and tweaking settings, despite how extensively I've tried.  I've had a look at the two links on "Music hacking" on the romhacking site, but none of the articles are specifically on Megaman Battle Network 6, and as your site even says music formats vary wildly between games.

I just don't know what to do.  Please help, if possible.

Jedi QuestMaster

  • Hero Member
  • *****
  • Posts: 969
    • View Profile
Re: Import midi into GBA game
« Reply #10 on: September 11, 2011, 05:09:01 am »
There's this MOD Player I've been meaning to test out.

Has anyone tried it?

Bregalad

  • Hero Member
  • *****
  • Posts: 2751
    • View Profile
Re: Import midi into GBA game
« Reply #11 on: September 11, 2011, 02:30:23 pm »
To rip instruments and midi, use agb2midi, NOT sappy.
Sappy is old and completely outdated.

You can rip both midis and instruments (in the form of a collection of wavs) with agb2midi. The only problem remaining is the chiptunes instrument, which could be quite simple to simulate.

syntax error

  • Full Member
  • ***
  • Posts: 227
    • View Profile
Re: Import midi into GBA game
« Reply #12 on: September 11, 2011, 02:34:22 pm »
Bregalad is the game MIDI king.

soulred12

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: Import midi into GBA game
« Reply #13 on: September 11, 2011, 03:49:13 pm »
To rip instruments and midi, use agb2midi, NOT sappy.
Sappy is old and completely outdated.

You can rip both midis and instruments (in the form of a collection of wavs) with agb2midi. The only problem remaining is the chiptunes instrument, which could be quite simple to simulate.
This would be fantastic if I could get it to work.  But, I can't seem to find agb2midi with a google search.  (only turns up one result, incidentally a different thread I posted about this issue a while ago)

Do you mean gba2midi?  That's the closest thing (with regard to name) that I've been able to find.  The weird thing is that another person's mentioned it in a different thread, and you mentioned the same name twice, which leads me to believe it wasn't a typo--yet absolutely nothing for "agb2midi" comes up on google.

Jedi QuestMaster

  • Hero Member
  • *****
  • Posts: 969
    • View Profile
Re: Import midi into GBA game
« Reply #14 on: September 11, 2011, 04:34:22 pm »

soulred12

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: Import midi into GBA game
« Reply #15 on: September 11, 2011, 04:56:57 pm »
http://gbaemu.dcemu.co.uk/agbmidi-1-0a-177564.html

But I can't download it there. :-\

Try here:

http://filetrip.net/f3836-AGBMidi-1-0a.html
Ahh...agbMidi, not agb2midi...No wonder I wasn't finding any results.

Thanks!  I will test and report back.

EDIT: But wait, this is a GBA ROM, not an exe...and when I load it into VBA, it doesn't seem to have any way to actually compose anything, let alone rip samples from a ROM.  Thanks for the link, but something tells me what I need really IS agb2midi.  Or, am I not understanding how I'm supposed to use this?

(The MOD player linked to above also seemed to be the same type of thing...it had some "sample" music that could be played, but no way to compose, import or export)

Jedi QuestMaster

  • Hero Member
  • *****
  • Posts: 969
    • View Profile
Re: Import midi into GBA game
« Reply #16 on: September 11, 2011, 05:33:56 pm »
agbmidi_conv is the exe.  Load it from command prompt & go from there.

I'm still trying it out, so I don't know how it works. :-\

soulred12

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: Import midi into GBA game
« Reply #17 on: September 11, 2011, 05:37:06 pm »
Ah, I see.  I will test it as well and see how it works.  Thanks.

Jedi QuestMaster

  • Hero Member
  • *****
  • Posts: 969
    • View Profile
Re: Import midi into GBA game
« Reply #18 on: September 12, 2011, 09:11:05 pm »
The program doesn't come with with preset patches.  Anyone know where any are available?