     allfreq = 3;
     thisphase += 48;
   }
-  
+
   hue = hue + 1;                                                // Hue rotation is fun for thiswave.
 
   for (int k = 0; k < NUM_LEDS - 1; k++) {                                    // For each of the LED's in the strand, set a brightness based on a wave as follows:

int numberOfSparkles = 1;
int increasing = true;

void confetti() {

  if (patternId == RAINBOW) {
    fadeToBlackBy(leds, NUM_LEDS, 180);
  } else {
    fadeToBlackBy(leds, NUM_LEDS, 200);
  }
  
  if (numberOfSparkles < 80 && increasing) {
    numberOfSparkles += 1;
  } else if (numberOfSparkles > 5) {
    numberOfSparkles -= 1;
    increasing = false;
  } else {
    increasing = true;
    numberOfSparkles += 1;
  }

  int pos;

  if (patternId == RAINBOW) {
    for (int i = 0; i < 20; i++) {
      pos = random16(NUM_LEDS);
      leds[pos] = CHSV(hue, 180, 255);
    }
  }

  for (int i = 0; i < numberOfSparkles * 4; i++) {
    pos = random16(NUM_LEDS);
    if (patternId == RAINBOW) {
      leds[pos] += CHSV(hue, 200, 20);
    } else if (patternId == RAINBOW_2) {
      leds[pos] = CHSV(hue + (pos / 10), 240, 255);
    } else if (patternId == RAINBOW_3) {
      leds[pos] = CHSV(hue, 240, 255);
    }
  }

  if (patternId == RAINBOW_2) {
    hue += 10;
  } else {
    hue = hue + 1;

  if (faderate == 100 || faderate == 200) {
    numdots += 1;
  }

  fadeToBlackBy(leds, NUM_LEDS, faderate);

  for ( int i = 0; i < numdots; i++) {
    for ( int j = 0; j < 20; j++) {
      leds[beatsin16(basebeat + i + numdots, 0, NUM_LEDS - 20) + j] += CHSV(curhue, 240, 255); //beat16 is a FastLED 3.1 function
