Sound programming: Tone production in Python?

sj jones57 at
Thu Jan 30 10:17:18 CET 2003

Joseph Blaylock wrote:

> I've been searching around the 'net for information on sound programming
> in Python, particularly tutorials, etc., but the outlook appears to be
> pretty
> bleak.  There's a lot of stuff about playing back previously-sampled audio
> files, but I haven't found anything about making music or (especially)
> generating raw tones.
> For example, if I wanted to generate a tone of 200 hertz and a tone of 205
> hertz on audio channels 0 and 1, respectively, for a duration of two
> seconds,
> how might I accomplish this?  Pygame's sndarray module looks promising,
> but seems a bit light on it's documentation, especially of a tutorial
> nature.
> So: can anybody tell me a sure-fire way to generate tones from Python? 
> Bonus points for sticking to packages that are in Debian unstable, or part
> of the
> basic distribution.  And further, can anybody provide me pointers to more
> generalized sound/music programming resources for Python, especially of a
> tutorial nature?
> Thanks!
>     Joe

Although this doesn't answer your question re python you might be interested 
in these other synthesis packages.

1. Nyquist is an extension of XLisp with very power synthesis/composition 
functions.  It is featured in the Fall 1997 issue (Vol 20, No 3) of the 
Computer Music Journal

You can find binaries and sources at

2. "Common Lisp Music" is another very powerful synthesis language based on 
lisp.  I have not used it myself and don't have the URL offhand but it 
should be easy to find.

Steven Jones

More information about the Python-list mailing list