Problems with customized PowerPak NSF player

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Problems with customized PowerPak NSF player
by on (#101669)
Hey guys, it's the woefully-in-over-my-head kalzone again with a new problem. I recently started a chiptune/rock band and bought a PowerPak for playing some NSF's, but I decided I wanted to create some form of visualization for live playing in place of the default NSF player.

I found the source for Loopy's player here:
http://home.comcast.net/~olimar/NES/
...and was able to pretty easily modify for some basic visualization, but I'm having some problems and I thought someone here might have some insight.

My changes are here:
https://dl.dropbox.com/u/99091/NES/nsf.asm

Essentially, I've blacked out the background and text, turned sprites on, and set the portion of RAM used by the NSF engine to also be the sprite table. As a result, characters fly around the screen in time with the music and according to current pitches/effects.

Now here's the problem: with this added code, the sound tends to be glitchy, either occasionally playing notes at the wrong time, generating random blips, or outright freezing, but it isn't consistent or deterministic as far as I can tell. Is it just that I'm transferring far too much data to the PPU during NMI, or what? If so, what can I do to get a similar effect more efficiently.

Any help would be appreciated, though I imagine it might be difficult to help without a PowerPak handy. For those that do have a PowerPak, you should be able to just replace POWERPAK/NSF.NES with this file, but obviously, I highly suggest backing up your copy first.

Thanks!
Re: Problems with customized PowerPak NSF player
by on (#101670)
Whoops, realized I only included the ASM and not the corresponding CHR banks, but I'm using the stock ones from Loopy's player, in case anyone does try to assemble this.
Re: Problems with customized PowerPak NSF player
by on (#101691)
Nevermind, solved the problem. The NSF playback and controller-reading loops had to be moved to NMI so that they're processed serially with the PPU write; otherwise, the playback gets randomly interrupted. Should've known.