The MIDI standard does not specify how MIDI timing is done. That is left to the computer clock chip and the software programmer. There are three time systems used in MIDI software: Chronological time, Difference time, PPQ time. All three of them are implemented in MIDIDisplay.
When using Chronological time the software is constantly checking the time. The software just sits and waits until the clock time is greater than or equal to the MIDI time stamp. When it is, the message is sent. There are at least two drawbacks to this method: the constant checking of the clock takes time away from other tasks, and any tempo changes during playback require recalculation of all time stamps not yet played.
Difference time calculates the time difference between the note just sent and the next note. It is more efficient than chronological time because the difference indicates how long to wait before sending the next message. The software can create a timer (just like an alarm clock) that can be set to go off when the difference time has expired. Once the timer is set, it runs in the background leaving the computer free to do other tasks. When the timer goes off, the message is sent. Tempo changes can be handled easily because the difference time can be multiplied by the ratio of the original tempo (60 for your projects) and the current tempo setting.
In music notation all rhythm values are proportions of a quarter note. In PPQ time all note values are proportional to the PPQ value of a quarter note. A standard PPQ value is 480. PPQ time is similar to difference time in that timers can be programmed to go off when the PPQ duration has expired. PPQ time is easily converted to difference time by multiplying the PPQ value by the millisecond duration of one PPQ at the current tempo. The number of PPQs in one quarter note is chosen to provide an integer value for subdivisions of the quarter note down to the 128th note, including dotted values. Many software programs give you a choice of PPQ settings. These numbers have been used as PPQ values in various software programs. Rhythmic nuances can be expressed more precisely with larger PPQ values.
|Multiples of 96||96||192||384||768|
|Multiples of 120||120||240||480||960||3840|
|Multiples of 128||128||256||512||1024|
You'll use a PPQ of 480 in this class.
|Note Value||PPQ = 480|
|Dotted 128th||22 or 23|
The duration of a quarter note can only be determined if we know the tempo. Tempo is measured as beats per minute. Usually the quarter note represents one beat. The general formula for the duration of one quarter note, at any tempo, for any duration unit (seconds, milliseconds, or PPQ) is:
|Duration Unit||Tempo||Formula||Duration of One Quarter Note|
|Milliseconds||60||1000 * 60/60||1000 milliseconds|
|120||1000 * 60/120||500 milliseconds|
|Seconds||60||1 * 60/60||1 second|
|90||1 * 60/90||0.67 seconds|
|PPQ (480)||60||480 * 60/60||480 PPQ|
|100||480 * 60/100||288 PPQ|
[Overview] [Syllabus]Revised John Ellinger, January - March 2013