Just to note you are really using 2 loops, the ‘for’ loop and the ‘loop’ loop. The more you think of the ‘loop()’ function as nothing special other than a “while” loop, you will be able to use it very effectively to your advantage.
Try the following.
Method 1:
Visualize a box around the LEDs you want to overlap. Those can all be addressed as a “window” around the led counter. e.g., if you are on i = 10 on this loop, then update LEDs 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 (10-5, 10-4, 10-3, 10-2, 10-1, 10, 10+1, 10+2, 10+3, 10+4)
e.g.
leds[i-5]=CHVS(255,0,temp-5);
leds[i-4]=CHVS(255,0,temp-4);
leds[i-3]=CHVS(255,0,temp-3);
…
leds[i+4]=CHVS(255,0,temp+4);
You would need to change “temp+x” to get the effect you want, and again handle boundaries.
Method 2:
Consider triwave8:
“input output 0…127 0…254 (positive slope) 128…255 254…0 (negative slope)”
That sentence is awful, but it is saying that as the input goes from 0-127, the function increases, and from 128-255, the function decreases back to 0. So the brightness will go up and down from 0-255.
led[i] = CHVS(255,0, triwave8(i+x));
x is an integer which always increases at each step, x++. It can overflow as it will go back to 0, and the triwave8 function will handle it properly: triwave8(0) = triwave8(255)
multiplying (i+x) by something will increase the number of waves in the line:
led[i] = CHVS(255,0,triwave8(10*(i+x))
docs and examples:
http://fastled.io/docs/3.1/group__lib8tion.html#gae9e011ff745ade1164ae77b0ef62bfac