GrooveDojo Open GrooveDojo

How GrooveDojo measures drum timing

When GrooveDojo says a hit was 12 ms late, what is it comparing, and how far can you trust the number?

In short. GrooveDojo compares when each hit from your kit reached the browser with when its note was due at your computer’s audio output, using the output delay your browser reports. Your kit, its cable, your computer and your headphones each add a little delay on the way, and GrooveDojo can’t measure or remove all of it. So it’s best at showing how even your playing is, and how it changes from run to run on the same setup.

What early and late mean

Every note in a groove has a time when it’s due. At 100 BPM a beat lasts 600 ms, so the snare on beat 2 is due 600 ms after the bar starts. If your hit reaches GrooveDojo at 612 ms, it’s 12 ms late. At 591 ms, it’s 9 ms early. Results are shown in whole milliseconds.

Three hits on one note, with the Timing mark window at ±30 ms (the shaded band). A hit 40 ms before the note is marked early, one 5 ms after it is marked near, and one 45 ms after it is marked late.

While you play, a hit within your Timing mark window stays gray, and a hit outside it shows early or late. The window is ±30 ms unless you change it in Settings, Practice. It changes only the marks: the results after a run use every hit’s own time. The Independence Trainer also uses it to decide which bars were clean.

How GrooveDojo measures a hit

When you strike a pad, the module sends a MIDI note over USB. The browser stamps it with the moment it arrived, and GrooveDojo uses that timestamp, so a busy page doesn’t make your hits look late.

The click and the kit’s sounds are scheduled ahead of time on the browser’s audio clock. A note is due when its sound is scheduled to leave your computer’s audio output, using the output delay your browser reports. Where a browser can’t report it, GrooveDojo estimates it, and Settings, Timing shows which method is in use.

The MIDI timestamps and the audio run on separate clocks, so GrooveDojo keeps checking how the two line up while sound is playing, and compares each hit with its note on one clock. Firefox stamps MIDI notes on a clock of its own. GrooveDojo moves them onto the page’s clock, keeping the spacing between your hits, which can put a hit a millisecond or two early, and the first hit of a session late.

Each hit is then matched to the nearest written note on the same drum. The window around each note is wide on purpose, so a steady delay from your setup doesn’t turn notes into misses and extra hits. If a note’s drum wasn’t hit, the note is missed, or counted as the wrong drum when a drum played by the same limbs (hands or feet) was hit instead. Hits no note takes are extra.

Marks appear as each hit arrives. When the run ends, the whole run is matched again, and that’s what its results show. For each drum, you see its early, near and late counts, missed notes and extra hits, and three numbers: Middle (the median of its hits), Spread (how widely they scattered) and Steady (how many landed within 10 ms of the drum’s own middle). A drum’s Details show the same numbers as Median, Spread and Consistency.

What can affect the result

Between your stick hitting the pad and the result, a hit passes through several stages. So does the click, on its way to your ears. Each one takes time.

The path of a hit and of the click, and what GrooveDojo does about each delay

Your hit

  1. Pad and moduleThe module detects the strike and sends a note. Not measured.
  2. USB and your computerThe note travels to the browser. Not measured.
  3. BrowserStamps the time the note arrived. Used as the hit’s time.

The click

  1. GrooveDojoSchedules each sound on the audio clock. Used as the note’s due time.
  2. Audio outputSpeakers, wired headphones or your module. Accounted for, as the browser reports it.
  3. BluetoothAdds a delay the browser can’t report. Not accounted for.

Then

  1. MatchingEach hit is compared with its note, both on one clock.
  2. Your resultEarly or late, in whole milliseconds.

A busy computer can add delay, sometimes unevenly. GrooveDojo can’t measure what your speakers or headphones add after the sound leaves your computer, and if the browser reports the output delay wrongly, every hit shifts by the same amount. Bluetooth headphones and speakers add a delay that’s long and keeps changing, and the browser can’t tell them from wired ones. Tell GrooveDojo how you listen in Settings, Timing. It warns you about Bluetooth, and about a long reported output delay, but it doesn’t adjust your results.

GrooveDojo doesn’t measure or subtract the delay of your kit, its cable and your computer, and it has no setting to shift your results. That’s deliberate. A calibration done by playing along can’t tell the setup’s delay from your own habit of playing ahead of or behind the beat, and subtracting it would hide the very thing the app is there to show you.

What the numbers can and can’t tell you

Three questions are easy to mix up:

So one number, such as “12 ms late”, can carry a steady error from your setup. How even your hits are, and how runs on the same setup compare, are more reliable. If your snare’s middle moves from 12 ms late to 4 ms late on the same kit, computer and headphones, the change most likely comes from your playing, though your setup’s own delays can still vary a little.

What I’ve tested

I compared GrooveDojo’s timing readings with a reference recording, using my Roland TD-27KV2, connected by USB to a MacBook Pro running Chrome.

In this small test, the readings closely matched the recording. That’s encouraging, but it’s one setup. Other pads, kits, computers, browsers and headphones haven’t been measured, and results may differ with them (what has been tested).

See measurement details

This shows how closely GrooveDojo’s readings agreed with the recording on this one setup. It isn’t a measurement of MIDI latency on its own, or a timing accuracy for any other setup.

How to get reliable feedback

Read more

Open GrooveDojo