MIDI Matters (Part 1)
Song Position Pointers
Sound On Sound's MIDI Doctor Jay Chapman, returns with a new series that concentrates on specific aspects of MIDI and explores their relevance and use in a musical set-up. This month: the Song Position Pointer.
Sound On Sound's MIDI Doctor, Jay Chapman, returns with a new series that concentrates on specific aspects of MIDI and explore their relevance and use in a musical set-up. This month: the SONG POSITION POINTER.
Hidden away in the depths of the MIDI 1.0 Specification, in the section on System Common Messages, lies a very useful MIDI facility which you can use to uniquely identify where you are - or where you would like to be - in a piece of music. It is a three byte message consisting of a status byte value (in hexadecimal) of F2 followed by two data bytes which together form the MIDI Song Position Pointer (abbreviated to SPP for the rest of this article).
Before we go any further, let's define more exactly what the SPP is! The SPP is defined in terms of MIDI beats which are in turn defined in terms of MIDI clocks. MIDI expects 24 clocks per quarter-note (crotchet) to be pumped around the network from the master sequencer, computer or whatever (both a Yamaha KX88 master keyboard and the Hinton Instruments MIDIC interface can themselves generate MIDI clocks, for example). So, if your song blasts along at 120bpm (crotchet beats per minute) you would expect to see 48 MIDI clocks, each consisting of one F8 byte, streaming out every second to the furthest corners of your musical empire.
A MIDI beat consists of 6 MIDI clocks and is equivalent to a sixteenth-note (semiquaver) since 24 clocks comprise a quarter-note (crotchet). Of course, this means that you get 16 divisions to every 4/4 bar of music which may well remind you of the number of time divisions per 4/4 bar that your trusty drum machine can handle - isn't it nice to find such harmony in the Universe! Ideally, each connected device on your MIDI network that understands the concept of 'time' should also understand how to make use of SPP messages. Imagine the following situation to discover why it should!
You have painstakingly programmed your drum machine bar by bar, phrase by phrase, repeat section by repeat section, middle 8 by... well one middle 8 anyway! You have included fills, flams, touch-sensitive mama papas, paradiddles and syncopated triplets until you're blue in the face and now the time has come to overdub some very tricky keyboards onto an 8-bar section towards the end of the piece - some three minutes from the start in fact. You set up the master sequencer to loop round the specified 8 bars recording your overdub attempts which you play whilst listening to the other instruments that are under MIDI control of the sequencer. The sequencer is also persuaded to regularly send out MIDI clocks so that the drum machine stays synchronised.
You press the Start button on the sequencer and after a 2-bar count-in the other instruments commence playing from the start of the relevant 8-bar section - the drum machine, meanwhile, starts off from the very beginning of the song instead! The reason for this being that many drum machines only have the capability of either playing from the very start (after receiving a MIDI, or front panel button, Start command), or from the start of the beat, or sometimes from the bar following the point at which they were stopped (ie. when they receive a Continue command after a Stop command). The only way to have the correct part of the drum sequence looping for our overdubs is by telling the drum machine exactly where to start from each time round; in other words the drum machine needs to keep a pointer into its sequences to tell it which position in the song to start at.
As you might expect, this Song Position Pointer (SPP) message is transmitted around a MIDI network to tell all devices that maintain a pointer (in a data structure that might be referred to as an internal SPP register) where the master sequencer would like them to play from. In this way devices are not merely synchronised by the MIDI clocks but are always guaranteed to play the same section of a song as well.
The format of the SPP message in detail (in binary) is:
|status byte||data bytes|
where the first byte is the F2 status byte and each of the following two data bytes is effectively a 7-bit quantity since the first bit of all MIDI data bytes must be a 0. We thus have 14 bits available for the SPP, giving a range of possible values from 0 to 16,383 (= 127 x 128 + 127); the value in a given message wdata byte by 128 (decimal) and then adding in the first (least significant) data byte eg. Ommmmmmm x 128 + 01111111.
Since the SPP registers and messages count MIDI beats, and there are 6 such beats to a quarter-note or 24 beats to a 4/4 bar, we can identify uniquely any song position within nearly 700 bars of music to an accuracy of 1/16th of a bar. If you want to do a drop-in starting from three beats into the fifth bar of the second repeat of the dawn chorus, you can do it without having to play right the way through from the start...
Since the size of the SPP is finite, there is a limit on how long a song can be if you need to make use of MIDI Song Position Pointers. To give a worst case example, consider a 4/4 song playing at a tempo of 240bpm. Since each bar is 4 crotchet beats long and we can have about 700 of them in a song, then the maximum length in minutes that the song could last is:
(700 (bars) x 4 (crotchet beats per bar)) / 240 (crotchet beats per minute)
= just over 11½ minutes
which is long enough for your average pop song but doesn't quite handle Wagner's Ring Cycle!
To round off this page on the MIDI Song Position Pointer (SPP) it is worth pointing out that the big brother of the SPP will be the current proposal for an enhancement to MIDI, based on SMPTE timecode, called the MIDI Time Code (MTC, for short) which lets you pinpoint a position within a song to an accuracy of something like 1/30th of a second within 24 hours! That's not all it will do for you, of course, but you'll have to wait for a future article to find out more!
Feature by Jay Chapman
mu:zines is the result of thousands of hours of effort, and will require many thousands more going forward to reach our goals of getting all this content online.
If you value this resource, you can support this project - it really helps!