**Think Pink**

Several days of pink noise investigation and coding. This is a great site, although unfortunately suffering from link rot:

https://www.firstpr.com.au/dsp/pink-noise/

The Voss-McCartney algorithm is quite efficient, this site has it implemented on an 8bit processor, with well commented assembly:

https://electricdruid.net/noise2-white-pink-noise-source/

The fancy math way of describing the Voss algorithm is that it is the sum of the outputs of a collection of multi-rate sample/hold units operating at powers of 2 rates, each fed by uncorrelated noise sources. The McCartney spin on this is scheduling things so that only one sample/hold is updated at a time, which drastically reduces the real-time requirement. If the noise sources are a single bit from an LFSR (cycled once for each sample) then the complexity of the sample/holds and summation of them are also drastically reduced.

So I coded it up and it's running quite nicely, giving a -3dB per octave slope*. There is some amplitude ripple, but that doesn't matter for synth audio type applications. The output levels are quantized to the number of sample/holds being summed, in this case 12 (12 octaves covers the audio band down to 12Hz or so) but that doesn't seem to be an issue either.

The trick then is to go through all the presets and come up with new level, bass, and treble settings to more or less match the pink generator output to the old white generator. Surprisingly, one can get fairly close to pink using the white source, and vice versa:

Above: White noise source approximating pink noise with bass[16] & treb[-24].

Above: Pink noise source approximating white noise with bass[-31] & treb[15].

I graphed all possible bass and treble settings (independent of each other) and came up with some simple polynomials to automate the conversion in the librarian software. I also examined all the presets for non-compliance of the output, and only a couple of trivial settings fell into that category, so no real harm done.

There are tons of presets really cutting back on the treble / boosting the bass, so pink noise is just a better fit overall and worth the effort. I was a little worried that pure noise presets, such as the wind one, might have a noticeable drop in volume as the band pass filter sweeps into the upper range, but that doesn't seem to be the case.

* Pink noise is "1/f" noise, so you might then think that over an octave (a 2:1 ratio) it would have a 6dB (a 2:1 ratio) amplitude change rather than 3dB. The explanation is that it is a change in power rather than amplitude, and power is proportional to the square of the amplitude, which in logarithmic terms is a factor of 2, so 3dB amplitude change = 6dB power change. (I've heard it said that "a dB is a dB" but it really depends on whether you're talking about amplitude or power, as this case demonstrates.)