So, a couple of the readers of this blog asked me (in lieu of my current 2 part series on Dr. Mario across the NES and Game Boy) to explain the difference between square waves and pulse waves. Let’s see if I can shed some light on how this works.
So pulse waves use pulse width modulation (PWM). Basically, this assigns a “duty cycle” to the activators that make the pulse wave different shapes. This is manifested in rectangular wave formats:
The image above shows the duty cycle as it grows from 0% to 100%. Duty cycle, literally interpreted, refers to how long something receives power or is activated. We use duty cycle related devices all the time. Say you have a blender with varying speeds from slow to fast. The blender, off, has a duty cycle of 0% or 0/100. Say you set the blender to Speed 1. The blender activates and a duty cycle is assigned for 10/90, that is 10% of the time, the device is activated and 90% of the time it is not. If you pressed Speed 6, it would adjust the duty cycle to 60/40, that is the device is active 60% of the time and inactive 40% of the time. The duty cycle is essentially how all variable speed motors work.
So what does this have to do with the NES? Well, the NES’s pulse waves have the ability to change from duty cycles 12.5%, 25%, 50% and 75%. Each one of these duty cycles has a different timbre. Here’s a great example by fellow game music blogger, explod2a03:
Important fact: most oscillators have duty cycle modulation between 0-50% and not higher. This is because these particular kinds of waves are reflexive. 5/95 sounds the same as 95/5 to us. We can’t tell the difference. Listen to the example by explod2a03 carefully. Can you tell the difference between 25% duty cycle and 75% duty cycle on the 2a03? Sounds identical to me. So why include duty cycle 75%? I’m not sure. If they had included say, duty cycle 33.3%, the NES would have 4 distinct timbres to draw from instead of 3.
This is the real trick behind making the NES sound like it has multiple instruments. Using duty cycle, the NES goes from 2 pulse waves to 2 pulse waves with 3 different timbres each and while the 20a3 is only capable, out of the box, of producing 3 melodic lines, this gives composers MANY more options. It’s also allows for cool effects, like the Bad Dudes example.
Okay, square waves have a square waveform. And that’s why uh… they’re called square waves. This is accomplished by using PWM and changing the duty cycle to be 50%.
When you set the duty cycle to 50%, you get waves that are equal in length. This means that the function is “active” 50/100 of the time or 50% or, on an oscillator, 50/50. This essentially means that a square wave is a TYPE of pulse wave.
What this means for the NES/Game Boy:
The GameBoy is able to produce 2 “quadrangular wave patterns”. While I believe I’ve been perhaps a bit confused as to what that means in the past, a pulse wave IS a quadrangular wave pattern.
So! Since LR35902 is ALSO capable of 4 duty cycles (12.5%, 25%, 50%, 75%) which means the GameBoy can ALSO make pulse waves. Essentially (not counting the sweeps and other features of the GameBoy), the 2a03’s pulse waves and the LR35902’s “quandrangular wave pattern” are identical. Interesting!
I’m a bit infuriated at the misinformation regarding the wave formats of both of these systems. So many people report the GameBoy’s sound as being square waves and it’s not true, not true at all. Someone needs to go through all the Wikis on NES/Game Boy and correct these issues or at least explain the fact that the duty cycle allows for the same timbres. I hope my attempt here will clear up some of the confusion without requiring a degree in electrical engineering!
Last thing (and maybe someone out there can help me on this), it would seem that pulse waves and square waves, even applied with duty cycles, have different output functions. That is, if something is a “stock” pulse wave or a “stock” square wave with duty cycle modulation, the sound is different or are coded different or something. I cannot really ascertain how this works as I’m not an EE. If anyone out there can help, I’d be grateful!
Okay, hope that clears that up for you guys!