Guitaroid

Inspiration

Many aspiring musicians struggle with static tabs and sheet music because they offer zero real-time feedback. Inspired by rhythm games like Guitar Hero, Guitaroid bridges the gap between interactive gaming and learning a real instrument by providing instant visual and acoustic feedback as you play.

What It Does

Guitaroid transforms real-time guitar practice into an engaging game using your actual instrument—no proprietary plastic controllers or MIDI pickups required. By parsing .gp4 tab files and listening through your computer's microphone, Guitaroid syncs a scrolling music highway with live digital signal processing (DSP):

  • Real-Time Pitch Detection: Uses the YIN algorithm to capture acoustic frequencies (Hz) in real time and map them to musical notes.
  • Interactive Highway Visualizer: Notes scroll down a 60 FPS track toward a target line for clear timing, string, and fret guidance.
  • Instant Validation: Compares incoming mic pitch against the active tab note within a +/-100 ms timing window.
  • Backing Audio Synthesis: Plays the song's native arrangement via SoundFont audio to keep you in sync.
  • Gamified Progress: Features live scoring, combo streaks, and hit/miss indicators.
  • Native Tab Parsing: Directly parses standard Guitar Pro (.gp4) files for notes, string positions, and tempo.

How We Built It

Built on Python 3.12, Guitaroid integrates real-time DSP, binary parsing, and responsive visuals:

  • Audio & Pitch Engine: Combined aubio and sounddevice for a low-latency background mic stream with a 4096-sample buffer. Filters noise via an RMS volume gate, pitch confidence thresholding, and frame debouncing.
  • Tab Parsing: Used PyGuitarPro to extract note pitches, fret markers, and timestamps from .gp4 files.
  • Backing Track: Built a SoundFont synthesis engine using soundfile and numpy for real-time audio playback.
  • Visual Highway: Developed a 60 FPS pygame-ce renderer synced with pygame.mixer audio playback time.

Challenges We Ran Into

  • Pivoting from Computer Vision: Initial attempts to track fingers via camera suffered from lighting issues and video latency. We pivoted entirely to microphone-based audio DSP.
  • Low-Frequency Pitch Detection: Tracking low guitar frequencies (~82 Hz for Low E) without lag required a 4096-sample buffer paired with multi-stage audio filtering.
  • C-Extension Build Issues: Compiling aubio on macOS under Python 3.12 required explicit C-compiler flags (-Wno-error=incompatible-function-pointer-types) and strict dependency bounds (numpy<2.0).
  • Cross-Thread Sync: Synchronized 60 FPS pygame rendering, audio playback, and asynchronous mic listeners to prevent visual stutter and desync.

Accomplishments We're Proud Of

  • Low-latency, accurate pitch tracking down to Low E (~82 Hz) using custom DSP filtering.
  • Direct binary parsing of .gp4 tabs into dynamic gameplay timelines and backing tracks.
  • Zero hardware dependencies—works out-of-the-box with standard laptop microphones.
  • Smooth 60 FPS pygame-ce highway visualizer with real-time hit validation.

What We Learned

  • DSP principles including sample rates, buffer sizing, and YIN algorithm tuning to balance speed and pitch accuracy.
  • Multi-stage noise filtering combining RMS gates, confidence limits, and debouncing.
  • Troubleshooting C-compiler flags and managing C-extension compatibility across modern Python releases.
  • Decoupling background audio processing thread loops from 60 FPS graphics rendering loops.

What's Next for Guitaroid

  • Polyphonic & Chord Detection: Expand DSP to recognize full chords (G Major, C Major) using spectral analysis.
  • Dynamic Speed Control: Adaptive playback that slows down complex sections for beginner practice.
  • File Support: Add support for .gp3, .gp5, and .gpx formats to unlock millions of community tabs.
  • Audio Calibration Suite: In-game tool to profile room acoustics, mic gain, and guitar timbre.
  • Bass & Tuning Support: Add support for 4-string bass guitars and alternate tunings like Drop D.

Built With

Share this project:

Updates

Submission history