Wednesday, September 10, 2008

Python on Windows: A Simple Perfect Pitch Trainer

These few days I have been playing around with Python, in part due to necessity to create a fast and easily modifiable web test client, and in part to fulfill my craving to learn new things.

According to the definition in wikipedia: 
Perfect Pitch is the ability of certain people to identify or recreate musical note without the benefit of known reference.

It means that you can pinpoint certain frequency (or its multiplication) without having external reference, your reference is built in internally. Say, you can pinpoint one note: A (440Hz).

Then if you have the ability to recognize relative pitch, then you will be able to construct any other note from that reference.

For those who wants to train his ear to gain perfect pitch, here is a simple script to train your ears in Python (sorry, Windows platform only...):

import winsound 

while(True):
. . winsound.Beep(440, 400)
. .
time.sleep(10)

This script will play the 'a' tone every 10 seconds for 400 milliseconds. Enough to pester your ears, and hopefully it will keep haunting your ears long after you have not put your earphones on. Human brains tend to interpolate and extrapolate, so hopefully your under conscious mind will replay the note over and over again.

No comments:

Post a Comment