BASHERY

A Loop of Your Own

Petty wanted his own loops in the app. It took five releases.

By Sashyo · July 2026 · Bashery blog

Petty makes loops. Short ones, in his DAW, the kind you build a track around. And since Bashery's whole thing is that the band follows the drummer, he asked the obvious question. Can I bring my loops in and have them follow me too.

I said sure, that's easy. It was not easy. Here is roughly how it went.

The first version was a record player

To make a loop fit your bar you can just play it faster or slower. So that is what I shipped first. It lines up with your downbeats fine. It also raises the pitch when you speed up, because that is what varispeed does, and drummers speed up. Petty pushed a chorus and his bass line went up a semitone and a bit. He was polite about it. The polite word for that version is repitch and the accurate word is chipmunks.

I knew this would happen, honestly. I shipped it anyway because a bad version you can play with beats a good version that does not exist yet, and because I wanted to know if the feature was even worth the real fix. It was.

The real fix

Changing duration without changing pitch means granular stretching. You play the sample as small overlapping grains, each grain reads at the original speed so pitch stays put, and the spacing between grain starts follows the tracked bar length. The ugly part is the seams. Every grain boundary is a chance to click, so each new grain searches the nearby audio for a start point that best matches what is already playing, and crossfades in. Most of the work in that file is the seams.

My actual worry was the phone. This runs inside the audio callback, where going over budget is not a slow frame, it is a dropout you can hear. So the stretch had to earn its place with a test that renders ten seconds of hard stretching and fails the build if it gets expensive. The numbers came back better than I expected.

BarLoop stretch cost: 117ms to render 10s = 1.17% of realtime
BarLoop idle cost: 1ms per 10s

The second line matters more to me than the first. If you never load a loop you should not pay for the feature at all, and you don't.

Then a pile of small lessons

The loop used to start whenever it was loaded, which is wrong in an app with a count-in. It waits for the band now, and stops with you when you stop. Petty then wanted several loops he could switch between mid-song, so loops cycle now, and a pad of your choice steps to the next one. He picked the tom. Every one of these came from him actually playing, not from me planning. I have given up pretending I can predict this stuff from the desk.

How many bars is a loop

The last one looks trivial. A four second loop at 120 bpm is two bars. The app has to know that, because if it decides one bar it plays your loop at double speed, in perfect time, sounding completely wrong. Petty raised it like this.

Petty: Love the bar loop. Can we make it a 2 bar loop?
me: selectable i guess
Petty: would be cool if it could detect it
Petty: We could create a rule. under 2 sec = 1 bar, 2-4 = 2 bar, 4-8 = 4 bar. Dunno

His duration rule is decent, but the app already tracks your tempo, so it can do better. It tries one, two, four, eight and sixteen bars against your current bar length and keeps whichever needs the least stretch. A slow three second loop is one bar, a fast one is two, and the tempo decides, not a table of seconds.

The embarrassing part is that this detection already existed when Petty asked. The bug was that it only ran once, at load time. Load a loop before you have played anything and it guessed against a default tempo and never reconsidered. So it now re-decides the moment your real tempo locks, and there is a manual override, because sometimes the drummer is right and the arithmetic is not.

Same stretch of weeks, less glamorous. A Bluetooth kit that quietly connected twice and doubled every hit. An oversized sound file that wedged the importer. A budget phone that could not run two heavy synth voices, which now eases the sound down instead of crackling. Field testing is mostly this.

Anyway. The loops follow the drummer now, like everything else in the app. Petty is happy, until his next message.


Bashery is a band that follows your drumming, on Android. By Sashyo & Petty Vendetta. · More posts