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

Author Topic: About Famitracker compositions into a NES rom  (Read 3513 times)

Timaeus

  • Jr. Member
  • **
  • Posts: 74
  • Noel <3
    • View Profile
About Famitracker compositions into a NES rom
« on: February 13, 2020, 08:39:46 am »
  I decided to try to use Fl Studio and Famitracker to compose songs for my Megaman 1 hack, and I found out that Famitracker can make them play into a NES rom, but I do not know how. I have been testing with a single composition, but I assume I need some sort of NES asm files to do such a thing. Am I suppose to do something else other than locating data and pasting the data of my nes composition file?

  I am new at this, so I appreciate every advice.

  Thank you.

nesrocks

  • Hero Member
  • *****
  • Posts: 639
    • View Profile
    • nesrocks.com
Re: About Famitracker compositions into a NES rom
« Reply #1 on: February 13, 2020, 08:46:15 am »
You can use bbbradsmith's eznsf to convert nsf to nes ROM, but getting compositions into megaman 1 is a completely different (and much harder) issue. Is that your goal?

Timaeus

  • Jr. Member
  • **
  • Posts: 74
  • Noel <3
    • View Profile
Re: About Famitracker compositions into a NES rom
« Reply #2 on: February 13, 2020, 09:06:05 am »
  I want to add different musics to Megaman 1 (I do not mind if they need to be midis or something).

Jorpho

  • Hero Member
  • *****
  • Posts: 4252
  • The cat screams with the voice of a man.
    • View Profile
Re: About Famitracker compositions into a NES rom
« Reply #3 on: February 13, 2020, 09:31:07 am »
In order to use Famitracker music directly, you would have to make big changes to the ROM to replace its existing sound engine with Famitracker's equivalent code.  I don't think anyone has ever done this with any game.

Otherwise, you will have to analyze Megaman's sound engine, determine exactly how it stores the data for its music, and change your music into the same format.  This is also extremely difficult as it is likely some completely unique format and not just MIDI or anything resembling MIDI.

Do you know of any currently-existing Megaman ROM hacks that use new music?
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

Timaeus

  • Jr. Member
  • **
  • Posts: 74
  • Noel <3
    • View Profile
Re: About Famitracker compositions into a NES rom
« Reply #4 on: February 13, 2020, 10:11:45 am »
  I do. I heared that there is a good engine for that, but which of the two ways is more appeling to me? I managed to do asm edits in Sonic 1 before, if that helps.
« Last Edit: February 13, 2020, 10:17:36 am by Timaeus »

Notthisguy

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: About Famitracker compositions into a NES rom
« Reply #5 on: February 13, 2020, 02:09:26 pm »
Yeah there's a few good forum posts on that.  By the time you're done sorting through them, you will have more questions than answers. 

(one guy's experience with FF1 engine)
http://www.romhacking.net/forum/index.php?topic=12816.0

1..Several mega man 2 3 and 4 rom hacks use lots of new music, but they were done with assembly.  It looks like they disassembled the (level hacked and graphics hacked) original rom, and replaced the sound engine with famitone.  https://github.com/nesdoug/famitone4.1

2..You CAN reassemble it with the original sound engine, but you then have to figure out its music format and how to assemble the songs. 

3..The other way to do this (which i do not recommend) is by figuring out the music format by identifying music playing in the memory viewer, tracing its values back to the rom, and finally hex editing the notes or the timing. 
It helps to have famitracker save as txt for this. 

I am still trying to wrap my head around the process myself, since I've been playing around with Zelda II lately.  I have similar goals for a Zelda 2 project but I'm no ASM expert, so I'm still trying to figure out how to reassemble this mess XD
I used smartrenes for disassembly, I'm planning on using cc65 to reassemble.  Maybe someone can offer some more experienced insight on the nature of hacking the sound processor.   :-X

There IS a capcom music editor but it likes to crash, it's missing features etc.  http://www.romhacking.net/utilities/1245/
I think it only works for megaman 3 4 5 and 6. 
« Last Edit: February 13, 2020, 02:39:47 pm by Notthisguy »

Jorpho

  • Hero Member
  • *****
  • Posts: 4252
  • The cat screams with the voice of a man.
    • View Profile
Re: About Famitracker compositions into a NES rom
« Reply #6 on: February 14, 2020, 12:38:01 am »
How do you feel about Wily Wars?  There has been some work done lately in hacking Genesis games to use redbook audio.
https://www.romhacking.net/forum/index.php?topic=29280.0

If it's anything like the MSU-1 for the SNES, you only have to worry about disabling the existing music and inserting some trivial code to start playing redbook audio, which can be pretty much anything you want.
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

Koopa

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: About Famitracker compositions into a NES rom
« Reply #7 on: February 16, 2020, 09:21:46 pm »
I haven't hacked music in Mega Man 1 or 2 before, but I guess they have older version of the music engine that Mega Man 3-6 and other newer Capcom games use. Some commands have different values, but the notes are probably the same.

Do this tutorial:
http://acmlm.kafuka.org/board/thread.php?id=7844

Download these:
http://www.romhacking.net/documents/785/
http://www.romhacking.net/documents/660/
http://www.romhacking.net/documents/274/

One solution is to make a script that converts from FamiTracker to Capcom music data. Another solution is to rewrite the music by using a hex editor.

I made a tool that helps me to write new music data.
Here is a little demonstration video of how to change the music:
https://streamable.com/zjses

Timaeus

  • Jr. Member
  • **
  • Posts: 74
  • Noel <3
    • View Profile
Re: About Famitracker compositions into a NES rom
« Reply #8 on: February 19, 2020, 08:36:35 pm »
Since I was lacking focus on what to do next, I will focus on changing enemies and weapons AI and leave the music for later, but I will make sure to take a look at the links. Thank you so much guys. I will update this topic again when I get into the musics. Thanks again, everyone.

Ti_

  • Jr. Member
  • **
  • Posts: 46
    • View Profile
Re: About Famitracker compositions into a NES rom
« Reply #9 on: February 23, 2020, 05:06:06 am »
In order to use Famitracker music directly, you would have to make big changes to the ROM to replace its existing sound engine with Famitracker's equivalent code.  I don't think anyone has ever done this with any game.
"Darkwing Duck - SoR2 music" and "Sonic The Hedgehog (NES) Improvement + Music" does this.

DDuck hack uses both sound engines (original only for sound effects). Ftm driver variables are located in prg-ram $6000-$6180 (about 384 bytes with vrc6 channels support).

Somari hack fully replaces original engine: $700-$7FF is ram of original engine. And same are used for ftm driver. (256 bytes with 2a03 channels only). And for sfx it uses custom driver, which use only several bytes of ram.

Also ftm tracks uses a lot of ROM space, so there was many extra banks added.

Alternate Famitone driver has a much less requirments (and lower cpu usage), and also has a sfx support, but has many limitations to famitracker compositions.

PolishedTurd

  • Full Member
  • ***
  • Posts: 151
    • View Profile
Re: About Famitracker compositions into a NES rom
« Reply #10 on: February 24, 2020, 06:38:14 pm »
"Darkwing Duck - SoR2 music" and "Sonic The Hedgehog (NES) Improvement + Music" does this.

DDuck hack uses both sound engines (original only for sound effects). Ftm driver variables are located in prg-ram $6000-$6180 (about 384 bytes with vrc6 channels support).

Somari hack fully replaces original engine: $700-$7FF is ram of original engine. And same are used for ftm driver. (256 bytes with 2a03 channels only). And for sfx it uses custom driver, which use only several bytes of ram.

Also ftm tracks uses a lot of ROM space, so there was many extra banks added.

Alternate Famitone driver has a much less requirments (and lower cpu usage), and also has a sfx support, but has many limitations to famitracker compositions.

I'm very intrigued. You're saying VRC6 audio support can be added in 0x180 bytes, and song data can be ported directly from FamiTracker, effectively for any ROM with enough space? It can't be that easy. Where can I learn more? The VRC6 sounds so beautiful; I would love to use it in several games.

Edit: Is this also possible for the VRC7?
« Last Edit: February 24, 2020, 09:08:48 pm by PolishedTurd »

Ti_

  • Jr. Member
  • **
  • Posts: 46
    • View Profile
Re: About Famitracker compositions into a NES rom
« Reply #11 on: February 25, 2020, 03:54:10 pm »
In default .nsf files created by famitracker, memory locations configured to $00-$1F, and $200+.

Download: FamiTracker.NSF.Driver-v2.11.zip
In nsf.cfg change this settings:
ZP and RAM

In driver.s adjust other settings like vrc6.

In player.s change/delete this :  sta $5FFB(.nsf bank register). (And in apu.s sta $5FFC-$5FFE).

With famitracker create output for your song (file -> create nsf -> type of file change to ASM - assembly source).

Now you can generate new .nsf with build.bat. This will create NSF with differently configured driver.
Now if you cut 128bytes-header from .nsf file,  you will get a rom part with driver+music.  Where's $8000 is jmp to start song, and $8003 to update (put JSR to $8003 in NMI).

Or you may use source asm driver, If it 's more convenient.

For multiple tracks, it's more difficulty, because NSF it's 'impossible format' - bank switching doesn't match real existing mappers (something about 1-4 kb banks). You need manually split tracks to 8 or 16 kb banks, depends on what you needed.

February 25, 2020, 04:02:03 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
The VRC6 sounds so beautiful; I would love to use it in several games.
Mappers #24 (with VRC6) has a 16+8+8 prg bank scheme. Not all MMC3 games possible to convert. Plus IRQ works differently.
« Last Edit: February 25, 2020, 04:02:03 pm by Ti_ »

Timaeus

  • Jr. Member
  • **
  • Posts: 74
  • Noel <3
    • View Profile
Re: About Famitracker compositions into a NES rom
« Reply #12 on: March 01, 2020, 05:46:05 pm »
  I wanna thank Koopa so much for the links. I learned most of how it works and managed to compose two tracks inside the game. Thank you very much! I will try to continue using hex for it, since I am used to it, but if things go too harsh, I may need to try other methods maybe.

  Also, is Famitone with Famitracker a good alternative to edit the musics instead of hex editing?
« Last Edit: March 02, 2020, 06:54:43 pm by Timaeus »