pygame is
Simple DirectMedia Layer is
Site Swing
pitch perfect

pitch perfect - 0.2b

Sean McKean (randomeyes)



This program is meant to demonstrate how to generate dynamic audio tones in real time without pre-loading them as .wav files, although it now includes support for rendering small recorded samples as well. I was thinking about including something similar to this method in an upcoming game, to make the control a little more interesting. But I do not have a date set on it yet, and I still have some bugs to work out. Greetings and thanks to all the people who have taken the time to give me ideas and feedback.


Added note chording and abstracted the tone generation function to a separate module; thanks to David Cole and Jug for these ideas.


Home Page:


click to view original size


pitch perfect - 0.3.2 - Nov 15, 2010
pitch perfect - 0.3.1 - Nov 13, 2010
pitch perfect - 0.3.0b - Nov 13, 2010
pitch perfect - 0.2.1b - Nov 8, 2010
pitch perfect - 0.2b - Nov 8, 2010
pitch perfect - 0.1b - Nov 6, 2010 account Comments

If you wish to leave a comment with your account, please sign in first.

March 10, 2011 9:27pm - Zachariah Callaway - nickname: (xzcallaway)
A .deb package of Pitch Perfect is available for download at
November 16, 2010 2:20am - Shanti Pothapragada - nickname: (rgbdreamer)
Very nice interface!
November 15, 2010 7:03pm - Sean McKean - nickname: (randomeyes)
The comments give me a better idea of how the general experience is, thank you for sharing them. I have tried adding comments to my code where I think they might help.

@ Hewitt Squared Labs: Adding a main class was just a habit developed out of a need to avoid global variables as much as possible. Are you talking about the size of the gradient, or the set of separate colors?
November 14, 2010 3:48pm - Hewitt Squared Labs - nickname: (hewitt2labs)
One other thing, the color ring may look better if you make the gradient spread out, though that might be me...
November 14, 2010 3:39pm - Hewitt Squared Labs - nickname: (hewitt2labs) - 4/5
slick code, I'll have to play with the command line args. I've also never seen a python program with a main class instead of a main function, I'll have to think about doing that for a future large program.
November 11, 2010 12:26pm - Eric Pavey - nickname: (akeric) - 5/5
Great stuff. Like others I've been wanting to learn a good way to do this in PyGame. Thanks for the great example. Like others said, would be nice to get some docstrings in the code just to make it easier to wrap ones head around ;)
November 9, 2010 3:45am - Xandar Kablandar - nickname: (eternalcheesecake) - 4/5
I've been wanting to know how to do this and your code is great for learning from, thanks for sharing it!
November 7, 2010 5:54am - Jug - nickname: (jug) - 5/5
very nice program. Maybe you could make a tutorial out of it or just write some docstrings to make it easier to understand and learn from. Or even better, make a small module that provides a set of higher level methods to create sound (so the user does not have to care about all the arrays and numpy etc.).

our projects welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
recent releases
Oct 1, 2015

Sep 11, 2015

Sep 6, 2015

Aug 26, 2015

Aug 25, 2015

Aug 21, 2015

Aug 16, 2015

Jul 30, 2015

Jun 24, 2015

... more!
for pygame related questions, comments, and suggestions, please see help (lists, irc)