开发者

Difference between 12Log2 and Log[2,12]?

My math is pretty weak, and I'm having confusion over the differences. I'm trying to find out the midi formula, to output frequency开发者_StackOverflow社区 when I have midi value

MidiNumber = 69+12* Log2(440/Frequency)

So I derived Frequency = (-69 + 5280 Log2 + MidiNumber)/(12 Log2)

If I plugin things this works correctly 440 = (-69 + 5280 Log2 + 69)/(12 Log2)

If I do this though things do not work correctly (-69 + Log[2, 5280.] + 69)/Log[2, 12.]

This is the output I get in my programming, I don't know exactly the difference between the two equations. Maybe it's 12*Log2, but is that 12*Log2[1] or, ...? No idea.


Part of your confusion seems to be treating Log2(n) as Log2 * n. Log2 is actually a function, the inverse of which is 2^x.

So your derivation should go something as follows:

MidiNumber = 69 + 12 * Log2(440 / Frequency)
MidiNumber - 69 = 12 * Log2(440 / Frequency)
(MidiNumber - 69) / 12 = Log2(440 / Frequency)
2^((MidiNumber - 69) / 12) = 440 / Frequency
Frequency = 440 / 2^((MidiNumber - 69) / 12)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜