The given examples seem disconnected from the duty cycle radios on my browser. I mean changing them changes the sound, but it's as if the one I selected is not the one playing.
Anyway, what could have been the purpose for the gameboy hardware to provide both 25% and 75% duty cycle? In audio, these sound identical to a human, no? They are the same waveform with inverted polarity. They have the same overtone content.
> The given examples seem disconnected from the duty cycle radios on my browser. I mean changing them changes the sound, but it's as if the one I selected is not the one playing.
Confirmed. Author, please fix! For example, in the first set of radio buttons:
1. Leave it at the 50% default
2. Press play
3. Change it to the 12.5% option -- we continue to hear the same sound
4. Change it back to 50% -- finally we hear a different sound
This is broken. Another example:
1. Listen to 12.5% after having come directly from 25%
2. Listen to 12.5% after having come directly from 50%
The 12.5% should sound identical in either case, but it erroneously does not.
This is correct, the demo not properly handling the selection of a new duty cycle. I pushed up a correction just now. Thanks for laying out a detailed replication - made for an easy fix
I am little confused by the article because it sounds like they are describing "pulse width" which is a common parameter on analog and digital synthesizers to change the character of the square wave. A square wave with a low pulse width will sound thinner than one with a high pulse width, and layering square waves with different pulse widths gives you a pleasant phasing effect.
Based on some cursory research, however, it seems that duty cycle is different than pulse width, so now I am unsure if they are trying to use duty cycle variation to implement pulse width modulation (PWM) or if they are doing something else entirely.
More precisely "pulse width" would be a time, while "duty cycle" would be a percent.
And while when going from 0% to 50% duty cycle it could be said that "a square wave with a low pulse width will sound thinner than one with a high pulse width", however, once you go past 50% duty cycle the situation reverses. So a 25% duty cycle would sound almost identical to a 75% duty cycle...the amplitudes of their Fourier transform components would be identical.
> almost identical ... components would be identical
I'm having a tough time reconciling how the former could be almost identical while the latter is identical. I guess the former involves a human listening through a speaker which has asymmetric imperfections (maybe the speaker moves outward more easily than it moves inward, or a DC offset in the signal leads to compression in the high-excursion side that doesn't exist on the low-excursion side, etc.) whereas the FFT readout doesn't necessarily have a speaker in the system at all.
25% and 75% would sound identical alone, but in a mix there often are interplays where it can create a difference. An easy way to hear it is to run two synced oscillators, say a square and a saw, with sharp attack. The resulting sound should be sufficiently different, one side would dampen the attack compared to the other. Furthermore, I think in hardware synths and those that emulate them changing pulse width can cause the module to implicitly shift the signal up or down to ensure consistent average voltage, further complicating things. I am curious what you mean by compression.
Good point. If I have 2 oscillators, and no control over their phase as they mix, then an option to choose 25% vs 75% for one of them would at least offer some variation instead of none.
As for compression, this [0] is a good intro. Most commonly it is applied to a signal deliberately to achieve a desired outcome, but I'm referring to a (generally) undesired speaker nonlinearity [1] near its maximum power handling capacity.
Different linearity properties on the positive and negative side would be pretty bad for a speaker, but possible. In the case of a square wave, non-linearity would be identical to a fixed amplitude change though, possibly with a DC bias.
Based on the gameboy wiki I looked up, the phase of the 25% duty and 75% duty are such that they are inverse of each other, seemingly eliminating the possibility of combining the two for different waveforms.
If you mix a square wave of one duty cycle with another of a different duty cycle, they partially cancel each other out and you get a new sound.
I'm not sure, but I believe the original NES Castlevania does this in some places, like in the "you died" jingle. (It's possible I'm misremembering and it's simply two square notes separated by an octave.)
Adding more channels does nothing to the overtone information. From what I can find[1], it seems that the phase of the 25% and 75% waves are such that the two waves are actually inverse of each other. I don't know much about Gameboy hardware though. Do you actually know what the point of this is?
Sure, but having a channel with 25% duty cycle of frequency f and a channel with 75% duty cycle of frequency 3f will lead to a different waveform after mixing compared to 75% at f and 25% at 3f, no?
Depending on how that's processed downstream it could sound very different I imagine.
In crude ASCII art (two inputs mixed to an output):
This should hopefully be fixed now, there was an issue with handling the radio button selection change.
I haven't been able to find anything about why exactly they chose to provide both 25% and 75% DCs - they do sound the same minus the inverted polarity like you mentioned.
Anyway, what could have been the purpose for the gameboy hardware to provide both 25% and 75% duty cycle? In audio, these sound identical to a human, no? They are the same waveform with inverted polarity. They have the same overtone content.