The sound is generated and processed in four stages; viz. attack, decay, sustain, and release. The attack phase starts from when a key is hit and the sound is created, and lasts till it reaches the peak. Decay is when the sound starts to decrease and this stage lasts, till it reaches a steady level.