Modifying NSFs

Discuss NSF files, FamiTracker, MML tools, or anything else related to NES music.

Moderator: Moderators

Post Reply
aitsu124
Posts: 6
Joined: Mon Jun 13, 2016 6:12 am

Modifying NSFs

Post by aitsu124 »

I'm new to the NSF scene. How do I modify NSFs?
User avatar
rainwarrior
Posts: 8734
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Modifying NSFs

Post by rainwarrior »

They're not easy to modify, because they're the same kind of content as an NES ROM, just with no video output. The NSF file is NES machine code and music data.

To modify an NSF you need the same skillset as for NES ROM hacking. Learn the 6502 instruction set. Analyze and disassemble the code. Figure out what part does the thing you want to change, and patch that part of the code.

Every NSF has different code in it; there's no ready-made solution for this kind of thing. There are easy ways to make new NSFs from scratch, but modifying existing ones takes a lot of work. If it's for a specific game, someone may have already done some work to document the music code for you. Check romhacking.net just in case.

You might ask a more specific question, like, "how do I change the melody in track 3 of the NSF for Super Mario Bros?", because you might get a more useful answer. There's not much anybody can help in response to the general question.
aitsu124
Posts: 6
Joined: Mon Jun 13, 2016 6:12 am

Re: Modifying NSFs

Post by aitsu124 »

In that case, what I'm working on is making the NES versions of arcade ports, starting with Mario Bros. (using the European exclusive Mario Bros. Classic Series) and Donkey Kong (using DK: Original Edition). I'd like to modify the sound effects and music to be more like the arcade version. This means I just need to change the pitch and tone and things like that. Romhacking.net doesn't seem to have anything.
User avatar
dougeff
Posts: 3079
Joined: Fri May 08, 2015 7:17 pm

Re: Modifying NSFs

Post by dougeff »

I think, conceptually, what you want is to emulate the Nintendo Vs Arcade system. There already are emulators that do that.

Otherwise, you're going through a lot of effort just to emulate it on an incompatible emulator.

This reminds me of the 'hack ideas' over at rockhacking.net, where people often say...'hey, can you take the improved graphics version of the GBA port, and insert them into the NES version'. And, all I can think is...'why? You already have a GBA version that looks exactly like that. Why put 3-6 months work just to get the exact same looking thing?' I digress.
nesdoug.com -- blog/tutorial on programming for the NES
aitsu124
Posts: 6
Joined: Mon Jun 13, 2016 6:12 am

Re: Modifying NSFs

Post by aitsu124 »

I made a typo - I'm trying to make the NES versions of arcade ports, starting with Mario Bros. (using the European exclusive Mario Bros. Classic Series) and Donkey Kong (using DK: Original Edition) more like their original arcade versions. The hack ideas thing is just any ideas that come to mind and make someone think, "Hey, that would be interesting". In certain cases, though, I agree - definitely not worth multiple months of work. What I'm trying to do is what everyone wanted back in the early to mid 80s: bring as good as possible arcade experiences to home consoles. And the NES versions just don't do it for me. They could've pushed the system to its limits to get better experiences, maybe not at first but at least by 1992 or so. I intend to do that.
User avatar
dougeff
Posts: 3079
Joined: Fri May 08, 2015 7:17 pm

Re: Modifying NSFs

Post by dougeff »

I'm saying it's not worth doing, because it's already done. Get a Vs emulator (MAME ?), done.
nesdoug.com -- blog/tutorial on programming for the NES
User avatar
rainwarrior
Posts: 8734
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Modifying NSFs

Post by rainwarrior »

They're not VS games. Both MB and DK ran on a Z80 with an I8039 doing the sound. (They are both emulated by MAME though.)

Anyhow, I think the kind of thing you're asking would probably take a couple of days for someone with a lot of NES development experience to accomplish. Might be a couple of months of learning preceding that for someone who is new to it. Really depends on what kind of skills you already have, versus how interesting the project is to you.
aitsu124
Posts: 6
Joined: Mon Jun 13, 2016 6:12 am

Re: Modifying NSFs

Post by aitsu124 »

I can easily modify palettes and graphics, and soon I should be able to do text as well. It's just the music and sound effects I can't do. Would it be possible to modify addresses found within the sound area/NSF to change them? Once again, I just need to kind of make them more detailed, probably deeper, whatever I find needs to be done to make them sound like arcade games. If there's a way to modify addresses, I could probably just find out where the sound is and experiment in that area until I find what works.
User avatar
Jedi QuestMaster
Posts: 688
Joined: Thu Sep 07, 2006 1:08 pm
Location: United States
Contact:

Re: Modifying NSFs

Post by Jedi QuestMaster »

Numerous times I'd accidentally freeze a channel's pitch/octave using the Cheat Console function in FCEUXD. Are you familiar with reading/writing breakpoints?
aitsu124
Posts: 6
Joined: Mon Jun 13, 2016 6:12 am

Re: Modifying NSFs

Post by aitsu124 »

No, but I've heard of them. What is the Cheat Console thing? Is that like the Cheats function in FCEUX, where you can set new values to addresses? I might try playing around with it before I try to figure out this NSF stuff.
User avatar
dougeff
Posts: 3079
Joined: Fri May 08, 2015 7:17 pm

Re: Modifying NSFs

Post by dougeff »

Probably won't work. You need advanced knowledge of 6502 assembly to understand what you're looking at, or to know what to set breakpoints for.

I recommend putting a 'help wanted' ad over at romhacking.net, and try to find someone who already knows how to do this stuff.
nesdoug.com -- blog/tutorial on programming for the NES
Post Reply