WLED - nolanhergert/EasyLED GitHub Wiki
Understanding noise1
Original (from FastLED):
Discourse discussion to update: https://wled.discourse.group/t/improving-noise-effects-at-slow-speeds/3180
- Would like to create a unit test.
- Need to mock the library calls, or just include them directly! Make a WLED fork with unit test runner. Maybe there's a way to simplify the colormap and inoise16 so you can test and debug with easy graphs visually. Mock inoise16 and sin8 as simple passthroughs of f(x) = x?
- Where is existing changes? I think on your fork of WLED...
- Even with the simplest change, I couldn't figure out why it was turning black. At this point, I don't care, as Noise 3 / Noise Pal fit the bill. It's weird. Maybe post to WLED forum?
Chunky shifting at slow speeds
- Truncation
- -O2 optimization doesn't change the chunkiness! Even for code right next to each other!
uint8_t noise = inoise16(real_x, real_y, real_z) >> 8; // get the noise data and scale it down
uint8_t index = sin8(noise * 3); // map LED color based on noise data
- ColorFromPalette only accepting 8 bits. :/ Here's an attempt to extend it: https://wokwi.com/arduino/projects/285170662915441160
- Why the sin8? This makes it even more non-linear and doubly-mapped to boot! (as opposed to just a line)
uint8_t index = sin8(noise * 3);
Other stuff
- Don't understand why inoise16 is used if it's just going to be right shifted 8 at the end (the precision going in isn't needed!).
- Doesn't cause chunkiness, but the 2nd i+SEGLEN (should be j+SEGLEN for 2D arrays) is useless and confusing for 1D strips! Instead of a flat line (slope = 0) advancing by step each time, it's now a diagonal (slope = 1) that also advances only by step each time. It happens in other ways inoise(const, const, i*scale + step) ?!?!
uint8_t index = inoise8(i * SEGLEN, SEGENV.step + i * SEGLEN);
Want the shift for noise 2 and 3 to match what is done for Pride 2015. Super slick slow mo instead of just chunky.
mode_noise16_2, mode_noise16_3, https://github.com/Aircoookie/WLED/blob/e04b9656593818694ec498e710d07660656bcc32/wled00/FX.cpp#L1915
Pride 2015: https://github.com/Aircoookie/WLED/blob/e04b9656593818694ec498e710d07660656bcc32/wled00/FX.cpp#L1658
- SEGMENT.speed: Animation speed
- SEGENV.step: ?? Environment step (ticks since start) (why does it increment it inside the effect?)
- Where does fire/intensity go?
Quirks
- TXD0 is pin 1, and RXD0 is pin 3. Awesome!
- Need to select checkboxes for all segments you want to "copy exact" and then click the settings you want for both segments. (reapplying them if you already did so)