It’s fascinating to consider the way humans perceive sound, experiencing some sounds as musical and some as noise. Understanding frequency components and harmonics gives us some insight into why music is pleasing to our senses.

Consider the waveforms in Figure 3.4 and Figure 3.5. The first shows the notes C, E, and G played simultaneously. The second is a recording of scratching sounds. The first waveform has a regular pattern because the frequency components are pure sine waves with a harmonic relationship. The second sound has no pattern; the relationship of the frequency components is random at any moment in time and varies randomly over time. Sounds that are combinations of harmonic frequencies make patterns that are pleasing to hear. They’re musical. Random patterns produce noise.

Figure 3.4 Waveform of musical sound

Figure 3.4 Waveform of musical sound

Figure 3.5 Waveform of noise

Figure 3.5 Waveform of noise

Musical instruments like violins, pianos, clarinets, and flutes naturally emit sounds with interesting harmonic components. Each instrument has an identifiable timbre – sometimes called its tone color – that results from its shape, the material of which it is made, its resonant structure, and the way it is played. These physical properties result in the instrument having a characteristic range of frequencies and harmonics. (See Figure 3.6.)

Figure 3.6 Approximate frequencies of various instruments

Figure 3.6 Approximate frequencies of various instruments

Instruments also are distinguished by the amplitude envelope for individual sounds created by the instrument. The amplitude envelope gives a sense of how the loudness of a single note changes over the short period of time when it is played. When you play a certain instrument, do you burst into the note or slide into it gently? Does the note linger or end abruptly? Imagine a single note played by a flute compared to the same note played by a piano. Although you don’t always play a piano note the same way – for example, you can strike the key gently or briskly – it’s still possible to get a picture of a typical amplitude envelope for each instrument and see how they differ. The amplitude envelope consists of four components: attack, decay, sustain, and release, abbreviated ADSR, as illustrated in Figure 3.7. The attack is the time between when the sound is first audible and when it reaches its maximum loudness. The decay is the period of time when the amplitude decreases. Then the amplitude can level to a plateau in the sustain period. The release is when the sound dies away. The attack of a trumpet is relatively sudden, rising steeply to its maximum, because you have to blow pretty hard into a trumpet before the sound starts to come out. With a violin, on the other hand, you can stroke the bow across a string gently, creating a longer, less steep attack. The sustain of the violin note might be longer than that of the trumpet, also, as the bow continues to stroke across the string. Of course, these envelopes vary in individual performances depending on the nature of the music being played. Being aware of the amplitude envelope that is natural to an instrument helps in the synthesis of music. Tools exist for manipulating the envelopes of MIDI samples so that they sound more realistic or convey the spirit of the music better, as we’ll see in Chapter 6.

Figure 3.7   Amplitude envelope

Figure 3.7 Amplitude envelope

The combination of harmonic instruments in an orchestra gives rise to an amazingly complex and aesthetically pleasing pattern of frequencies that taken together are perceived as beautiful music. Non-harmonic instruments – e.g., percussion instruments – can contribute to this beauty as well. Drums, gongs, cymbals, and maracas are not musical in the same sense that flutes and violins are. The partials (frequency components) emitted by percussion instruments are not integer multiples of a fundamental, and thus these instruments don’t have a distinct pitch with harmonic overtones. However, percussion instruments contribute accents to music, called transients. Transients are sounds that come in short bursts. Their attacks are quite sharp, their sustains are short, and their releases are steep. These percussive sounds are called “transient” because they come and go quickly. Because of this, we have to be careful not to edit them out with noise gates and other processors that react to sudden changes of amplitude. Even with their non-harmonic nature, transients add flavor to an overall musical performance, and we wouldn’t want to do without them.