Noise + Palette: help test?

Noise + Palette: help test?
This request goes out to folks with a 2-D LED matrix (and a willingness to pull the latest code from github) who are willing to help test a new example program: NoisePlusPalette.

This new example is almost the same as the Noise example, except that instead of creating HSV colors directly from the noise data, this example uses a variety of color palettes to render the noise in different ways, e.g., as lava, or ocean, or rainbows, or black and white stripes, random colors, etc…

This example shows a starting point for what can be done with Noise + Palettes… and there’s lots and lots more beyond that, but as with all these things, sometimes one piece of working example code is worth sixty four theoretical conversations about how such code could work.

Below is a video of the example code running on a 16x16 matrix and a Leonardo clone.

If you have a 2D LED matrix, and you’re willing to grab the latest v2.1 code from github, I’d very much like to hear your feedback:

  1. does it compile and run?
  2. does it work as shown in the video?
  3. is the code somewhat comprehensible as a starting point for understanding how to pipe “noise” data through a “color palette” and into the LEDs?

Thanks in advance for the help if you can give it!

If you just want to read the code, the sketch is here. https://github.com/FastLED/FastLED/blob/FastLED2.1/examples/NoisePlusPalette/NoisePlusPalette.ino

Performance should be roughly comparable to ‘plain’ HSV color renderings of noise, which is to say: reasonably fast.

It might be a few days before I can get to it, but I’ll run it on my 24x24 matrix as soon as I can.

Ideas for further exploration:

  • smooth crossfade between palettes, scales and speeds, instead of jump cuts

  • color palettes generated randomly, but according to “attractive color scheme” rules

  • dynamic zooming, rotating, and/or deformation of the mapping from noise data to LED grid

  • audio/sensor -reactive palette colors

WOW! Did I luck out on timing, getting my matrix wrapped up. This is going to make @Robert_Atkins LED jacket, freakin awesome!

  1. I’m using a slightly stale version of the library but it still compiles fine on my Micro (11,908 bytes).
  2. It’s spot on to the video. The rainbow stripes is jaw-dropping.
  3. I found it quite helpful, yet there are still parts that fly over my head. I learn a lot by tweaking code that already functions; having a baseline to experiment with.

Great- thanks for the feedback, Jon.
And yeah, the rainbow stripes at that scale and speed are a little eye-popping, eh?!

Hi Mark, some answers for you:

  1. yes, tested on IDE 1.0.5r2 + Teensy 3.1
  2. no, it seems to run faster here :wink:
  3. yes, I love your clear structured and well commented code.
    P.S. Palette crossfading would be really awesome! Rotating palettes as well.

And for those not willing to study it themselfs it would be probably helpfull to have a function like ChangePaletteAndSettingsPeriodically(int timeframe) availabe in the core code.
What I often wish for experiments is, that instead of using CRGB(), CHSV() and ColorFromPalette() there would be just one method like CSelectedMappingStyle() where I could define only one parameter to adjust the way it goes for the complete program without the need to rewrite all my functions again and again.

I’ll give it a go on my little demo panel tonight; I’m afraid the Technocolour Dreamcoat is in pieces right now but it will (hopefully) ride again for London Decom the last weekend of October. Looks sweet though :slight_smile:

I’ll give it a crack on a 16x16.

P.S. SetupRandomPalette() is damn cool!

Data point: works great on my 2cm pitch 16 x 8 matrix, powered by the (32u4-based) Blend. Arduino environment 1.0.5. It goes plenty fast too :slight_smile: (actually, it goes significantly faster than it does in the video—the whole cycle is done in about half the time, without me having adjusted any of the constants from what I checked out.)

Forest is a little “bitty” (needs to zoom in further) on my small, not very dense panel, but Ocean looks great; similar but different results from other schemes depending on appropriate zoom levels.

The ‘speed’ and ‘scale’ constants to go with each palette were chosen entirely by trial and error according to one person’s (my) taste. Please tinker and adjust to suit your personal preferences and wishes.

SetupRandomPalette is one example of the kind of thing that can be done with palettes. Basically, describe how you want it to look, write a palette generator in a few lines of code, and POOF your animation has a whole new color scheme. This is part of why I love using color palettes: it largely separates the underlying mechanics of the animation from the color scheme, and let’s me tinker with each one completely independently.

I keep thinking it’d be neat to have do a noise + palette animation where the palette was dynamically generated every N times a second based on audio input and an MSGEQ7. The noise parameters could also be adjusted by audio input, but in this case I’m just thinking about dynamic palette regeneration…

Oh, and I recorded the video with the time-per-palette multiplier set to 2 (instead of 1, which is the default), so if you’re seeing it do the whole loop twice as fast, this is basically expected behavior.

BTW, I recently upgraded to the Teensyduino 1.20, and I cannot get the sketch to compile. There is a long list of compile errors that seem to be SPI based. http://pastebin.com/EGWKzAZE

For the record: No problems with Teensyduino 1.19

Thanks @Jon_Burroughs , @Stefan_Petrick .
Jon: Thanks again for the pastebin of error output above; which example were you compiling when those errors were produced? Do any of the FastLED examples compile and run under Teensyduino 1.20? Or are they all dead in the water like that?
cc: @Daniel_Garcia

@Mark_Kriegsman Error report was for the Palette Noise code you just shared. I will check on some example sketches right now…

Everything appears to be broken, so to speak. Same error report, it appears, for the Fire and Palette example: http://pastebin.com/gy8WnLEU

Thank you for checking. We’ll see what’s up.

Hold the presses, I didn’t have the latest release candidate. I am checking on the status now.