Jens Mohrmann 079d574b66 Overhaul pitch detection and note matching
- Pick detector per instrument range: ACF2PLUS (robust down to ~40 Hz) for
  normal instruments, YIN only for the whistle register. pitchfinder's YIN
  latches onto tau=2 (~20 kHz garbage) below ~100 Hz and for quiet input;
  the old fixed 4096 window masked this, the smaller window exposed it.
- RMS-normalize analysis input for the YIN path only; ACF2PLUS keeps the raw
  signal so its internal unpitched gate rejects quiet decayed audio instead
  of amplifying noise into confident wrong pitches (tuner stuck on 'a note').
- Adaptive analysis window sized to the instrument's lowest note (~2 periods):
  half the latency, a quarter of the CPU for guitar/piano/voice; bass keeps
  the full window for E1.
- Reject detections implausibly below the instrument floor (mains hum).
- Clear stale pitch readings after 200 ms instead of keeping them forever.
- Shared AudioEngine singleton for all playback (was: two AudioContexts);
  tracks audibility so the app stops hearing its own speaker (ear-training
  self-scoring) and gates matching plus display during playback.
- MatchTracker: grace-period based note hold instead of reset-on-every-flicker
  (YIN flickers during attacks/decays; the old hard reset made the 50 ms
  threshold fire unreliably).
- Display damping in the producer (EMA for cents/level, 3-frame note-name
  hysteresis); display components render directly without CSS transitions.
- Regression tests: synthetic signals through the exact pipeline helpers
  (MatchTracker + pitchDetection test suites).
2026-09-13 18:52:21 +02:00
2025-12-21 12:58:40 +01:00
2025-12-21 12:20:30 +01:00
2025-12-21 12:20:40 +01:00
2025-12-28 15:31:32 +01:00
2025-12-31 10:35:11 +01:00
2025-12-31 10:35:11 +01:00
2025-12-27 22:46:58 +01:00
2025-12-21 12:20:40 +01:00
2025-12-21 12:20:40 +01:00
2025-12-21 12:20:40 +01:00
2025-12-31 10:35:11 +01:00

Sheet Music Trainer

A web-based application designed to help musicians practice sight-reading and ear training. It listens to your instrument (or voice) via the microphone and gives real-time feedback.

Live Demo (If available)

Features

  • Sight Reading Mode: Read notes from the interactive staff and play them on your instrument. The app listens and confirms when you hit the correct note.
  • Ear Training Mode: Listen to a reference note and try to reproduce it.
  • Real-time Pitch Detection: Uses your device's microphone to detect notes instantly.
  • Instrument Support: Optimized for Guitar and Piano, with configurable tunings for guitar.
  • Virtual Instruments: On-screen interactive guitar fretboard and piano keys for visual reference or touch input.
  • Customizable: Adjust difficulty (range, accidentals), key signatures, rhythm/metronome settings, and more.
  • Zen Mode: Distraction-free practice interface.

Getting Started

Prerequisites

  • Node.js (v18 or higher recommended)
  • npm

Installation

  1. Clone the repository:

    git clone https://github.com/9x/sheetmusictrainer.git
    cd sheetmusictrainer
    
  2. Install dependencies:

    npm install
    
  3. Run the development server:

    npm run dev
    
  4. Open your browser and navigate to the local URL provided (usually http://localhost:5173).

Technical Details

100% vibe coded using Google Antigravity and Gemini 3 pro.

This project is built with:

  • React + TypeScript
  • Vite
  • VexFlow (for music notation)
  • Pitchfinder (for audio detection)

For more details on the architecture, see TECHNICAL_REALIZATION.md.

License

MIT

Description
No description provided
Readme 1.3 MiB
Languages
TypeScript 90.9%
CSS 5.8%
JavaScript 3.2%