Hey Mark, I'm a big fan of your FastLED contributions.

Hey Mark, I’m a big fan of your FastLED contributions. I had a question about your Simplex function for arduino.

I’m having difficulty making a function that produces a fire like noise visualization. When I run the Simplex function with input from millis() I get a monotonically increasing values that then roll over.

Is there a simpler way?

Ideally I’d like to use input from millis() to compute simplex noise. I’m looking for something like:

uint16_t SimplerSimplex(unsigned long in, /* SimplexParameters */);

This would allow m to run 1-D Simplex noise from the millis() clock, which is important for time dependent visualizations that don’t rely on any other state but the clock. This would be super useful!

How can I move forward for something like this?

If this can be done then I will write a minimal demo that prints out the noise values so that others can use this.

Thanks in advance!

Look in noise.h (randomly, I wrote the Simplex functions) for the raw noise functions. There are 1d, 2d, and 3d versions of the noise functions.

You could also just pass millis in for the time value of one of the various fill_noise functions. Given that there are a number of possible parameters to the noise functions, though, what are you using millis for? and with which of the noise functions?

Also it might help you to take a step back and think about what the noise functions are. The noise functions just give you a value, roughly 0-255 for 8 bit noise, or 0-65535 for 16 bit noise, in a 1d, 2d, or 3d space. You can use anything you want for any of those parameters.

The fill functions use the x, y, and time values to compute a noise value in 3d space. For the first led in the fill_noise function, it’s basically calling inoise16(x,y,time); Then, for the next led, it’s inoise16(x+scale,y,time), and so on down the line.

So - for getting a set of noise values from millis, you could just do inoise16(millis()); and that would give you a single noise value each time you called it.

I’m a big fan of the programming style where basically the pattern is a function of time and nothing else; I think of this style as “leds = f(t)”.

And Daniel gets full credit for FastLED’s optimized, fixed-point noise code, which, as far as I can tell, is actually the fastest simplex noise implementation in existence (measuring in points of noise per MHz). Glad you’re digging in and playing with it!

@Daniel_Garcia

Hey Daniel I reduced the code so that all of the assembly has been removed and all the generic versions of each of the code segments was used instead of the optimized assembly.

I’m able to get a noise function however the graph does not look continuous.

I graphed the output for easy reading here:
https://docs.google.com/a/connect.com/spreadsheets/d/1pDDAG9vGmNrDXHe7TLrJj9iZbcOJ8hRQ-RaXpTAiKBE/edit#gid=0

And here is a copy of the reduced which will run server side

Does the graph depict correct behavior?

Thank you very much,
~Zach Vorhies

That looks about right. You’re only graphing about 1.5% of the entire noise space for 1d, 8bit noise - the full graph is here:

http://dgarcia.net/noise-plot.jpg

You aren’t going to have quite as fine a level of granularity/smooth noise as you will have with floating point based noise, however this will run a good 100+ times faster on an 8-bit avr than floating point based noise will. Maybe even faster than that :slight_smile:

Also, the nature of the way the noise calculations are done internally for 8 bit noise, I’m given a value between (roughly) -60 and 60, and that gets spread out to cover a 0-255 range. This means that adjacent noise values are going to be in a range of [-2,2] apart from each other.

If you want the raw -60(ish) to 60(ish) value, then use inoise8_raw. Most folks want to cover the full range from 0-255 for what they map to, so I provide that.

Hello Zach. How you doing my friend? Please text Roland Cellular 1-415-420-1945 voice messaging Texting Paging please no private number follow up calls. Just touching base no worries :slight_smile: Roland

Have a Happy Saint Patrick’s Day Zach my friend :slight_smile: