Square Wave
Wave
Spectrum
A square wave jumps from -1 to 1, and repeats itself at a given frequency.
Because it contains a sudden jump (a discontinuity), there are lot of high frequency harmonics in the sound spectrum, resulting in a harsh, buzzy tone. One way to mitigate this is to synthesize a band-limited square wave, by adding fewer harmonics to approximate the wave.
Try adding two square waves of different frequencies together. Take a look at the adding sine waves example to see how you can do this.