|
The data byte is a number, representing a value in a MIDI event. For example, when a key on a MIDI keyboard is pressed, a ‘Note On’ message is sent, which contains two data bytes, the Note Number and the Velocity. The Note Number indicates the pitch of the key and is a value from 0 to 127, arranged chromatically from ‘C0’ (C-Zero) to ‘G10’. Each note is one semitone. The note is usually indicated with an octave number. For example, Middle-C is note number 60. As there are twelve semitones to an octave, this means that note 60 is C5 (octave=60/12=5).
The Velocity is also a number from 0 to 127 and represents the intensity of the key press. A velocity of 127 is the heaviest and 1 is the lightest. Velocity 0 is a special case, meaning ‘Note Off’.
There is also a separate ‘Note Off’ MIDI event, which can be transmitted. So which one do we use when playing music? Well, either will work, but using Note On with Velocity=0 allows us to ‘compress’ the MIDI transmission, by using a technique called ‘Running Status’. When the music starts playing, a complete three byte note message is sent to inform the MIDI receiver what is to follow. But if all the following events are also notes, it is not necessary to send the status byte again, until another type of MIDI event, or a channel change was required (the channel is sent in the status byte). This is because the status would be the same for every note message and therefore only needs to be sent once. All that is required is that Note On messages are used exclusively , with a velocity of 1 to 127 indicating Note On and a velocity of 0 indicating Note Off.
Q: You said that MIDI was constructed from eight bit bytes. On a MIDI keyboard, there are only five pins on the MIDI Out connector. How are all those bits transmitted?
A: Good question, read on..
When MIDI is stored on a disk, it is saved in ‘Standard MIDI File’ format or SMF, which is essentially a sequence of bytes, as discussed above. There are also additional bytes saved in the file for timing and other special MIDI information, for example, time signature (‘meter’) or lyrics.
When MIDI is transmitted electronically, through a cable, it is also sent as a sequence of bytes, but with a difference. The bytes are sent serially, one bit at a time.
...To Be Continued!
|