I wanted to have a play with #WebMIDI and now this exists … https://piano.r0b.io/
You connect MIDI devices and it shows you what notes are playing! Only in FireFox & Chrome sadly.
I spent too much time creating the digital piano as a nicely organised #SVG with each of the notes labelled correctly.
I originally wanted to do it with CSS grid but I quickly found it wasn't really possible in the way I wanted to achieve it.