@@ -197,8 +197,9 @@ PatternAndNameList patterns = {
197
197
198
198
{ wheel, " Wheel" },
199
199
200
- {fireFibonacci, " Fire Fibonacci" },
201
- {waterFibonacci, " Water Fibonacci" },
200
+ { swirlFibonacci, " Swirl Fibonacci" },
201
+ { fireFibonacci, " Fire Fibonacci" },
202
+ { waterFibonacci, " Water Fibonacci" },
202
203
203
204
{ pacifica_loop, " Pacifica" },
204
205
{ pacifica_fibonacci_loop, " Pacifica Fibonacci" },
@@ -1405,6 +1406,35 @@ void palettetest( CRGB* ledarray, uint16_t numleds, const CRGBPalette16& gCurren
1405
1406
fill_palette ( ledarray, numleds, startindex, (256 / NUM_LEDS) + 1 , gCurrentPalette , 255 , LINEARBLEND);
1406
1407
}
1407
1408
1409
+ void swirlFibonacci () {
1410
+
1411
+ const float z = 2.5 ; // zoom (2.0)
1412
+ const float w = 3.0 ; // number of wings (3)
1413
+ const float p_min = 0.1 ; const float p_max = 2.0 ; // puff up (default: 1.0)
1414
+ const float d_min = 0.1 ; const float d_max = 2.0 ; // dent (default: 0.5)
1415
+ const float s_min = -3.0 ; const float s_max = 2.0 ; // swirl (default: -2.0)
1416
+ const float g_min = 0.1 ; const float g_max = 0.5 ; // glow (default: 0.2)
1417
+ const float b = 240 ; // inverse brightness (240)
1418
+
1419
+ const float p = p_min + beatsin88 (13 *speed) / (float )UINT16_MAX * (p_max - p_min);
1420
+ const float d = d_min + beatsin88 (17 *speed) / (float )UINT16_MAX * (d_max - d_min);
1421
+ const float s = s_min + beatsin88 (7 *speed) / (float )UINT16_MAX * (s_max - s_min);
1422
+ const float g = g_min + beatsin88 (27 *speed) / (float )UINT16_MAX * (g_max - g_min);
1423
+
1424
+ CRGBPalette16 palette ( gGradientPalettes [1 ] ); // es_rivendell_15_gp
1425
+
1426
+ for (uint16_t i = 0 ; i < NUM_LEDS; i++) {
1427
+ float r = physicalToFibonacci[i] / 256.0 * z;
1428
+ float a = (angles[i] + (beat88 (3 *speed)>>3 )) / 256.0 * TWO_PI;
1429
+ float v = r - p + d * sin (w * a + s * r * r);
1430
+ float c = 255 - b * pow (fabs (v), g);
1431
+ if (c < 0 ) c = 0 ;
1432
+ else if (c > 255 ) c = 255 ;
1433
+
1434
+ leds[i] = ColorFromPalette (palette, (uint8_t )c);
1435
+ }
1436
+ }
1437
+
1408
1438
void fireFibonacci () {
1409
1439
for (uint16_t i = 0 ; i < NUM_LEDS; i++) {
1410
1440
uint16_t x = coordsX[i];
0 commit comments