Fastled: inoise8(i) returns a constant value of 128 from i = 3061 to 3599

Created on 15 Nov 2020  路  3Comments  路  Source: FastLED/FastLED

This seems to be a strange one, reported by djbog (Scott Marley, @s-marley ) in the reddit group. I ran my own test (on an UNO) and got the same results.

When running inoise8(i) it returns a constant value of 128 from the range of i = 3061 to 3599.

for(uint16_t i = 0; i < 5000; i++) {
  Serial.print(i);
  Serial.print(", \t");
  Serial.println(inoise8(i));
}

Here is Scott's reddit post with a plot that shows the "flat" in the otherwise nice curvey output.
https://www.reddit.com/r/FastLED/comments/ju7ams/something_i_dont_understand_with_inoise8x_output/

Any ideas why it would do this?

meyg1h5s79z51

Most helpful comment

Hrm. Interesting. Thank you for the issue report here and the _really_ useful graph.

I'll assign this to myself and queue it up to take a look. I suspect it's a loss-of-precision issue somewhere in the math.

All 3 comments

Hrm. Interesting. Thank you for the issue report here and the _really_ useful graph.

I'll assign this to myself and queue it up to take a look. I suspect it's a loss-of-precision issue somewhere in the math.

Do we know if both examples were run on the same processor/architecture? It would be interesting to test on a couple different ones to see if it makes any difference. I should have a M4 and esp32 I can try it on. I'll report back.

plot

Looks to be the same on ESP32 using arduino 1.8.13 and FastLED 3.3.3

Was this page helpful?
0 / 5 - 0 ratings