NSF files

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

User avatar
thefox
Posts: 3139
Joined: Mon Jan 03, 2005 10:36 am
Location: Tampere, Finland
Contact:

Re: NSF files

Post by thefox »

zeroone wrote:
lidnariq wrote:NSF playback rate ≠ Sample rate...
True. But, my emulator is sampling at the CPU frequency. And, the playback rate modifies that frequency. It would have to compensate by decimating or interpolating back to the standard NTSC/PAL frequency before filtering.
I think you're confused about something. The playback rate field in NSF header should not be modifying the CPU frequency. It only affects at what rate (how fast) the PLAY routine in the NSF is called.
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi
User avatar
zeroone
Posts: 933
Joined: Mon Dec 29, 2014 1:46 pm
Location: New York, NY
Contact:

Re: NSF files

Post by zeroone »

thefox wrote:I think you're confused about something. The playback rate field in NSF header should not be modifying the CPU frequency. It only affects at what rate (how fast) the PLAY routine in the NSF is called.
That's an interesting point. I am treating the PLAY routine like NMI, an event that happens once per frame. And, the number of CPU cycles per frame is constant. So, I interpreted this to mean that the CPU frequency had to be adjusted. But, if the CPU is locked at the standard NTSC/PAL frequency then the number of CPU cycles between PLAY routine calls would have to be adjusted. In a sense, the number of cycles in each frame changed instead of CPU speed. I'll give that shot.

Edit: Thanks. That makes a lot more sense.
User avatar
rainwarrior
Posts: 8062
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: NSF files

Post by rainwarrior »

zeroone wrote:True. But, my emulator is sampling at the CPU frequency. And, the playback rate modifies that frequency.
No, it doesn't. The playback rate merely specifies how long to wait between calls to PLAY. It does not change the CPU frequency.
User avatar
Dwedit
Posts: 4470
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: NSF files

Post by Dwedit »

Changing the playback rate is like having an interrupt call the sound play routine 75 times per second instead of 60. So it's like changing the cycles per 'frame', but nothing else.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
User avatar
zeroone
Posts: 933
Joined: Mon Dec 29, 2014 1:46 pm
Location: New York, NY
Contact:

Re: NSF files

Post by zeroone »

Agreed. Thanks for your responses. I was definitely confused about the timing.
User avatar
zeroone
Posts: 933
Joined: Mon Dec 29, 2014 1:46 pm
Location: New York, NY
Contact:

Re: NSF files

Post by zeroone »

Can someone please provide a source of some multi-chip NSF files for testing purposes? It's easy to search for game music rips, but I haven't been able to find multi-chip homebrew NSFs yet.
Grapeshot
Posts: 85
Joined: Thu Apr 14, 2011 9:27 pm
Contact:

Re: NSF files

Post by Grapeshot »

You can try all the Famicompo Mini entries, available at http://midr2.under.jp/ (unzip them all to the same place and sort by largest size and you will find a lot of multi special chip NSFs) but be aware that a lot of those NSFs are not written according to current best practices. You may have to add heuristics for things like the Namco 163 maximum sample length or files larger than 32k that still claim not to use banking.
User avatar
rainwarrior
Posts: 8062
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: NSF files

Post by rainwarrior »

My favourite multichip NSF is Robokabuto's cover of Riselia Castle from Famicompo Mini Vol. 8. Robokabuto has done the most multi-chip work, I think. If you go to the Famicompo entries pages, there's usually icons showing the chips used, which will help find the multichip ones.
Post Reply