A square wave has an intense amount of harmonics, producing a bright sound. But a sine wave has none, and is a dull sound.
Why does the square wave create harmonics and not a sine wave?
Sound Design Stack Exchange is a question and answer site for sound engineers, producers, editors, and enthusiasts. It only takes a minute to sign up.
Sign up to join this communityA square wave has an intense amount of harmonics, producing a bright sound. But a sine wave has none, and is a dull sound.
Why does the square wave create harmonics and not a sine wave?
You're looking at it the wrong way round.
The square sounds like it does because it is made up of a fundamental frequency and a series of harmonics, whereas the sine wave just has the fundamental frequency.
A square wave has harmonics at odd multiples of the fundamental frequency.
Sine waves (strictly speaking sine/cosine quadrature pairs) are the principal components of many signals, the main reason being that they are the Eigenfunctions of linear timeshift-invariant systems which many systems in reality are essentially or to first order approximation.
That means that a sine wave, filtered through such an LTI system, will result in another sine wave of equal frequency but possibly different phase and amplitude.
For that reason, sine wave audio signals suck for directional hearing since all you get to hear, regardless of attenuation or reverb, is another sine wave (though with possibly different amplitude and phase on either ear). You get much better locateability by superimposing sine waves at numerous frequencies with fixed phase relations. Square waves are such a superposition.
You can both represent sine waves as a superposition of square waves and vice versa, but it is only the sine waves that, for each particular frequency, are maintaining the same shape and frequency when passed through LTI systems.
So it makes more sense to represent signals as superpositions of a fundamental sine wave and harmonic multiples than in any other manner.
Now mechanical oscillators like strings and air columns (in flutes) have modes they resonate with, basically Eigenstates of the oscillator that will recur periodically, a certain configuration of mechanical energy. More often than not those modes result in first order approximation in proper harmonics, oscillations with an integral multiple frequency of that of the fundamental oscillation. But for things like thick strings or sounding bars, the first order approximation is not good enough and the modes are noticeably detuned from proper harmonics. This is typically experienced with the thick strings from a piano, an effect known as "disharmonicity" and somewhat accounted for by "stretch tuning".
Firstly, an ideal sine wave has one constituent frequency. One harmonic1.
Secondly, to answer this question, we first need to learn some basics about harmonics in general (Don't worry, I'll just skim the basics for those who are unsure).
A sine wave is the least complex waveform; representative of the most simple oscillation. We can assign to it three values; amplitude, frequency and relative phase (this last one is only relevant when we add more waves).
Any soundwave can be broken down, or deconstructed, via FFT2, into a collection of these simple sine waves at different amplitudes, frequencies and (relative) phases. Conversely, we can synthesize any sound by adding these pure tones together at specific amplitudes, frequencies and phases. Those constituent frequencies would interact to form the resulting waveform's harmonic and inharmonic partials (part-waves of the parent wave).
This GIF demonstrates the adding of sinewaves at specific harmonic frequencies to produce a square wave
The further a wave deviates from an ideal sine wave, the more partials will be present in the analysis (or, the more sine waves would be needed to synthesize the wave - if that makes it easier to understand).
That is the basic explanation of why a square wave has more harmonics than a pure sine wave.
Note that, the quality that gives the same musical note a different sound when played on different instruments is called "Timbre" (Pronounced "Tambuh" or "Tambruh"). The timbre changes as the relative amplitude of the note's overtones3 (overtone partials start at 2nd harmonic) change (and so the wave shape also changes). So two different notes can have the same pitch, the same harmonic content, but can sound and look very different. A square wave, for example, has (ideally) no even harmonic partials4. This is what gives the square wave that well-known "hollow" sound. A square wave has a distinct timbre.
I won't go into any more detail than that, I think it should be enough for you to do some research if you wish to learn more.
Common Misconceptions:
Wikipedia References
1 Partial, Harmonic, Fundamental, Inharmonicity, and Overtone
2 Fourier Analysis
3 Overtone
4 Square Wave - Fourier Analysis
5 Mersenne's Laws (re: stretched harmonics)