Story

Show HN: A real-time chord identifier web app using the Web MIDI API

nate-gehringer Tuesday, February 17, 2026

This was a quick, fun project that solves a practical problem I had — wanting to learn the names of piano chords, but not seeming to want to spend time staring at chord charts. I figured perhaps I could learn some music theory more deeply by encoding the logic into software, as well.

I came across this table <https://en.wikipedia.org/wiki/Chord_(music)#Examples> that breaks down the composition of chords logically. I was reminded of a bitmask, so I translated each chord into a 12–bit bitmask with a bit for each distinct note letter name (e.g. “C” or “B♭”). Decoding binary was involved in interfacing with MIDI … that might have been the inspiration — regardless, a bitmask seems ideal for this purpose.

The most challenging part by far was the logic that determines whether say, “A♯/B♭” (which are considered to be the same note in the 12–tone chromatic scale) should be rendered as “A♯” or “B♭”. As best as I understand, this depends on key signature context, and the logic regarding this isn’t well-described. I settled on finding the diatonic scale (7–note) that contains the maximum number of notes that the chord also contains. That diatonic scale provides the context for the note letter names. This logic isn’t perfect yet — the scales that include double flats and double sharps (which I wasn’t previously aware of) still provide ambiguous results.

Summary
This website provides a MIDI chord identifier tool, allowing users to input MIDI data and receive information about the chords present in the music.
4 4
Summary
midi-chord-identifier.backwater.systems
Visit article Read on Hacker News Comments 4