Can square wave echoes cancel the other wave?

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Can square wave echoes cancel the other wave?
by on (#48724)
I have seen this issue with a few tracks in the game, but it seems to happen randomly, but when it does, it's kinda annoying.

I like to use the echoing of square waves as it has a nice sound, but don't like that square 2 cancels square 1's sound.

Can anything be done about this?

by on (#48730)
Change the frequency by a small amount on the 2nd channel, or perhaps use a light vibrato on one of them. Instead of canceling out, you'll get a really cool phasing effect. :)

by on (#48740)
If you do some writes in $4003/$4007 to both square waves to the start of the note, they will be always sync'd, since writing to these registers reset the phase, so no wave cancelling is possible.

by on (#48750)
Yeah but if they almost cancel, a very annoying sound is heard. One solution is to use a different duty cycle for the echo, or do what memblers says if your sound engine is complex enough to support that. (when 50% square echoes a 75% or 87.5% rectangle wave it sounds cool).

by on (#48752)
It could be as simple as raising square 2's period by 1 if it equals that of square1.

by on (#48754)
Also it's kind of interesting that this phasing effect is present in the hardware, if you hit the sweep registers it automatically adds 1 to the 2nd pulse channel. The only thing that really shows that effect, that I can think of, is The Guardian Legend - the "alarm sound" before you fight a boss. It used to sound canceled on emulators before that was discovered.