Can square wave echoes cancel the other wave?

Discuss NSF files, FamiTracker, MML tools, or anything else related to NES music.

Moderator: Moderators

Post Reply
User avatar
Sivak
Posts: 324
Joined: Tue Jul 17, 2007 9:04 am
Location: Somewhere

Can square wave echoes cancel the other wave?

Post by Sivak »

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?
-Sivak
User avatar
Memblers
Posts: 4118
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Post by Memblers »

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. :)
User avatar
Jarhmander
Formerly ~J-@D!~
Posts: 570
Joined: Sun Mar 12, 2006 12:36 am
Location: Rive nord de Montréal

Post by Jarhmander »

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.
User avatar
Bregalad
Posts: 8153
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Post by Bregalad »

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).
Useless, lumbering half-wits don't scare us.
tepples
Posts: 22898
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

It could be as simple as raising square 2's period by 1 if it equals that of square1.
User avatar
Memblers
Posts: 4118
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Post by Memblers »

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.
Post Reply