sabren.net   rants   archive   bio   portfolio

sabren.net archives

back to sabren.net...
back to the archive...

entries for 2002/9/17

my reward

BTW: I figured out a great reward for me. If I get my two cornerhost mini-projects done during the day, I get to spend the evening working on fun programming stuff. :)

pyjama update

It turns out that if you want to sing into a microphone and then determine the pitch, the easiest thing to do is let the Snack toolkit do the work for you. It can record a sound into memory and then show you the pitches, even at the 10-millisecond level.
 
So I wrote a little tool that records me singing, saves it as a wave file, and also saves the pitches as a python array.
 
Then, I wrote a python script to match the pitches to the closest "pure" musical note.
 
Then I wrote the notes out as a simple Haskore program and played it.
 
It sounds horrible! :)
 
The good news is that the system works end to end. I can record sound and generate a midi file. All I'm missing is some intelligence to turn the raw pitch data into single notes of particular durations. That's going to be the tough part.