Csound Csound-dev Csound-tekno Search About

[Csnd] Freq to midi note

Date2013-11-23 22:26
FromRoger Kelly
Subject[Csnd] Freq to midi note
Does anyone have a formula to convert from Freq Hz to Midi note?

I did not see it in the Csound functions.

Date2013-11-23 22:52
FromMichael Gogins
SubjectRe: [Csnd] Freq to midi note

opcode hertz2midinn, i, i

ihertz xin

print ihertz

; m = 12*log2(fm/440 Hz) + 69

ilog2 = log(2)

imidinn = 12 * (log(ihertz / 440) / ilog2) + 69

print imidinn

xout imidinn

endop




-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sat, Nov 23, 2013 at 5:26 PM, Roger Kelly <loraxman@gmail.com> wrote:
Does anyone have a formula to convert from Freq Hz to Midi note?

I did not see it in the Csound functions.