BLOG
Dev Blog
Notes from building Metronome.fm: Web Audio timing, BPM detection, the design system, operations, and more.
What I built to make Metronome.fm easy for AI agents to use
You can now connect Metronome.fm to AI apps such as Claude and have the AI read your saved metronome settings, practice stats and schedules. This post walks through each check on isitagentready.com, which scores how easy a site is for AI agents to use, and what I built to raise the score from 20 to 93 out of 100.
ReadEarn coins by practicing and decorate Friko's tank on your profile
Profile pages are here, with a tank where Friko, your practice buddy, swims. Decorate it with M coins, an in-app currency you earn by practicing. This post covers how to get decorations and how to choose themes and Friko's look.
ReadPinning GitHub Actions with a lockfile while keeping version tags
With GitHub's workflow lockfile, uses: can keep a readable tag while only the recorded commit of each action runs. This post covers how we switched uses: back from commit SHAs to tags, and a CI check that catches a lockfile you forgot to update.
ReadYou can now use your own image as the metronome's background
Use a photo or any image you like as the background of the metronome screen. The buttons turn translucent so the image shows through while they and the tempo number stay readable, and you can adjust the overlay and blur with a live view.
ReadYou can now like posts on this dev blog without signing in
A button at the end of each post lets you like it without signing in, and Friko, the mascot, says thanks with a GIF. This post also covers how people who aren't signed in are kept from liking over and over.
ReadWhy Server Actions fail in browser tabs opened before a deploy, and how to prevent it
A browser tab opened before a deploy still holds old Server Action IDs, so calling them on the new deployment fails. We route that tab's requests to the old deployment with Vercel's Skew Protection, and ask users to reload when a call still fails.
ReadI've started writing about rhythm practice on note.com
On note, a Japanese blogging service, the developer of Metronome.fm writes for people who practice an instrument: rhythm mistakes and how to practice with the app's features. Posts are in Japanese, with automatic English translations.
ReadWhen you level up through practice, you can now share that day's record on social media
Each time you level up, a page with that day's practice record is added to your practice timeline. Post the page's URL on X or elsewhere, and your record shows up with a large image. This post covers how to open your timeline, what others can see once you make it public (at first, only you can), and how to add a comment to a page.
ReadMaking Ask AI for BPM faster with Cloudflare's Clairic
I switched the step that pulls the BPM out of search results from gpt-5-mini to Clairic, Cloudflare's extraction model. How Jev filters out inputs that aren't songs, how I stopped song titles being copied from URLs, and accuracy, speed and cost on 49 songs with known BPMs.
ReadConsidering a switch from Jev to Clef, and passing on it
We tested whether Cloudflare's Clef could replace Jev, our judgment-only model, on four of the app's test sets. Settings edit requests and forum posts matched Jev once the threshold was adjusted, but voice commands mistook short requests for talking to oneself, and Jev was both faster and cheaper.
ReadVoice commands now cover time signatures, sounds, and the timer
39 more actions, like the time signature, sounds, and the timer, can now be requested by voice. Adding one more question for Jev, a model that only makes judgments, kept it to a single call each time. How I fixed mix-ups such as a tempo request starting playback or "stop the tuner" stopping the metronome, and results from 203 phrasings.
ReadBuilding Japanese forum search with pg_trgm partial matching
PostgreSQL full-text search can't split Japanese into words, so forum search uses a pg_trgm index with ILIKE partial matching. How the locale decides whether Japanese gets trigrams, a 100,000-post benchmark, and pitfalls with Supabase and Prisma.
ReadRemaking our X header so the profile icon doesn't cover it
We remade the icon, header, and bio of our X account to match our current logo and look. The header uses the same look as our OG image and leaves only the bottom left empty for the icon. How the first version pushed everything to the right and left a big gap, and how we build the header in HTML and export it with Playwright.
ReadCatching spam and trolling in forum posts with Jev before they go up
Text written in the forum is checked by Jev, a judgment-only model, before it is saved, and ads, trolling and off-topic posts are kept out. How we ask about the topic and whether a post is acceptable in a single call, where we draw the line for borderline posts, why a post goes through when the check errors out, and test results.
ReadRendering forum posts safely, even with malicious Markdown
Forum posts render with react-markdown without raw HTML, links to unsafe destinations such as javascript:, or images from other sites. A quote nested thousands of levels deep broke the page, so anything deeper than 24 levels is flattened into a single paragraph.
ReadChecking forum images with Jev before deciding to publish them
Images posted to the forum are checked by Jev, a judgment-only model, and only the ones that pass are published. How we send images to Jev, what we reject and where we draw the line, resizing in the browser to a size Jev accepts, and why an image is held back even when the check errors out, plus test results.
ReadAutomatically hiding forum posts reported by 3 members
In the Metronome.fm forum, a post reported by 3 different established members is now hidden automatically, and the admins get an email. Also: how hidden posts never reach the browser, and 2 weak spots found and fixed in a review before launch.
ReadEmbedding a public setting in other sites and playing it there
Public settings can now be pasted into blogs and other pages with an iframe, like a YouTube video, and played right on that page. How we allowed framing on just one path, what we did about cookies not reaching an iframe on another site, and how we reused the app's playback engine without overwriting the settings the visitor uses in the app.
ReadA YouTube Short of our intro video, with sound effects synthesized by earshot
We made a YouTube Shorts version of our intro video and remade its sound effects with earshot. What earshot, a tool that lets coding agents hear, is, how we synthesized effects in code and placed them on the beat, what we changed after letting earshot listen, and how we rebuilt the scenes for a vertical screen.
ReadKeeping your sound and display settings the same on every device
While you're signed in, sound, display, and other settings now stay the same on every device using your account. How we split them from settings each device keeps for itself, such as master volume and recording latency, why we only ask when this device and your account disagree, and checking the JSON field by field to reject broken values.
ReadDo the three Next.js vulnerabilities from October 2026 affect Metronome.fm?
We checked the three issues fixed in the Next.js security update of October 14, 2026 against Metronome.fm's code. The Server Actions DoS did affect us, and here is what would stop and what would keep running under attack. We had already closed off the image optimization RCE, and the use cache RCE didn't apply because we don't use use cache.
ReadMaking our intro video in HTML, with every motion on a 120 BPM beat
We made the Metronome.fm intro video from scenes drawn in HTML and SVG and rendered with HyperFrames. How we write time in beats instead of seconds, a script that counts whether the rendered video lands on the beat, and how Friko is drawn from the app's pixel art and turns into the logo.
ReadTidying up a long app menu with React Aria submenus
As features grew, our app menu reached 28 rows, so we grouped related items into submenus and brought it down to 15. What React Aria Components' SubmenuTrigger handles for mouse, keyboard, touch, and screen readers, and how we open submenus below the row on narrow screens.
ReadBuilding SYNC rooms that play the same beat on several devices at once
SYNC rooms let several devices play the same beat together, for ensembles and lessons. Why we send a start time instead of beat signals, how devices estimate their clock offset from round trips to the server without jumping the estimate, how getOutputTimestamp() converts it to when the sound comes out, and why members correct speaker delay by hand.
ReadRebuilding the 404 and error screens with pixel-art Friko
We rebuilt the screens shown when a page is missing (404) and when an error happens while showing a page, with our mascot Friko as a fading outline. How the pixel art is drawn as hollow squares that fade from the feet up, how the crying face is drawn, and how Next.js's global-error.tsx loads the text and the light or dark theme.
ReadBuilding gap click, which mutes the click for bars so you can check your time
Gap click mutes the click for a set number of bars or at random, so you can check whether you keep time on your own. How a muted beat also stops the flash and vibration, why bars are counted from the start of playback, how the beat display stops, and how the setting types are shared without pulling React into the AudioWorklet bundle.
ReadShare your practice record as an image with Friko
You can now turn your practice record into an image card for social media, from the statistics and the celebration screen. Friko's look changes with your week of practice, and it evolves when you level up into a new title. Because a post screen opened from a URL can't take an image, the image is copied to your clipboard to paste, and we plan to switch to posting a page URL (OGP).
ReadBuilding a drone for pitch practice with Web Audio, no audio files
A drone that keeps playing the note you choose. Why it uses an OscillatorNode instead of the metronome's bass tone MP3s, the organ sound built from a PeriodicWave of layered overtones, and how the pitch changes while playing without a click by easing the values.
ReadBuilding a browser tuner that measures pitch to within one cent
A browser tuner that finds the pitch of the microphone input with the McLeod method. Why the low E of a 4-string bass was missed, why higher notes drifted and how I got the error under one cent, and the spring equation that moves the needle smoothly without wobbling.
ReadMore ways for progressive mode to change the tempo
Progressive mode used to only raise the BPM by a set amount at set intervals. It can now lower the BPM, change it smoothly on every beat, and move in waves that go a little further and step back. Why the range stays low-to-high with a separate direction, and how the tempo is calculated on each beat.
ReadShowing the beat and polyrhythms on a ring that turns like a clock
A new beat display where a hand goes round once per bar. Polyrhythms sit on two rings, with a line joining the points where both sound together. How the beat marks are placed on the circle, and how the hand's position is counted the same way as the audio so it never drifts from the sound.
ReadRunning the "Hey Friko" wake word model in the browser without freezing the page
I ran the wake word model I trained myself in the browser with onnxruntime-web. How I checked that the results matched Python, the snags in serving the WASM files, and measurements after passing audio straight from the AudioWorklet to a Web Worker so the main thread no longer stalls.
ReadTraining my own model to recognize "Hey Friko"
I trained my own classifier on top of openWakeWord so it reacts only to "Hey Friko". Making training voices with Gemini TTS, cutting false triggers on ordinary speech from 79 to 3.8 an hour with YODAS, a dataset of YouTube audio, and what didn't work.
ReadTurning voice requests into commands with Jev, while ignoring talk during practice
Text from the browser's speech recognition is read as metronome commands by Jev, a model that only makes judgments. How the questions to Jev are split so it can handle two commands at once, like "set the BPM to 130 and start", and ignore talking to yourself, plus results from testing 64 phrasings.
ReadMeet Friko, our mascot who changes as your practice level grows
Metronome.fm now has a mascot, Friko, named after the pendulum (furiko in Japanese). Friko lives in the practice level section of the statistics and changes as your level goes up. How we drew 16 candidates side by side and picked one, and how the pixel art is drawn.
ReadThe metronome now counts the beats out loud
The metronome can now count the beats aloud, "one, two, three, four". How I chose a speech synthesis engine, why I had it read the numbers in one go and cut them apart instead of making each word separately, and how I lined up the start of each vowel with the beat so the voice doesn't sound late because of the consonant.
ReadFiner choices for tuplets, polyrhythms, and swing
Added quintuplets, sextuplets, septuplets and thirty-second notes to the patterns, polyrhythm ratios like 4 against 3 or 7 against 4, and a swing strength for eighth and sixteenth notes. How guide notes are placed beat by beat, and why the swung sixteenth pattern became a swing strength slider.
ReadYou can now play a count-in before playback starts
After you press START, a 1- or 2-bar count-in can now play before bar 1. Separate settings for playback and recording, playing the count-in from the sequencer on the audio thread, and keeping the timer and statistics from counting it.
ReadPlaying the metronome click in only the left or right ear
The click can now play on the left or right channel only, so you can hear the click in one ear and a backing track or your instrument in the other. Why the panning happens inside the AudioWorklet instead of a StereoPannerNode, and how we avoided the click getting twice as loud on one side.
ReadMaking the screen flash on the beat
A setting that flashes the screen on each beat. How we keep it to no more than three flashes a second to avoid photosensitive seizures (WCAG 2.3.1), how accented and other beats look different without relying on color, and what happens when your OS is set to reduce motion.
ReadMaking Android phones vibrate on the beat
A setting that vibrates Android phones on each beat. How the vibration stays in time with the sound, why iPhones and Firefox on Android don't vibrate, and why my own phone didn't vibrate at first (the device's haptic feedback setting).
ReadControlling our metronome from Chrome's built-in AI with WebMCP
We registered Metronome.fm's controls as WebMCP tools so Chrome's built-in model can handle requests like "180 BPM in 7/8". The small model said it had made the change when nothing had changed, so we reworked how tools report failure to the AI, how they are split, and how their descriptions are written.
ReadSpeeding up our landing page, continued: loading less on every page
Following the previous post, we made the landing page faster without changing its animations. The 100KB of render-blocking CSS turned out to be 370 Japanese font definitions loaded on every page. We also stopped loading zod on every page, cut how often the scroll animations (ScrollTrigger) re-measure, and dropped deferring the demo cards' JS because the cards were redrawn.
ReadChoosing compound and odd meters such as 6/8 and 7/8
You can now choose the bottom number of the time signature and beat groups such as 2+2+3. Why we added them although beat counts and accents could already play the same clicks, why the BPM counts the bottom note, and how 2+2+3/8 is stored without a new column.
ReadMore actions on keyboard shortcuts, and new default keys
A follow-up to the post on assigning your own shortcut keys. Actions you can run from the keyboard went from 16 to 41, and the default keys, once picked by first letter, were chosen again. How the keys were chosen, why keys you changed yourself stay as they are, and how on-screen actions run from keys.
ReadAssign your own keyboard shortcuts
Inspired by Zed, you can now assign keyboard shortcuts however you like. This post covers keys per BPM or language, fuzzy and cross-language search, sharing keymaps as JSON, and why we kept single-character keys.
ReadTrying Cloudflare's security audit skill, security-audit-skill
We ran Cloudflare's security-audit-skill on Metronome.fm. How the skill works, running it in quick mode and how many tokens it used, how we checked and fixed the two items it raised (offline page storage and where our logging token lived), and whether it was worth doing.
ReadA hidden page where our ASCII art logo moves to an NES-style click
Inspired by the site ascii.rest, we built a hidden page that draws the Metronome.fm logo in text and moves it on the beat. How characters are picked to match the logo's shape, a click that imitates the NES sound chip, and keeping sound and motion on the same beat. We only give a hint about where to find it.
ReadSpeeding up our landing page without changing its animations
Our landing page, full of GSAP animations, scored 31 on PageSpeed Insights (mobile). Without changing the animations, we fixed a forced reflow found in a CPU profile, an LCP delayed by a hidden header, Clerk loading on the landing page, and Japanese fonts split into 61 files, and brought the score up to 61 to 69.
ReadSorting AI requests with Jev to pick the right model
In the feature that asks AI to edit your settings, requests are now classified first by Jev, a cheap model that only makes judgments. Requests unrelated to settings come back without using up a request, and only requests to build something from scratch, from a mood or a song, go to Claude Sonnet 5.5. Measured comparisons of three models in four configurations, and a cap that keeps costs from running away.
ReadTheme, beat display, and more, gathered into one Display Settings
Display switches that sat in the menu one feature at a time are now in a single Display Settings dialog: a live preview of your changes, showing, hiding and reordering footer buttons, why Full Screen stays in the menu, and the switches we also put in the docs header.
ReadA year-long calendar, weekly goals and levels in your practice statistics
We rebuilt the statistics and added a calendar of a year of practice, streaks counted by the week, weekly goals, levels and quests, and celebrations for milestones. A tour of what the statistics can do, plus two bugs we fixed along the way.
ReadCollecting Core Web Vitals from real users in Better Stack
We started collecting Core Web Vitals measured on real users' devices in Better Stack. Why we didn't use Vercel Speed Insights, how the values are sent, a dashboard built around the share of "good" results, and an issue where values never arrived when a page with a Service Worker was closed.
ReadYou can now sign in with a verification code sent to your email
Sign-in used to be Google and GitHub only. Now you can also sign in with a verification code sent to your email address. Why I passed on Apple and X because of the cost, the Clerk settings, how one input field decides between sign-in and sign-up, and why the E2E tests got stuck on bot protection.
ReadLaunching a status page you can contact us from
status.metronome.fm, a page showing whether the service is up, now runs on Better Stack. What is monitored, a custom domain that took a single Cloudflare CNAME, and a contact button on the status page that opens the form inside the app.
Read