Punchout Audio Question

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Punchout Audio Question
by on (#27304)
Still working on sound in NESCore, I've got a few glitches in punchout, was hoping someone could shed some light....

1. Pre-title screen cheering. Unlike cheering between rounds or when an opponent goes down, the cheering at the very beginning of punchout is written directly to $4011 byte by byte. My code generates the approprate percussion line for Battletoads/Double Dragon (which also uses this method) but when I play the punchout DMA, it sounds like static. It appears a few other emulators have this same problem - or is it really static to begin with? How does the frequency work into this? At the moment I'm just chucking bytes as they are written.

2. I've yet to track down where the beefiness from the start-punch and an opponent going down is coming from. Channel 1 plays more of a whimpy falling sound; I'm wondering where the bassy part of it comes from, and how to replicate that?

Thanks!

by on (#27306)
You have to take time into account.
First you need to transform between NES cpu cycles and audio samples. Use the clock cycle timestamps of each 4011 write to determine how long the byte would stay at that value.

by on (#27310)
Alright, got it. That part is fixed. What about the other piece of the initial punch on the title screen when you press start? That doesn't seem to be coming through PCM, White Noise, or anywhere I can find. Is there some trick to generating it through the rectangle?