Envelope of a Musical Note

Figure 1. ADSR profile for an envelope function E(t).

Musical passages created from pure sinusoids are likely to sound very artificial. Therefore, you might want to try improving the quality of the sound by incorporating some modifications. For example, you could multiply each pure tone signal by an envelope E(t) so that it would fade in and out.

x(t) = E(t) cos(2pf0t + f)

If an envelope is used it should "fade in" quickly and fade out more slowly. An envelope such as a half-cycle of a sine wave sin(pt/dur) is not good because it does not turn on quickly enough, so simultaneous notes of different durations no longer appear to begin at the same time. A standard way to define the envelop function is to divide E(t) into four sections: attack (A), delay (D), sustain (S), and release (R). Together these are called ADSR. The attack is a quickly rising front edge, the delay is a small short-duration drop, the sustain is more or less constant and the release drops quickly back to zero. Figure 1 shows a linear approximation to the ADSR profile.

Some other issues that affect the quality of musical synthesis include relative timing of the notes, correct durations for tempo, rests (pauses) in the appropriate places, relative amplitudes to emphasize certain notes and make others soft, and harmonics. True piano sounds contain several frequency components, such as second and third harmonics. This modification would be simple, but be careful to make the amplitudes of the harmonics smaller than the fundamental frequency component. Experiment to see what sounds best.

Reference

McClellan, Schafer and Yoder, DSP FIRST: A Multimedia Approach. Prentice Hall, Upper Saddle River, New Jersey, 1998. Copyright (c) 1998 Prentice Hall. p 435-437.


Maintained by John Loomis, last updated 4 Sep 2003