Logging an NSF to make instruments

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Logging an NSF to make instruments
by on (#182837)
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.
Re: Logging an NSF to make instruments
by on (#182854)
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.
Re: Logging an NSF to make instruments
by on (#182861)
Debug version of repeat can log writes. Quick hack to limit it to $4000-$4015 attatched.
Re: Logging an NSF to make instruments
by on (#182869)
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.
Re: Logging an NSF to make instruments
by on (#183252)
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.