Advertisement
atuline

2D sketches from soulmate

Oct 21st, 2021
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.36 KB | None | 0 0
  1.  
  2. Issues:
  3.  
  4. Flowstripe crashes when speed = 0 and when intensity = 0.
  5. 2D Drift, speed is reversed.
  6. 2D matrix could do with intensity.
  7.  
  8.  
  9.  
  10.  
  11. https://editor.soulmatelights.com/gallery
  12. https://wokwi.com/arduino/projects/___top_secret/library:FastLED
  13. https://wokwi.com/arduino/projects/___top_secret/part:wokwi-led-ring
  14.  
  15. https://www.soulmatelights.com/blog/1-drawing-a-line
  16.  
  17.  
  18.  
  19. sutaburosu ( https://wokwi.com/makers/sutaburosu )
  20.  
  21.  
  22. kriegsman ( https://gist.github.com/kriegsman )
  23.  
  24. * https://gist.github.com/kriegsman/5adca44e14ad025e6d3b (swirl) Intensity is blur, speed is magnfiication. Make 2 animations, one without sound.
  25.  
  26.  
  27. ldirko ( https://wokwi.com/makers/ldirko )
  28.  
  29. D* 2Ddna, update controls, intensity is blurring.
  30. D* 2DLissajous, speed controls phase, intensity controls blur.
  31. D*- https://editor.soulmatelights.com/gallery/819-colored-bursts (includes a drawline). Good. No sound.
  32. D* https://editor.soulmatelights.com/gallery/512-dna-spiral-variation (a variation. Could even add noise). Good. No sound.
  33. D* https://editor.soulmatelights.com/gallery/392-flow-led-stripe (1D effect) Speed, intensity.
  34. D* https://editor.soulmatelights.com/gallery/810 (rgb hiphotic) OK. Good. Speed, intensity.
  35. x https://editor.soulmatelights.com/gallery/880-pattern-trick Meh, but short. Just speed.
  36. D* https://editor.soulmatelights.com/gallery/878-pulse-test Good. Speed only.
  37. Dx https://editor.soulmatelights.com/gallery/430-rainbow-flicker (1D effect) A short fade-in/out with no controls.
  38. D* https://editor.soulmatelights.com/gallery/597-sin-dots OK. Speed, intensity.
  39. D() https://editor.soulmatelights.com/gallery/599-sun-radiation Too big for a Nano, and lots of subroutines.
  40. D*- https://editor.soulmatelights.com/gallery/921-twister-test OK. Speed, intensity.
  41.  
  42.  
  43.  
  44. Stepko ( https://wokwi.com/makers/stepko )
  45. D* https://editor.soulmatelights.com/gallery/640-color-frizzles Short and good. Speed, intensity.
  46. D*- https://editor.soulmatelights.com/gallery/884-drift Great. Speed, intensity
  47. D* https://editor.soulmatelights.com/gallery/659-plasm-ball Great. Speed
  48. D* https://editor.soulmatelights.com/gallery/517-poolnoise OK
  49. D** https://editor.soulmatelights.com/gallery/737-swirl OK. Speed, intensity and sound.
  50. x? https://editor.soulmatelights.com/gallery/671-tixyland (tixyland - multiple effects). No controls.
  51. D** https://editor.soulmatelights.com/gallery/652-wave OK. Use with and without sound. Speed controls and instensity. Try Avg. Looks great.
  52.  
  53. Elliott Kember
  54.  
  55. D* https://editor.soulmatelights.com/gallery/3-tartan Good. Speed, intensity.
  56.  
  57. Konstantyn
  58.  
  59. D* https://editor.soulmatelights.com/gallery/762-polar-lights Good, speed, intensity, palette with fft1.
  60.  
  61.  
  62. In order to convert:
  63.  
  64. - Use a starting template with an XY() routine.
  65. - Import code.
  66. - Change ROWS/COLS variables to matrixHeight/matrixWidth.
  67. - Test 4x64, 16x16.
  68. - Review/convert/fix variable types.
  69. - Ensure it doesn't overflow SEGLEN-1. Some routines do, and that needs to be fixed.
  70. - Go through it all again. . . and cull any redundant routines.
  71.  
  72.  
  73. Initial import complete.
  74.  
  75. - Review drawline functions for consistency. Don't want 10 of them.
  76. - Add palette support.
  77. - Consider controls.
  78.  
  79.  
  80. - Add to WLED (FX.cpp, FX.h)
  81. - Change variables to support WLED ones.
  82. - Ensure it supports segments, i.e. no use of EVERY_N_MILLIS().
  83. - Possibly use NeoPixelBus LED assignment.
  84. - Review/add controls.
  85. - Document it all.
  86.  
  87.  
  88.  
  89. Common routines
  90.  
  91. drawPixelXYF (stepko|drift)
  92. mydrawLine (ldirko|coloredbursts) (ldirko|twister)
  93.  
  94.  
  95. CRGBPalette16 currentPalette = PartyColors_p;
  96. leds[XY(x, y)] = ColorFromPalette(currentPalette, index, bright, LINEARBLEND);
  97.  
  98.  
  99.  
  100.  
  101. #include <FastLED.h>
  102.  
  103. #define LED_PIN 12
  104.  
  105. #define matrixWidth 16
  106. #define matrixHeight 16
  107. #define SEGLEN (matrixWidth*matrixHeight)
  108. #define matrixSerpentineLayout true
  109.  
  110. CRGB leds[SEGLEN];
  111. CRGBPalette16 currentPalette = PartyColors_p;
  112.  
  113.  
  114. void setup() {
  115. delay(1000);
  116. Serial.begin(115200);
  117. FastLED.addLeds<WS2812, LED_PIN, GRB>(leds, SEGLEN);
  118. FastLED.setBrightness(64);
  119. } // setup()
  120.  
  121.  
  122. WLED variables
  123.  
  124. SEGLEN, SEGMENT.intensity, SEGMENT.speed, SEGMENT.fft1, SEGMENT.fft2, SEGMENT.fft3
  125. FFT_MajorPeak, FFT_Magnitude, fftResult[]
  126. sample, samplePeak, sampleAgc, sampleAvg -> tempsamp
  127. SEGENV.aux0, SEGENV.aux1 (uint16_t), call
  128.  
  129.  
  130. Easiest routines to port
  131.  
  132. Don't use multiple subroutines.
  133. Minimize static variables (up to 2 uint16_t).
  134. Absolutely no delay statements.
  135.  
  136.  
  137.  
  138. setPixelColor(pixloc, color_blend(SEGCOLOR(1), color_from_palette(pixloc%255, false, PALETTE_SOLID_WRAP, 0), 255));
  139.  
  140.  
  141. setPixelColor(__location, color_blend(SEGCOLOR(1), color_from_palette(__index, false, PALETTE_SOLID_WRAP, 0), __brightness));
  142.  
  143.  
  144. setPixelColor(i, color);
  145.  
  146.  
  147.  
  148. CRGB newcolor = CHSV( hue8, sat8, bri8);
  149. fastled_col = col_to_crgb(getPixelColor(i));
  150. nblend(fastled_col, newcolor, 64);
  151. setPixelColor(i, fastled_col.red, fastled_col.green, fastled_col.blue);
  152.  
  153.  
  154. setPixelColor( i, getPixelColor( i - 1));
  155.  
  156. uint32_t ctemp = getPixelColor(0);
  157. setPixelColor(SEGLEN -1, ctemp);
  158.  
  159.  
  160.  
  161.  
  162. We've been busy with our sound reactive fork of WLED lately, with a number of 2D animations being added to our ESP32 based 'dev' branch.
  163.  
  164. These animations are thanks to the folks on wokwi.com and soulmatelights.com with their very cool FastLED emulator. Most of the animations are from ldirko and Stepko, who've done some amazing work and with very short code at that. We managed to port many of their animations over to WLED and have added speed/intensity controls to most of them. Our Wiki will be updated with more information on the new animations.
  165.  
  166. As a result, our ESP32 based sound reactive fork of WLED now has 172 1D, 2D, volume and frequency reactive animations. We'll continue to test these new animations over the coming month for any outstanding issues.
  167.  
  168. Andrew has also ordered a 241 LED in a ring form factor and hopes to implement future WLED animations based on these.
  169.  
  170.  
  171.  
  172.  
  173. "2D CA Elementary",
  174. "2D Colored Bursts",
  175. "2D DNASpiral",
  176. "2D Drift",
  177. "2D Frizzles",
  178. "2D Hiphotic",
  179. "2D Lissajous",
  180. "2D Plasma Ball",
  181. "2D Polar Lights",
  182. "2D Poolnoise",
  183. "2D Pulser",
  184. "2D Sindots",
  185.  
  186. "2D Sun radiation"
  187. "2D Tartan",
  188. "2D Twister",
  189.  
  190.  
  191. "Flow Stripe",
  192. "* 2D Waverly",
  193. "* 2D Swirl",
  194. "** Blurz",
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement