Logging an NSF to make instruments

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

Moderator: Moderators

Post Reply
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Logging an NSF to make instruments

Post by tepples »

I'm trying to extract instrument definitions from NSFs, so I can make mash-ups and parodies using tools such as FamiTracker. I figured I could do this by logging an NSF's writes to APU ports $4000 through $4015 over time and then analyzing the logs for exact frame-by-frame pitch, duty, and volume parameters. Which NSF players can log writes to this range?

If it matters, I'm using 32-bit Linux at the moment, and I have a working copy of Wine installed. And I'd like to include only writes to this range, not every single instruction whose logging would bog the player down with formatting and I/O. If there's no such tool, I guess I'll have to start with fake6502.c by miker00lz.
User avatar
rainwarrior
Posts: 8732
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Logging an NSF to make instruments

Post by rainwarrior »

If Famitracker runs in Wine, this Famitracker-derived tool I made years ago should do the trick:
http://rainwarrior.ca/projects/nes/nsfimport.html

If NSFPlay runs in Wine, it also has a feature for logging register to text (not exposed in UI, but through .ini file and documented in readme):
http://rainwarrior.ca/projects/nsfplay/

Before these two tools I used to use NSFPlay's keyboard view with its time dilation feature. You can watch the register values played back at slow speed.
Rahsennor
Posts: 479
Joined: Thu Aug 20, 2015 3:09 am

Re: Logging an NSF to make instruments

Post by Rahsennor »

Debug version of repeat can log writes. Quick hack to limit it to $4000-$4015 attatched.
Attachments
repeat-0.11a-debug.gz
(22.4 KiB) Downloaded 250 times
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Logging an NSF to make instruments

Post by tepples »

Thanks rainwarrior. Both executables worked in Wine. In nsfplay.exe, I had to change NCH=1 to make wave export not be one second of music then a second of silence and repeat. In NSFImport.exe, I was able to save a .ftm that I could open in my normal FT installation and export a text file. From there, I read out the envelopes.

Your reward is a little contest: The first user to identify the game that I mashed up with Blaster Master in this NSF gets a golden cookie.
Attachments
Try.nsf
(8.02 KiB) Downloaded 259 times
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Logging an NSF to make instruments

Post by tepples »

Nobody? After a week?

I guess only NovaSquirrel was on the ball enough to figure out that the part just before the end of the loop was secretly replaced with Folgers Crystals "Concrete Jungle" in Cameltry.
Post Reply