Get rid of vibrato clicking (pop) in ppmck / mml SM

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Get rid of vibrato clicking (pop) in ppmck / mml SM
by on (#101653)
It's kind of driving me crazy. I haven't been able to find a way to eliminate the clicking / popping sound when using vibrato on certain notes like "a" in a square channel.

I know the SM command exists in the newest versions of ppmck but that doesn't seem to do anything.
From the research I've done the problem is well known and called "phase reset".

I found this post at Famitracker.com: http://famitracker.com/forum/posts.php?id=3175&sort=2
Which led to this post here: viewtopic.php?t=231

But honestly it's a little over my head.

The last post on that thread at famitracker says they got it working and links to this mmlshare url http://mmlshare.com/tracks/view/236 but I think he's updated it since then because I don't see anything in there that looks related to this problem.

Please show me an example of how to eliminate the clicking and educate me on why it works. Maybe the answer is already in those other posts but like I said it's beyond my understanding.

And as always thanks!
Re: Get rid of vibrato clicking (pop) in ppmck / mml SM
by on (#101680)
IIRC, my little experiment failed. I got the "y" command working on one note, then ran into problems.

Someone made a hack of PPMCK which supposedly eliminates vibrato clicking, but I couldn't even get it to compile nsfs. As for "SM", it does provide a legato effect for rapidly changing notes, but doesn't affect the notes which cause the clicking.
Re: Get rid of vibrato clicking (pop) in ppmck / mml SM
by on (#101685)
As the clicking is a hardware issue, not software one, it is better to just work around it the easy way. Like, just don't use vibrato on A-3. Yes, it could be worked around using the hardware sweep, but I don't think it was used in the past, in commercial games.
Re: Get rid of vibrato clicking (pop) in ppmck / mml SM
by on (#101698)
In famitracker the rule of thumb is to not use vibrato stronger than 2 on A-3. Some people will alter the pitch of A-3 to make room, e.g. P81 allows vibrato of 3, etc...

The reason it happens is that whenever the pitch control value crosses a multiple of 256, setting the higher bits causes the phase of the square generator to be reset (making a click).

Here are the boundaries that have this problem:

G#-3 / A-3
G#-2 / A-2
C#-2 / D-2
G#-1 / A-1
F-1 / F#-1
C#-1 / D-1
B-0 / C-1

A-3 is normally the only one people notice. The numbers are bigger as the pitch goes lower, so there is more space between notes and you are less likely to cause clicking via vibrato. Since A-3 is the highest one, it has the worst problem.

If you want to listen to an NSF without this problem, you can use NSFPlay and disable the phase reset in the APU1 options panel. This isn't authentic to the hardware, obviously, but you could finally listen to the Mega Man 2 ending without that dreadful click, for example.

Yes, there are tricks using the hardware sweeps to get around it, but as shiru said, no games used them at the time. A few people have been using it recently.
Re: Get rid of vibrato clicking (pop) in ppmck / mml SM
by on (#104077)
Surprised Famitracker hasn't got a fix for this yet?

It's been pretty well documented (thanks to blargg who discovered the trick) on here and reasonably straightforward to implement.
Re: Get rid of vibrato clicking (pop) in ppmck / mml SM
by on (#104083)
jsr implemented it, but he didn't put it in because so few NSF players emulate the frame sequencer behaviour correctly. NSFPlay was one of them (didn't have any $4017 response until the current beta).

Even though Blargg's sweep trick was discovered years ago, I'm not aware of any NSF release that used the technique before the very recent Streemerz NSF.