How Accurate Is Your MIDI Timing?

For years, I just trusted MIDI.
I'd been sequencing music since 1993, and it never really occurred to me that the timing of the information being sent to my instruments could be a problem.
The first time I remember encountering MIDI timing issues was in a studio I had in town.
The guys in the studio next door were having problems with MIDI coming from their G3 Mac.
Until that point, it wasn't something I'd given much thought to.
It was around 2014 that I really started to get into the subject. The amount of hardware in my studio was growing, and I was increasingly using the internal sequencers of drum machines and synthesisers, synchronised to my DAW.
It was when I started recording the audio from these machines back into the DAW that I realised how much of a problem there was.
Looking at the waveforms, the timing wasn't what I expected it to be. More importantly, the relationship between the sounds wasn't always consistent.
This was my first real encounter with timing problems that couldn't be solved simply by shifting a recording earlier or later.
Latency, jitter and drift
There are a few different things going on when we talk about MIDI timing, and I think it's important to separate them.
Latency is a delay.
If every note from a drum machine arrives 5 ms late, we can compensate for that. The relationship between the notes remains the same. The whole pattern has simply moved in time.
Jitter is a variation in timing.
One note might arrive 2 ms late, the next 5 ms late, and the next almost exactly where it should be.
We can't simply move the recording backwards by a few milliseconds to correct this, because the amount of delay isn't consistent.
Drift is an accumulating timing difference.
Two machines might start perfectly in time with one another, but gradually move apart over the course of a recording.
These are three very different problems, although they can all contribute to the feeling that something isn't quite right.
It's jitter that I find particularly interesting.
The limitations of MIDI
Traditional five-pin MIDI transmits information serially, at a rate of 31,250 bits per second.
This means that even when we place several notes at exactly the same position in a sequencer, the information for those notes cannot all travel down a single MIDI cable at the same time.
A standard three-byte MIDI Note On message takes approximately 0.96 ms to transmit.
Imagine programming eight drum sounds to play at exactly the same position, all being sent through the same MIDI output.
Without running status, there could be around 7 ms between the transmission of the first and last notes.
Running status can reduce this time, but the messages still have to be transmitted one after another.
All eight notes might occupy exactly the same position on the screen, but the receiving instrument gets them one after another.
This isn't necessarily jitter. If the order and spacing remain consistent, it's a predictable consequence of how MIDI works.
The distinction becomes important when we start looking at the accuracy of a MIDI system.
When we're working entirely within a DAW, the serial limitations of a physical MIDI connection don't apply. Events can be scheduled to precise sample positions within an audio processing block, allowing multiple notes to trigger at the same time.
There are still other factors that can influence when we hear a sound, but the limitations of serial MIDI transmission aren't one of them.
MIDI interfaces and timestamping
Manufacturers have been addressing MIDI timing problems for decades.
Emagic developed Active MIDI Transmission (AMT), a technology used in interfaces such as the AMT8 and Unitor8.


Rather than relying on the computer to deliver each MIDI event at the exact moment it was needed, information could be sent to the interface in advance, in packets, and then released at the appropriate time.
Digidesign employed a similar approach with its MIDI Time Stamping (MTS) technology in the MIDI I/O interface.
By moving some of the responsibility for timing away from the computer and into the interface, these systems reduced the dependence on the computer delivering every event precisely when it was required.
Having multiple independent MIDI outputs also meant that information destined for different instruments could be transmitted simultaneously, rather than everything having to travel down a single MIDI cable.
This doesn't remove the serial nature of traditional MIDI, but it does help address some of the problems surrounding its delivery.
MIDI Clock
The problem I was experiencing in my studio was largely related to MIDI Clock.
MIDI Clock sends 24 pulses for every quarter note. A receiving sequencer uses these pulses to establish the tempo and maintain synchronisation.
At 125 BPM, a quarter note lasts 480 ms. With MIDI Clock sending 24 pulses per quarter note, we'd expect a pulse every 20 ms.
The receiving instrument has to interpret the incoming clock and decide when to play its notes.
How it deals with variations in that clock depends on the way the instrument has been designed.
This was the reason I bought an E-RM Multiclock.

Rather than relying on MIDI Clock coming from the computer, the Multiclock can derive its timing from an audio signal generated within the DAW.
At a sample rate of 48 kHz, E-RM specifies clock jitter of approximately 0.021 ms.
It also allows the timing of each connected sequencer to be adjusted independently, which is particularly useful when working with hardware that has different response times.
What interested me was that I could address two different problems. I could improve the stability of the clock and compensate for the individual timing offsets of my machines.
The Multiclock doesn't correct the timing of MIDI notes being sent from the DAW. Its strength lies in providing a stable clock for the sequencers contained within the hardware itself.
How accurate is your MIDI timing?
Recently, whilst developing the EP Machines, I found myself going back down this particular rabbit hole.
I wanted to understand how accurately the machines were delivering MIDI, both independently and when synchronised to one another or to a DAW.
But to do that, I needed a way of measuring it.
So I developed a MIDI Timing Analyser.
The idea was quite simple.
If I sent a continuous stream of sixteenth notes at a fixed tempo, I could measure the time between each of those notes and compare it with what I would expect.
At 125 BPM, a straight sixteenth note occurs every 120 ms.
If the notes are being delivered accurately, those intervals should remain consistent.
But the average interval only tells us part of the story.
Imagine the following two sequences of intervals:
Event | Sequence A | Sequence B |
1 | 120 ms | 115 ms |
2 | 120 ms | 125 ms |
3 | 120 ms | 113 ms |
4 | 120 ms | 127 ms |
Average | 120 ms | 120 ms |
Both sequences have exactly the same average tempo, but they don't have the same timing.
One is consistent.
The other is constantly changing.
This is why simply looking at the BPM of an incoming MIDI signal doesn't necessarily tell us how stable it is.
When we use that MIDI signal to trigger an external instrument and record the audio back into the DAW, those timing discrepancies become part of the recording.
We might have programmed everything perfectly on the grid, but the audio we record doesn't reflect that.
And because the discrepancies are constantly changing, we can't simply move the entire recording backwards or forwards to correct them.
This is the difference between latency and jitter, and it's what makes jitter particularly frustrating when working with external hardware.
Putting it to the test
I started by measuring the MIDI output of Ableton Live through the Mac's virtual MIDI interface, using it as a reference.
I then measured the output of Rhythm Machine Pro, before making changes to the way it scheduled and delivered its MIDI events.
The results were particularly interesting because they demonstrated how much of an improvement could be made through the way the software handled timing.
Rather than relying on a software timer to send a note at the moment it was needed, the machine could schedule MIDI events in advance using timestamps.
It's a principle not unlike the one employed by those earlier MIDI interfaces.
After refining the timing engine, I was seeing interval errors of less than 0.1 ms RMS in my virtual MIDI tests. RMS gives us a measure of how far the measured intervals typically deviate from the expected interval.
These small timing variations are normal, and the fact that we can measure them doesn't necessarily mean they're a problem when making music.
I then started introducing other elements into the system.
Physical MIDI connections, multiple simultaneous notes, external synchronisation, swing, background playback and eventually multiple sequencers running together.
What became apparent was that measuring the timing of a sequencer was only one part of understanding the timing of the studio.
What happens when the MIDI reaches the instrument?
Accurately delivering a MIDI note doesn't necessarily mean the sound will be produced at that exact moment.
The receiving instrument has to process the information before it can generate a sound.
I recorded a series of repeated notes from several hardware instruments in my studio, including the Roland TR-505, TR-626, Akai S3000 and Behringer Pro-1.
Rather than measuring the MIDI information, I was now measuring the intervals between the transients of the recorded audio.
This introduces another part of the equation.
The MIDI interface might be delivering information consistently, but the instrument itself could introduce variations in the time it takes to respond.
To make the measurements as accurate as possible, I deliberately used short, sharp sounds for these tests. Closed hi-hats on the drum machines and a short plucked sound on the synth.
These sounds have clearly defined transients, making it much easier to identify their starting positions in the recorded audio. A sound with a gradual attack would make this considerably more difficult.
Something I found particularly interesting was comparing the Pro-1 connected directly via USB with the same instrument receiving information through a traditional five-pin MIDI connection.
In my single-note tests, both connections produced very consistent results.
I wondered whether USB MIDI was inherently better or worse than traditional five-pin MIDI, but these particular tests didn't answer that question.
What they did highlight, however, was just how many stages there are between the sequencer and the sound coming out of the instrument, each with the potential to influence timing.
Is perfect timing what we want?
This is where I think the subject becomes particularly interesting from a musical point of view.
I spend a considerable amount of time deliberately moving sounds away from the grid.
A hi-hat might sit slightly ahead of the beat.
A clap might be positioned differently.
The relationship between the kick and bass might feel better when one is moved a few milliseconds.
These small differences are often what make a groove work.
But there is a difference between deliberately positioning a sound and having its position change unpredictably.
If I move a hi-hat 5 ms ahead of the beat, it's because I like the way it feels in relation to the other sounds.
I want that relationship to remain there.
That doesn't mean every variation in timing is undesirable.
Human performance is full of variation, and much of the music I love contains timing that is anything but mathematically perfect.
The point is that I want to have control over it.
Accurate timing isn't about making music rigid. It's about being able to decide where things sit.
Test your own MIDI timing
I've made the MIDI Timing Analyser available below so you can explore some of these things within your own setup.
The analyser includes four dedicated tests:
MIDI Note Timing
MIDI Clock
Swing Accuracy
Simultaneous Notes
Each test guides you through the setup, measures the incoming MIDI and helps you understand the results and what they might mean for your studio.
Downloadable MIDI test patterns are also provided where appropriate, so you don't need to program your own. You can also export the measurements as a CSV file for further analysis.
I'd suggest starting with something simple.
Select the MIDI Note Timing test.
Set your sequencer and the analyser to 125 BPM.
Download the straight sixteenth-note test pattern and loop it in your DAW.
Disable any additional swing, humanisation or timing offsets.
Route the MIDI into the analyser.
Allow it to run for a minute or two.
Once you've established a reference, start changing things.
Try a different MIDI interface. Introduce more notes. Try synchronising to an external clock. Change your audio buffer size. See what happens when your computer is doing other things.
A physical MIDI loopback connection can help you investigate the timing of your interface, while recording the audio output of an instrument allows you to explore another stage of the process entirely.
It's worth remembering that the analyser measures MIDI arriving at its input. It doesn't, on its own, measure the time it takes for a hardware instrument to produce a sound.
Understanding the relationship
I'm not suggesting that we should all start analysing our music to fractions of a millisecond.
If something feels good, there's a lot to be said for leaving it alone.
But if you've ever spent time trying to work out why the relationship between two sounds doesn't feel consistent, or why a piece of hardware doesn't seem to sit quite right alongside the rest of your production, it might be worth investigating.
For a long time, I just trusted MIDI.
I still do, but I have a much better understanding of what's going on between the note on the screen and the sound coming out of the instrument.
And that's given me more control over the thing I was interested in all along.
The groove.




Comments