Perhaps this has been discussed as a part of other threads, but I figured I'd create a dedicated thread. The issue I have in my APU emulation is that there are awful pops when DMC samples are started. I've already implemented my emulation of writes of $4011 in such a way that the values aren't sent directly to the "DAC", and this helps a great deal with some games (e.g. Darkman and TMNT). But there are still a number of games where DMC samples sound horrible (e.g. Ninja Gaiden and Ninja Gaiden 2).
Is there any common method of masking DMC pops in NES emulators? Low-pass filtering, some sort of ramping..?
1. The simplest way is just to ignore writes to $4011.
2. A more complicated way might be to suppress the pop, but remember the target delta and add it back in slowly (basically replace the pop with a ramp).
NSFPlay implements both of these if you want to see what they sound like (APU2 options: Enable $4011 register, Eliminate clicking noise).
The only real drawback with #1 is that with quiet DPCM samples you lose the changes in volume due to nonlinear mixing. With loud DPCM samples it doesn't matter because they will clamp at the edges and self-centre.
Method #2 is conceptually similar to separating just the pop into a separate signal and applying a lowpass filter to it, the ramp will still make a sound, just a lot less noticeable. What I did when implementing it is whenever $4011 is written to, I work out the the size of the resulting jump in output, then I generate an additional signal that is an exactly opposite jump against it which will gradually fade back to zero, and mix that in. This way the true delta counter value is preserved, along with the nonlinear mix, but the pop is suppressed.
Though, looking at Ninja Gaiden and Ninja Gaiden 2, I notice these games don't use $4011 with their DPCM samples. Have you considered that the sound you're hearing is just the way the samples in these games sound? (Though Darkman does not either, so I am unsure how you found an improvement there.)
Quote:
I notice these games don't use $4011 with their DPCM samples.
Huh. I thought that was the only thing I had changed. I'll have to go through the code when I'm at home to see if there was anything else I modified that could've affected Darkman & TMNT1 (because I used to have very noticeable pops in them as well).
In fact, there's
another method. I discovered it a while ago, but since it can't be replicated on hardware, I was fired against such tip
Do people really find the pops in e.g. Castlevania II annoying? If you remove them, the drums seem to lose a lot of their "punch".
Quote:
Do people really find the pops in e.g. Castlevania II annoying?
I'm not trying to get rid of pops where they were noticeable even when played on a real NES. The pops I'm trying to get rid of are ones that shouldn't be there (i.e. that are resulting from flawed emulation), like the ones I have in Ninja Gaiden.
ulfalizer wrote:
Do people really find the pops in e.g. Castlevania II annoying? If you remove them, the drums seem to lose a lot of their "punch".
With headphones on, yes, I very much dislike the Konami bass drum pops, and I am glad when I have the option to turn them off. Over a loudspeaker they don't bother me.
rainwarrior wrote:
ulfalizer wrote:
Do people really find the pops in e.g. Castlevania II annoying? If you remove them, the drums seem to lose a lot of their "punch".
With headphones on, yes, I very much dislike the Konami bass drum pops, and I am glad when I have the option to turn them off. Over a loudspeaker they don't bother me.
I only use headphones, and I still prefer the pops. No accounting for taste I guess...
Here's the discussion regarding my empirical find on pops, if anyone's interested.
rainwarrior wrote:
Method #2 is conceptually similar to separating just the pop into a separate signal and applying a lowpass filter to it, the ramp will still make a sound, just a lot less noticeable. What I did when implementing it is whenever $4011 is written to, I work out the the size of the resulting jump in output, then I generate an additional signal that is an exactly opposite jump against it which will gradually fade back to zero, and mix that in. This way the true delta counter value is preserved, along with the nonlinear mix, but the pop is suppressed.
That technique was easy to implement and it worked well for me. Thanks for this suggestion.