Certain NSF files play, but others don't

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

Moderator: Moderators

Post Reply
swansway
Posts: 2
Joined: Fri Jul 22, 2022 9:21 am

Certain NSF files play, but others don't

Post by swansway »

Hullo,

Just registered to the forum—exciting. I have a quick question about NSF files: been working on a ROM for the past couple of months. You can find the source here with additional files containing constants, addresses, and macros. So, this week I thought I'd tackle including an NSF file to play in the background, so I put something together using FamiStudio, exported it as NSF, and included it in my main asm file. It assembles without errors in either pass.

When I try running the ROM on Nestopia, I hear this faint popping sound, but otherwise nothing seems to play. What's interesting is that I tried using hxlnt's awesome computers-are-easy NSF music file, and that one plays with my ROM without any obvious issues.

I tried a few more NSF files from class NES games, and I don't seem to get more than either pops or short square-wavish tones before going silent again. I wonder if there's anything about hxlnt's NSF file that is different than the others? This is my first time working with this file type, so any and all information is much appreciated! (I've been seeing talk online about NSF file headers, but I am not super sure about how this works)

Dunno if this information helps, but here it is anyway:
- Assembler: NESASM (seems to be an unpopular choice)
- OS: MacOS
- IDE: VSCode
Joe
Posts: 650
Joined: Mon Apr 01, 2013 11:17 pm

Re: Certain NSF files play, but others don't

Post by Joe »

NSF files are almost complete NES programs themselves. They may use RAM that your program is already using. They may rely on being located at a specific address in the ROM. They may rely on NSF bank switching registers.

HXLNT's program is designed specifically to work with that one NSF, and I suspect the NSF was also designed specifically to be easy to embed in a NES ROM.

You'll have a much better time embedding music in your ROM if you use a sound engine in source code format instead of a NSF. FamiStudio provides a sound engine you can use.
swansway
Posts: 2
Joined: Fri Jul 22, 2022 9:21 am

Re: Certain NSF files play, but others don't

Post by swansway »

Oooo I'll take a look at this and report back. Thanks a bunch for the tip!
Post Reply