Contact

Currently building Ohm, a music app for iOS that reads the moment you're in, because listening to music should be [like] telepathy.

Nº 10 A Small Private Publication 3 min read

Filed Ohm analyses thirty seconds of every song

Filed 4 November 2026 sofua.co.uk

Every song Ohm plays is matched to the next one based on thirty seconds of it, and those thirty seconds aren’t always representative. Ohm doesn’t analyse the full songs you play, but Apple’s thirty-second preview of them. So whether the next song fits depends on what those thirty seconds do and don’t capture, and I’ve had to learn exactly where that goes wrong.

Why it’s thirty seconds

When I tested it in June on an iOS beta, the full track wasn’t available. For a song streamed from my Apple Music library, the phone’s file reference came back empty, so there was no audio to hand to Apple’s analysis framework. The framework wouldn’t read a preview straight from Apple’s web address either. It only worked once the file was downloaded. And it runs only on Apple hardware, not on Ohm’s Linux server. This is by Apple’s design via FairPlay, their DRM technology. So I set up a Mac to download each preview, analyse it and delete it.

The previews are reliably thirty seconds long. Across 13,767 of them, the median was 30.000 seconds, and 99.4% were within a tenth of a second of that. Nearly all the shorter ones were whole tracks under thirty seconds.

Which thirty seconds

The thirty seconds you get aren’t fixed by the song. Apple attaches a preview to each release: the album, the single, every compilation. The same recording can have a different preview on each. That means two listeners with the same song in their libraries, one from the single and one from the album, can have it analysed from different thirty seconds.

Frank Ocean’s Biking shows the limit. In its preview, Apple’s framework detects vocals and other instruments, in D major at 74 BPM, but no drums and no bass. Anyone who knows the song knows both come in later. So the song I’m matching on is sparser than the one listeners actually hear.

Fig. 1
Biking by Frank Ocean
30-sec preview reading Full song reading
Preview · 0:45–1:15 Vocals Vocals 0:00–0:00 Vocals 0:02–0:06 Vocals 0:07–0:13 Vocals 0:14–0:18 Vocals 0:19–0:34 Vocals 0:35–0:41 Vocals 0:42–0:44 Vocals 0:45–0:47 (in the preview) Vocals 0:48–0:53 (in the preview) Vocals 0:54–0:56 (in the preview) Vocals 0:57–1:00 (in the preview) Vocals 1:01–1:03 (in the preview) Vocals 1:03–1:11 (in the preview) Vocals 1:12–1:14 (in the preview) Vocals 1:14–1:43 Vocals 1:43–2:06 Vocals 2:09–2:28 Vocals 2:29–3:34 Vocals 3:34–3:35 Vocals 3:36–3:40 Vocals 3:40–4:04 Vocals 4:06–4:33 Other instruments Other instruments 0:00–0:44 Other instruments 0:44–1:14 (in the preview) Other instruments 1:14–4:32 Drums Drums 1:32–1:37 Drums 1:38–1:38 Drums 1:41–2:09 Drums 2:16–2:16 Drums 2:18–2:18 Drums 2:19–2:19 Drums 2:20–2:21 Drums 2:21–2:48 Drums 2:58–2:59 Drums 3:01–3:09 Drums 3:10–3:10 Drums 3:12–3:24 Drums 3:25–3:25 Drums 3:26–3:37 Drums 4:06–4:31 first at 1:32 Bass Bass 1:43–2:48 Bass 3:01–3:09 Bass 3:10–3:11 Bass 3:12–3:36 Bass 3:37–3:39 Bass 3:40–4:03 Bass 4:06–4:32 first at 1:43
Drums first come in at 1:32 and bass at 1:43, after the preview ends at 1:15. Lanes follow volume, so a quiet part can read as silent. Full song is 4:37.

Readings that don’t hold still

The biggest surprise was that some readings aren’t stable even on the same thirty seconds. I read the same 100 previews four times. The key never changed, and tempo, beat and section loudness stayed within 0.01 on 93 to 98 of them. Overall loudness didn’t hold. 14 of the 100 came back with two different values, and the second was 0.4 to 7.2 dB louder than an independent loudness meter reads.

That matters for the product. A score built on overall loudness could move a song from calm to intense between two reads, with nothing about the song changing. So I can’t trust a single read of overall loudness.

The framework’s sense of which instruments are playing also follows volume. Turn a preview down 10 dB and every instrument reads as less active. Left alone, that would make quietly mastered songs look sparser than they are. So I level every preview to the same loudness before reading the instruments.

How I use it

I measure how close two songs sound by the instrument activity in their levelled previews. Between one song and the next, I avoid big jumps in tempo, pace or how much singing there is, because those are the jumps a listener notices. Both rules work on the preview, not the whole song. This is just one approach to doing more with less.