
A Web Audio experiment – detecting piano notes - bubble_boi
https://medium.com/@david.gilbertson/a-web-audio-experiment-666743e16679#.ywvqmjdmz
======
chrismorgan
I’ve thought about making an analogue polyfill for the Web MIDI API using
pitch detection of the Web Audio API, ideally polyphonic. But it’s a fair way
down my long list of things I’d love to do but will probably never make the
time to do.

That the black notes aren’t centred is something I was reminded of when making
an SVG keyboard myself a few years back. It’s rather important to comfortable
playing.

------
6stringmerc
A nice read and the explanation felt pretty easy to follow. Nice to have such
a laid-out type of examination of the approach and whatnot.

~~~
bubble_boi
Thanks!

------
aczerepinski
Think of the ad synergy you could get with local piano tuners. Our algorithm
has detected that you're overdue for a tuning!

------
RubyPinch
Learning question: The next steps would be to take a discrete Fourier
transform to help in the frequency detection, yes?

~~~
bubble_boi
If I was to carry on with it, I would look into using byteFrequencyData rather
than timeDomainData. My initial attempts with the frequency data weren't
great, but a few people have mentioned it so I'd take another look and see if
I just wasn't doing something dumb.

I felt like the most fiddly work would be accurately sampling the sound. E.g.
not recording when it was under (or maybe over) a particular volume, ignoring
the initial thud of a key (particularly with the phone sitting on the piano),
and making it so that the correct 'note' stayed blue as the sound trailed off
and got less reliable.

