 #define DISCO_TWIRL 7
 #define NIGHT_SPARKLES 8
 
-int maxPatternId = 8;
-int rotationInMillseconds = 20000; // 20 seconds for production
-
-// Either A)
+int maxPatternId = 7;
+int rotationInMillseconds = 20000; // 20 seconds for production¡
+
 //bool holdPattern = true;
 //int patternId = PARTY;
-// OR B)
 bool holdPattern = false;
 int patternId = BEAUTIFUL_SPARKLES;
 

      partySeedDirection = true;
    }
  }
  EVERY_N_MILLISECONDS(500) {
    hue += 33;
  }
  fadeToBlackBy(leds, NUM_LEDS, 80);
  int brightness = 255;
  int saturation = 200;
  int pos = random(partySeed - partySeedLength, partySeed + partySeedLength);
  
  for (int i = pos; i <= pos + 50; i++) {
    brightness *= 0.97;
    if (i < NUM_LEDS && i > 0) {
      leds[i] = CHSV(hue, saturation, brightness);
    }
  }
  brightness = 255;
  saturation = 255;
  for (int j = pos; j >= pos - 50; j--) {
    brightness *= 0.97;
    if (j < NUM_LEDS && j > 0) {
      leds[j] = CHSV(hue, saturation, brightness);
    }
  }
}

uint8_t thishue = 0;                                          // You can change the starting hue value for the first wave.
uint8_t thisrot = 0;                                          // You can change how quickly the hue rotates for this wave. Currently 0.
uint8_t allsat = 255;                                         // I like 'em fully saturated with colour.
bool thisdir = 1;                                             // You can change direction.
int8_t thisspeed = 48;                                         // You can change the speed, and use negative values.
uint8_t allfreq = 32;                                         // You can change the frequency, thus overall width of bars.
int thisphase = 0;                                            // Phase change value gets calculated.
uint8_t thiscutoff = 200;                                     // You can change the cutoff value to display this wave. Lower value = longer wave.

void discoTwirl() {


    thisspeed = 48;                                         // You can change the speed, and use negative values.
    allfreq = 32;                                         // You can change the frequency, thus overall width of bars.
    thisphase = 0;                                            // Phase change value gets calculated.
    thiscutoff = 200;

  } else {
    EVERY_N_MILLISECONDS(5) {
      if (fadeUp) {
        fade += 10;
      } else {
        fade -= 10;
      }

      if (fade < 50) {
        fadeUp = 1;
      } else if (fade > 140) {
        fadeUp = 0;
      }
//      allfreq += 1;
//      if (allfreq == 255) {
//        allfreq = 0;
//      }
    }
  }

  if (thisdir == 0) thisphase+=thisspeed; else thisphase-=thisspeed;          // You can change direction and speed individually.
//  thisphase += thisspeed;
//  thishue += thisrot;                                                         // Hue rotation is fun for thiswave.
fadeToBlackBy(leds, NUM_LEDS, fade);
  for (int k=0; k<NUM_LEDS-1; k++) {
    int thisbright = qsubd(cubicwave8((k*-allfreq)+thisphase), thiscutoff);      // qsub sets a minimum value called thiscutoff. If < thiscutoff, then bright = 0. Otherwise, bright = 128 (as defined in qsub)..
//    leds[k] = CHSV(0, 255, 0);
    leds[k] += CHSV(thishue + k + thisphase / 5, allsat, thisbright);                               // Assigning hues and brightness to the led array.
  }
}
