Steve asked me lately if I wouldn’t know an easier method to produce pink noise (See his method in the “Add-noise”-plug-in).
Why do we want a method for this kind of noise, isn’t it not already available in the generate menu?
Yes, it is, but Nyquist has no access to this C++ code.
The only thing that is available is white noise.
Coloured noise is white noise of which the amplitude decreases the more, the higher the frequency gets. Thus filtering with a lowpass is the logical choice.
(LP (NOISE) 20)
Ok, we have a sound with attenuated higher frequencies. Unfortunately, the low pass with the lowest order has a roll off of 6 dB per octave, which produces 1/f^2 noise, so called “brown” noise.
Pink noise is “1/f”, this means that the roll off or transition band should be damped by 3 dB per octave.
Although no filter with that roll off is available, here’s a bi-quad implementation that comes fairly close:
;; original first 3 coeffs b0-2 were 5 times smaller ;; Fine for measurement with sine, ;; but 14 dB too small resulting noise (defun pink-lp (snd) (biquad-m snd 0.247876311 -0.315279067 0.074161016 1.0 -1.80116083982126 0.80257737639225)) (pink-lp (noise) )
(I’ve found the original code in one of Edgar’s plug-ins)
The measurement with sine waves returns fairly good damping values of 3 dB as an average.
But if the LP is applied as such on white noise, the output is about 14 dB too low, don’t ask me why. I therefore multiplied the first 3 coeffs by 5. Let me know if the output is too high on your system (all is possible with 3 different OS’ and various architectures).