Algorithms for determining the key of an audio sample

前端 未结 8 2071
野趣味
野趣味 2020-12-22 14:59

I am interested in determining the musical key of an audio sample. How would (or could) an algorithm go about trying to approximate the key of a musical audio sample?

<
8条回答
  •  自闭症患者
    2020-12-22 15:42

    It's a complex topic, but a simple algorithm for determining a single key (single note) would look like this:

    Do a fourier transformation on let's say 4096 samples (exact size depends on your resolution demands) on a part of the sample which contains the note. Determine the power peak in the spectrum - this is the frequency of the note.

    Things are getting tighter if you have a chord, different "instruments/effects" or a non-homophonic music pattern.

提交回复
热议问题