Essay
←Back to blogPulse Loop: I Built a Whole App to Loop the Same 8 Bars for 3 Hours Straight
Spotify has existed for twenty years and still cannot loop a specific segment of a song. So I built Pulse Loop. Millisecond-accurate A-B looping. For musicians. For obsessives. For me.
Pulse Loop: I Built a Whole App to Loop the Same 8 Bars for 3 Hours Straight
Spotify: twenty years of existence, billions in revenue, zero A-B loop implementations. I handled it.
Let me tell you what Spotify gives you.
Play. Pause. Skip. Shuffle (broken in a new way every year). Repeat song — meaning the entire track, including the 90-second spoken intro you hate. A seek bar that is functionally useless at precise scrubbing speeds. That's it. That is the complete feature set for a company worth $50 billion.
No loop region. No segment markers. No "skip this intro automatically every single time forever" feature.
It's while (position >= end) { seek(start); }. A junior dev could ship this on a Tuesday. They haven't shipped it in twenty years.
So: Pulse Loop.
What It Actually Does
Two modes. Online and offline.
Online mode connects to your Spotify account via OAuth 2.0. You browse your top tracks, recently played, or search. You set a millisecond-accurate start point and end point. You toggle loop on. The app monitors playback position and seeks back to start the moment it hits your end marker. Sub-120ms seek latency via spotify_sdk. The loop is seamless.
Three playback modes:
- Normal — loops the full track
- Loop — repeats your selected start-to-end segment continuously
- Skip — skips your selected segment and keeps playing the rest
That last one is the feature I didn't know I needed. Set it on every song with a terrible bridge. Gone forever.
Offline mode doesn't need Spotify at all. Upload local audio files — MP3, WAV, M4A, OGG, FLAC, AAC — and get the same loop controls powered by just_audio. Files persist to app cache on Android and IndexedDB on web, so they survive restarts. Automatic metadata extraction from Artist - Title filename format. Full offline, full loop, no account required.
The Tech, Because It Matters
Flutter + Riverpod with code generation. Riverpod's @riverpod annotations generate the boilerplate you'd otherwise write by hand. It's the state management solution that actually scales beyond three providers without turning into a BuildContext archaeology dig.
spotify_sdk for Spotify playback control and flutter_web_auth_2 for the OAuth 2.0 flow. The auth flow is the part that will make you briefly consider quitting software development. Then it works and you forget.
just_audio for offline playback. Rock solid, cross-platform, handles every audio format I threw at it. The seek precision on local files is significantly better than Spotify's remote playback latency, which is either satisfying or depressing depending on how you look at it.
Material 3 Expressive theming with dynamic colors. The UI pulls palette colors from album art. Your loop controller matches your album. It's completely unnecessary and I spent more time on it than I should have.
The Part Where I Justify This Whole Thing
I play guitar. Learning from recordings means looping the same passage repeatedly. Standard workflow: play the section, miss the end, seek back manually, miss the start, give up, play the whole song again.
With Pulse Loop: set start marker, set end marker, play. The 8-bar passage repeats until your fingers get it right. No seeking. No distraction. The loop is just there, waiting, patient, accurate to the millisecond.
This is the entire reason the project exists. Everything else — the Skip mode, the offline support, the dynamic theming — is scope creep that turned out to be genuinely useful.
Is This Worth It Over Just Scrubbing Manually?
The seek bar on a phone screen, at the precision needed for a 4-second riff inside a 4-minute track, is basically a game of chance. You will miss. Repeatedly.
Pulse Loop sets the markers once. They stay. Every time that track plays, the loop is already there.
Spotify won't build this. They've had twenty years and chose not to. That feature gap is the entire reason this exists, and honestly, I'm fine with that.
Open source. Free. Works right now.
Go loop the good part. The 8 bars that actually hit. Because Spotify certainly isn't going to help you find them.