← Back to list

How Your Inner Tempo Shapes Your Experience of Music

A few weeks ago, my wife sent me an article that instantly got my attention. It was this one from El Periódico:

Ariel Parra · 2026-01-25 12:51 · 100 claps · 3.4 min read
#music #inner-tempo #garageband #tonejs
Open on Medium ↗
Wiki topics: RAG · RAG & Retrieval CUL · Culture & Media 🎵 · Music & Audio

How Your Inner Tempo Shapes Your Experience of Music

A few weeks ago, my wife sent me an article that instantly got my attention. It was this one from El Periódico:

“La música conecta con tu ritmo interior y reduce el dolor.” https://www.elperiodico.com/es/ciencia/20251102/musica-conecta-ritmo-interior-reduce-123112064

The idea was simple but quite interesting. Music reduces pain not because it’s universally relaxing or soothing, but because it synchronizes with something deeply personal: your own internal rhythm.

That tiny concept sparked something in my brain. I began thinking about how to incorporate it into my explorations page, so here is the story of how Inner Tempo was born. You can try it yourself at darkaico.com/inner-tempo.

The Rhythm Inside Each of Us

The research behind the article explains something called Spontaneous Production Rate (SPR), which is essentially the natural tempo your brain prefers when you tap your fingers, walk, or hum without conscious effort.

Your inner rhythm.

Scientists found that when you listen to music aligned with that internal tempo, your brain uses fewer resources to process it, which reduces stress and even decreases the sensation of pain. And here’s the part that really caught me: there is no universal “good tempo”, no magical BPM that works for everyone; your rhythm is yours.

The Technical Journey

Building Inner Tempo was a mix of what I love in this world: music, science, computers, programming (and a little of user experience). Here’s how it works.

Capturing Your Rhythm

The first challenge: measuring your internal tempo. I implemented a tap tempo detector that records timestamps as you “tap” the beat. It uses Median Absolute Deviation (MAD) to filter outliers. If you miss a beat or tap too early, those outliers are removed before calculating your BPM.

The algorithm requires at least 3 taps to begin calculating, but collects up to 6 for improved accuracy. After each tap, it waits 2 seconds (or 500ms if you’re tapping very fast) to see if you’ll tap again. Once it has enough data, it calculates the average interval between taps and converts it to BPM.

From Tempo to Music

Once we have your BPM, the fun part begins: generating music that matches your rhythm. I built this using Tone.js, a Web Audio API wrapper that lets you create synthesizers, effects, and loops in the browser, and also play your own sounds.

I include the option to choose a genre too; each one has its own preset, with different instruments, effects, and patterns. Jazz uses real piano samples I recorded (using GarageBand with some settings), while Ambient uses FM synthesis with long, reverb-soaked notes. Rock gets distortion and a driving drum pattern (same usage of GarageBand). The system supports both synthesized sounds and real audio samples, falling back to synthesis if samples aren’t loaded yet.

Making It Feel Human

One thing I learned: perfectly timed music sounds robotic. So I added “humanization”, subtle random variations in timing (1–20ms), velocity (how “hard” the notes are played), and filter cutoff. These small imperfections make the music feel more natural, like a real musician playing. Nevertheless, music sounds too plain, so my next iteration is going to be focused on creating better music loops.

Real Music at Your Tempo

Besides the generated loops, I also wanted to suggest real tracks, songs you might already know, that fit your inner rhythm. The catch: it’s surprisingly hard to get “songs by BPM” from music APIs. Spotify used to expose tempo in their API; they removed that some time ago. I tried a few services (Jamendo / Epidemic Sound / etc) and either they didn’t filter by BPM, or the terms and limits made them unsuitable for a small side project.

So I took a different path: a kind of manual curation. I use AI agents to search for tracks by genre and approximate tempo (e.g., “jazz around 90 BPM”, “ambient 65 BPM”), validate Spotify and YouTube links, and then I store the results in our own data. That gives us a curated set of tracks, per genre and BPM bucket, that we control and can serve without depending on a single API that might change or disappear. It’s more work up front, but it’s stable, and it does exactly what we need: real music, filtered by your tempo.

The Tools

  • React + Next.js: For the UI and routing
  • Tone.js: For all audio generation and processing
  • Tailwind CSS: For styling
  • Web Audio API: Underlying browser audio engine

A Final Thought

I love it when science nudges me to build tiny experiments. This one came from a simple link my wife shared, and ended up becoming a piece of generative music exploration I didn’t know I needed.

Sometimes innovation starts with curiosity. Sometimes it starts with a single article. And sometimes… it starts with your own heartbeat.


메타데이터
post_id
51c19d896f4b
slug
how-your-inner-tempo-shapes-your-experience-of-music-51c19d896f4b
url
https://medium.com/@darkaico/how-your-inner-tempo-shapes-your-experience-of-music-51c19d896f4b
canonical_url
https://medium.com/@darkaico/how-your-inner-tempo-shapes-your-experience-of-music-51c19d896f4b
author_url
https://medium.com/@darkaico
status
ok
fetched_at
2026-06-18 00:10:23