I'm using the fill_noise8() function to generate random colors that fade into one another,

I’m using the fill_noise8() function to generate random colors that fade into one another, based on a timestamp. I’m noticing that the noise generator seems to really like blues and greens, and almost never goes red or purple. Is this an artifact of the Perlin algorithm? Is there a way to make it give a more even distribution?

The arguments I’m using:
fill_noise8(leds, 2,
1, 0, 1,
1, noiseNum, 20,

(noisenum is a smaller number derived from part of the timestamp.)

Perlin’s distribution is more of a bell curve than uniform. You’ll have to write your own variation of fill noise to account for that for now. (How you account for that is up to you, you could either spread the resulting value out a bit, or you could use a rolling hue shift like fill_2dnoise16 does)

Too bad. Do you know of any other, more even smooth noise functions? If there’s a standard method of doing what I’m doing, I’d rather do that than hack perlin noise into what I want.

You don’t have to hack perlin noise - fill_noise8 is just a wrapper around the noise functions to fill in an array - take a look at the code for it in noise.cpp to see how to use the raw noise functions. Given the nature of how noise functions work, I suspect there isn’t really such a thing as evenly distributed noise functions.

Check out the NoisePlusPalette example. It shows one way of dealing with this, I think: https://github.com/FastLED/FastLED/blob/FastLED3.1/examples/NoisePlusPalette/NoisePlusPalette.ino#L101

Cool, thanks Jason! I already found a set of parameters for fill_noise8() that give me a reasonable mix, but I might try the NoisePlusPalette thing if I get too fed up with my current setup. The micro is acting a bit flaky during upload, though, so I don’t know if I’m willing to risk too many more rewrites.