Teaching machines the musicianly thing
Play to a click and you are the one doing the following. Lean into the chorus, which is a thing drummers do deliberately and have done forever, and the click does not come with you. It carries on, and now you are simply wrong.
I wanted the other way round. A band that leads with the drummer instead of ahead of them. It became an Android app, built with a drummer I met online, but the interesting part is not the app, it is the problem, and the problem is much harder than I thought when I started. This is the writeup, including the bits I got wrong, of which there are several.
The first idea everyone has, me included, is to take the kick, turn every hit into a pulse, and feed that to a clock input.
A real kick pattern is not a clock. Play anything syncopated and the pulses land off the beat. Play a fill and you fire six pulses inside half a beat. Play a section where the kick sits out for a bar and your clock stops dead. A drummer holding a perfectly steady tempo still produces wildly uneven gaps between hits, because the hits are music and not a metronome.
So a hit cannot be a command. It has to be evidence, and evidence that the tracker is allowed to disagree with. That is one line in the phase update, and it is doing more work than anything else in the file.
A hit landing more than thirty percent of a beat away from where the grid expected it is not telling me the tempo moved. It is telling me the drummer played something. The grid does not move. Hats get thrown out on the same principle, because a hat is ornament and it should not be allowed to steer anything.
This is the part I would get wrong again if I had to rebuild it, and it is the part that separates a follower from a tempo detector.
A good drummer holds time to somewhere around six to ten milliseconds. Those deviations are not noise. They are the pocket. If the clock chases them, it eats the groove, the deliberate lay-back turns into tempo wobble, and the band starts breathing in and out like it is nervous. But if the clock ignores everything, it misses a real push and you have built a click with extra steps.
What ended up in the code is a deadband, and the number in it is chosen to sit just above a good drummer.
Twelve milliseconds. Inside that, the band does not move at all. Small deviation is feel. Sustained drift is tempo. Lean on it for a bar and the band comes with you. It will not flinch at one laid-back snare, because one laid-back snare is the whole point of a snare.
The confidence window has a similar story, and the comment still carries the scar of a real fix.
An asymmetry that took me a long time to see. Dividing a clock is free. Every incoming pulse advances a counter, tempo never has to exist as a number, and it works at any speed. It is why a clock divider fed from a drum trigger feels bulletproof.
Multiplying is a different animal. To place the second sixteenth between two hits, you need an opinion about when the next hit is going to land. Anything that ratchets or arpeggiates or runs a synced delay is quietly carrying a tempo model whether it admits it or not, and the cheap ones assume a floor and fall apart underneath it. There is no way to duck the real question, which is where the grid is, given the hits so far.
The band plays for a split second then just stops. That sentence is still sitting in the test file, because it is what the bug was actually called.
It worked in testing and fell apart with a real drummer. The tracker locked, the band came in, and then the moment the drummer did anything interesting the confidence dipped, the lock flickered, and the band vanished. Play, band starts, band stops, repeat. Demoralising is the word.
The fix is coasting. When confidence wobbles but hits are still arriving, keep running on the last good estimate and wait. Only stop on actual silence, which in the code is four seconds of nothing. It is what a bass player does when the drummer gets weird for two bars. You do not stop playing. You hold your groove and you listen harder. If you are building any version of this, I do not think coasting is optional, because a follower that gives up during the interesting parts is worse than no follower at all.
It flips to 3/4 while I am playing straight 4/4. This one is my favourite, because the cause is so much better than the symptom.
I was working out the bar length by folding the accent pattern at each candidate length and taking whichever fold came out most peaked, on the theory that a bar has one strong beat and the rest are weaker. Which is true, except for the single most common thing a drummer plays. A backbeat, kick on 1 and 3, snare on 2 and 4, has two equal accent peaks per bar, not one. So the peakedness metric looked at the most ordinary groove in popular music and called it ambiguous, and 3/4 kept stealing short windows.
The fix was to stop asking which fold looks peaked and start asking which length the pattern actually repeats at. A backbeat is a period-2 pattern. It correlates beautifully at lag 4 and it is anti-correlated at lag 3, so once you measure that properly, 4/4 wins outright and there is no contest to lose.
Both bugs have the same shape, now I look at them next to each other. In both cases the code was measuring something reasonable that happened to be the wrong question.
One structural thing that matters more than it looks. The band schedules ahead. Notes are placed against the clock's forecast of the next few beats rather than fired in response to each hit, so the audio latency budget stays out of the drummer's timing loop completely. The band is not reacting late to you. It is meeting you where you were both already headed. Nobody in a real rhythm section waits to hear beat one before playing beat one.
James Holden's human timing work, and the Hennig research underneath it, shows that human timing deviations are not random jitter. They are correlated, they drift with memory, and that is exactly why quantised backing feels dead and why a follower's clock has to bend rather than snap. Holden's patches go further than mine. His machines and his humans pull on each other, proper mutual entrainment. Mine is deliberately one way, because the drummer leads and the band never pushes back, but his direction is the more interesting one and I know it.
And the humbling bit. A human tapping along is still the best tempo tracker anyone has built. Brains predict rather than react. You hear a fill coming and you are already leaning towards where the one is going to land. Nothing I have written gets near that. The only reason to do it in software is that a drummer cannot be their own tapper, because both hands are busy, and not every practice room has a second human in it.
The tracker has always been able to find 5/4 and 7/8. The band could not play them. Every style only had figures written for three and four beats, so a 7/8 bar got four beats of music and then three beats of nothing, and I did not find out until a stranger on a forum asked me about odd time and I went and looked. That is fixed now. Odd bars are built the way they are counted, in groups of two and three.
Heavy polyrhythm will still confuse it. And the acoustic mode, where it listens through the phone microphone instead of a MIDI kit, has never been run against a real kit in a real room, only against drums I synthesised in a test. I would rather say that plainly than find out from a review.
These ideas are in Bashery, an Android app where you plug an e-kit in over USB MIDI and a generated band follows your tempo, dynamics and feel. It is a free beta at bashery.app. There is no model in it and nothing is inferring anything. It is histograms, filters and a phase-locked loop. The only intelligence in the room is the drummer.
Most of what is written here applies to any version of the problem though, a Eurorack module, a Max patch, a plugin. If you build one I would love to compare notes, because the forum threads sharpened half of these ideas and were the best part of the work.
Thanks to the modular and synth forum folks who stress-tested these ideas and pointed me at Holden, Hennig, and the James Blake / Yarns rig. You know who you are.
© 2026 Sashyo & Petty Vendetta. All rights reserved. · bashery.app · more posts