Thoughts from the mind of Joeri Vankeirsbilck, 04-09-2000:
><http://click.egroups.com/1/8864/1/_/607541/_/968025932/>Thanks, but
>I have the charts as well. :-)
>Anyone who's got the _formula's_?
Each note's frequency is 2^(1/12) (2 to the power 1/12) times the
frequency of the previous note.
So if A = 440 Hz, then A# = 440 * 2^(1/12), B = 440 * 2^(2/12), etc.
If you call the A=440 note "note 0", so that A#=1, B=2, etc (and
backwards: G#=-1, G=-2, etc), then a formula is
freq = 440 * 2^(n/12) where 'n' is the note number (1)
Or, with MIDI note numkbers (A = midinote 69 (or 57, depending upon tuning)):
freq = 440 * 2^((n-69)/12) where 'n' is the MIDI note number (2)
>And an even funnier one: I need to calculate what note could fit in an
>audio fragment of 256 samples at a sample frequency of 44100. What note
>could this be? (I guess 44100/frequency would give me the amount of
>samples, and that's why I need to find a way to calculate frequency out
>of the note).
I suppose you mean that one wave (cycle) is supposed to fit in 256
samples, right? In that case:
256 samples at 44100 Hz take up 256/44100 seconds. If 'one wave' of
the note/frequency is supposed to fit in this time, then it's easy to
see that 44100/256 waves would fit in one second, so the frequency of
the note you're looking for is 44100/256 (= 172.27 Hz). Finding the
corresponding MIDI note number from this frequency means applying the
reverse of formula (2) above:
n = 69 + 12*log(freq/440)/log(2), where n is the MIDI note number
Applying this to the freq = 172.27 gives n = 52.77. MIDI note 53 is
F, so a frequency of 172.27 is indeed a rather flat F, as someone
else pointed out earlier.
If both sample frequency F and number of samples S are variables,
then the entire formula would become:
n = 69 + 12*log(F/(S*440))/log(2)
Hope this helps. If not, feel free to ask...
cheers,
Hendrik Jan
--
Hendrik Jan Veenstra ( h@... )