Skip to content
daniel-pimenta-ccPublic

About

Play your kalimba into the mic — real-time note detection and a guided song mode, in a single HTML file with zero dependencies

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aikalimba

Play kalimba into your microphone and the browser tells you what you hit — or guides you through a song or a practice exercise, note by note. Plain ES modules, no dependencies, no build. Audio never leaves your device.

Live: https://dspimenta.com/aiKalimba/

Made for a 17-key kalimba in C major (C4–E6).

Run

The mic requires a secure context and ES modules do not load over file://, so serve the folder over http(s) instead of opening the file directly:

python3 -m http.server 8000
# open http://localhost:8000

Any static host works (GitHub Pages included).

Song mode

Paste a kalimba tab in number or letter notation (the formats used by sites like kalimbatabs.net), name it, and play. Your song library and calibration live in localStorage.

  • 1–7 / C–B are C4–B4; each °, º, * or ' raises one octave (1* = C° = C5); scientific octaves (C4…E6) also work
  • Notes in parentheses are a chord: (1* 5), (C E G), (F+F°)
  • x2 or (x2) repeats the line
  • Lines containing text are ignored, so you can paste tabs as-is
  • The 123↔ABC button converts a tab between number and letter notation in place

Notes advance when you play them correctly — there is no timing pressure, so you can build muscle memory at your own pace. Each tab line gets its own color; a color change means the next musical phrase.

Practice mode

A built-in exercise library covers scales, octaves, intervals, arpeggios and chords, each with a plain-language explanation of what the concept is and why it is worth practicing — written for a first instrument, not for someone who already reads music.

Exercises are ordinary tabs running through the same guided engine, so they live in lessons.js as content. A metronome (adjustable tempo, accented downbeat, visual pulse) runs alongside, and timing evaluation is an opt-in toggle: off, the app stays at your pace; on, it reports how far each note landed from the beat. The click is pitched above the detector's search band so it does not register as a note if it leaks through a speaker — headphones are still the better call.

Detection

Spectral peak detection (8192-point FFT) rather than autocorrelation, so chords resolve cleanly. The thresholds — sympathetic ringing of neighbor tines, octave partials, attack transients, adaptive noise gate — were measured on a real instrument; the reasoning lives in comments next to each constant. In song mode, matching is guided by the score: knowing which notes to expect lets the app confirm a soft chord member that blind transcription would miss.

Fast repeated notes are the hard case: re-plucking a tine that is still ringing barely moves the spectrum inside the FFT's 170ms window. A time-domain click detector (second-difference RMS — the pluck click is broadband, a ringing tail is tonal) catches those re-plucks, and in song mode an expected key that is already ringing loud counts as satisfied rather than being asked to prove fresh energy it physically cannot show.

Per-tine calibration (record each key once) adapts the detector to your kalimba's actual tuning.

A self-test of the detection core runs on page load and reports to the browser console.

About

Play your kalimba into the mic — real-time note detection and a guided song mode, in a single HTML file with zero dependencies

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages