How do I generate 1/f (pink) noise in Python

Matthias Baas baas at ira.uka.de
Tue Apr 9 02:53:09 EDT 2002


On Mon, 08 Apr 2002 12:39:16 +0200, Max M <maxm at mxm.dk> wrote:
>I am dabling in algorithmical composition and at times I need to 
>generate random values. Often the values should have the characteristics 
>of pink noise (1/f).

I've just released a collection of modules which contains a noise
module, see http://cgkit.sourceforge.net
Maybe this is what you want? You pass up to 3 floating point values to
the noise function (Perlin noise) and it'll return a pseudo random
value in the range from 0 to 1 (or -1 to 1). The output is dependent
on the input and will always be the same if the input stays the same
and the output is band limited.

(BTW, I've just recently noticed that you won't be able to import the
module under Linux. This is fixed for the next release, so tell me if
this module is really what you were looking for and you need it for
something other than Windows)

- Matthias -




More information about the Python-list mailing list