Hacker News new | ask | show | jobs
by acmj 1914 days ago
I am no musician. I heard quite a few musicians, with or without innate perfect pitch, can tell the keys in a chord, though maybe not to the 100% accuracy. For example, something like what the kid is doing in this video [1]. I am a bit surprised that this can't be done programmatically.

[1] https://www.youtube.com/watch?v=vXivZlPu0ms&t=175s

2 comments

”Key” in this context refers to key signature rather than physical keys on a keyboard.
Thanks for the correction, but the key signature in a piece may be changing. Also, those with perfect pitch can tell the key signature from a short passage if there are few accidentals.
A common idea is doing modulation. It's usually an easy way to increase the excitement of the song. Most people can naturally hear and feel it, but maybe not have the vocabulary to describe what's happening.
Well, that's the thing -- when listening to any song, even if you know the pitches, it is impossible to know if there are accidentals or not depending on the phrase. If a 10-bar phrase modulates in bars 2-5, and you listen to bars 2-5, you may conclude the piece is in key X when it's just a modulation from the overall key of Y. This also implies the piece follows western common practice, or is even tonal in the first place. The difficulty of categorizing music is its ambiguity :)
The blog post criticizes existing software for their inaccuracy, but that is not their problem. The key signature of a particular passage may deviate from the overall key. I also wonder how they evaluate accuracy shown in [1] and what is the human accuracy in comparison.

[1] https://www.reddit.com/r/DJs/comments/hwlzyt/key_detection_c...

Fast Fourier transform can be used to identify the pitches in a sounds sample. There are other methods but FFT gets the most press.
FFT is pretty bad at doing the lower pitches. Way too many notes will find their way into the same bin. And if you want more resolution you'll need an impractical FFT size.