The MIDI key pressure message, also known as a "MIDI aftertouch message", tells a MIDI device that at a certain time pressure should be applied to a note similar to applying pressure to electronic keyboard keys.
Most electronic keyboards are designed so that when pressure is applied a small change in pitch occurs similar to the tremolo system on electric guitars.
This message belongs to the category of MIDI voice messages.
The MIDI key pressure message consists of three bytes of data. The first byte is the status byte and has hexadecimal values between 0xA0 and 0xAF. The high nibble of the status byte is A, which tells the MIDI device that this is a “key pressure” message. The low nibble of the status byte is between 0 and F (0 and 15 in decimal values) and points to one of the 16 MIDI channels. Two bytes follow the status byte. The first byte after the status byte is has values between 0x00 and 0x7F (0 and 127 in decimal values) and shows to which note pressure should be applied. A value of 0x3C (60 decimal) signifies the note middle C. Higher values point to higher notes. The second byte after the status byte is the amount of pressure, with 0 being least pressure and 127 being most pressure. How much of a change 127 is depends on the MIDI device.
Since a MIDI key pressure message specifies a single amount of pressure, a MIDI device must receive numerous MIDI key pressure messages to actually produce varying note pressure.
What a key pressure message sounds like depends on the device. With the General MIDI 2 standard, the MIDI controller destination message was defined to help standardize device response to the MIDI key pressure message and other controllers.
The following is an example of a MIDI key pressure message.
0xA4 0x3F 0x79
The status byte 0xA4 shows that this is a key pressure message and that the note to which pressure should be applied is on channel 4. The note is 0x3F (63 decimal), which is D# above middle C. The amount of pressure applied should be 0x79 (121 decimal).