Volume
When you’re working with MIDI music information, there are two ways to control the volume of playback. The most common way is to control the key velocity of each note—that is, how hard it is “struck” when it’s played by the computer. Usually (but not always), MIDI keyboards respond to key velocity information the same way a piano does: the harder the note is struck, the louder it sounds. See Key velocity for more information.
Key velocity has one limitation, however: it can’t control the volume of a note after it’s been struck. For piano music, this is no problem. But imagine a long note played by a trumpet—the player can swell and diminuendo within the same note. To create this kind of effect, you can use a second volume-control method: MIDI volume controller information. MIDI volume is controller number 7; see Continuous data for instructions on creating and editing this and other controller data.
To control the overall volume of playback, see Mixer.