📋 Overview
NoteRunner is a side-scrolling platformer that uses your microphone to detect what you're playing on guitar or bass. Higher pitch moves your character up, lower pitch moves it down. Platforms scroll past and you have to hit them by playing the right notes. No music theory required — the game auto-calibrates to your instrument's range from the first few notes you play.
💡 Context
Built as a way to jam with my guitar-playing buddy and maybe learn a little bit about playing guitar myself. Quick proof of concept — what if you could turn real instrument playing into a game? Most music games use button presses to simulate playing. NoteRunner flips that — you play your actual instrument and the game responds.
🛠 Tech Stack
🧠 Technical Challenges
Getting real-time pitch detection to coexist with a smooth 60fps game loop in the browser turned out to be the core technical challenge of this project.
The YIN pitch detection algorithm is O(n²) with a buffer of 4096+ samples. Running it on the main thread via setTimeout crashed the browser when combined with a requestAnimationFrame game loop — ~335 million operations per second competing with rendering. The game would freeze within seconds of enabling the microphone.
Moved the entire YIN algorithm into a Web Worker running on a separate thread. The main thread only copies the audio buffer and posts it to the worker using Transferable ArrayBuffers for zero-copy message passing. Added backpressure with a workerBusy flag so the main thread never queues up detection requests. Result: 12-20 pitch detections per second running smoothly alongside a 60fps game loop, with full bass guitar support (30-2000Hz range, 8192 FFT buffer, 0.20 threshold).
🎯 Role
Solo project — built with AI assistance. A browser game where your real instrument controls the character through pitch detection.
✨ Key Highlights
- Real-time YIN pitch detection running in a Web Worker for zero-jank gameplay
- 5-lane system with smooth lerp interpolation (0.12 factor) for responsive feel
- Auto-calibrating pitch range — learns your instrument from the first ~10 notes
- Works with guitar, bass, or any pitched instrument via standard microphone
- Note names displayed in HUD for passive music theory learning