bokr at oz.net
Wed Sep 4 02:55:57 CEST 2002
On 3 Sep 2002 13:29:23 -0700, megabytemonster at hotmail.com (Stuart) wrote:
>While looking at the python documentation, I noticed that there are no
>frequency/pitch tables for using with the winsound module. Does
>anyone know whether this documentation exists, and/or what the
>corresponding frequencies to pitches are?
Well, 440 hz is an A, I believe. And an octave is a factor of 2.
But I believe the best sounding scale will not have 12 equal ratios
Google is your friend...
(this table does appear to be based on equal ratios).
... which is easy to compute with Python:
>>> notes = 'A Bb B C Db D Eb E F Gb G Ab'.split()
['A', 'Bb', 'B', 'C', 'Db', 'D', 'Eb', 'E', 'F', 'Gb', 'G', 'Ab']
>>> def noteFreq(name, oct):
... return (27.5*2**oct)*2.0**(notes.index(name)/12.)
Here's more. Careful, it's easy to get interested ;-)
More information about the Python-list