 #define NUM_LEDS 30 // how many LEDs are used for the display
 #define UPDATE_INTERVAL 100 // time between updates of light strip in ms
 #define DANCE_MOVE_CREATE_INTERVAL 1000 // ms
-#define MAX_DANCE_MOVES NUM_LEDS / (DANCE_MOVE_CREATE_INTERVAL / UPDATE_INTERVAL) + 1 // maximum number of dance moves at one time
+#define MAX_DANCE_MOVES NUM_LEDS / (DANCE_MOVE_CREATE_INTERVAL / UPDATE_INTERVAL) + 2 // maximum number of dance moves at one time (+1 +1 to account for delay)
 #define DANCE_ZONE_LOWER_BOUND 20 // LED 20
 #define DANCE_ZONE_UPPER_BOUND 23 // LED 23
 #define COLOR_MAX 64 // maximum color value (determines brightness)

         if (danceMoveArray[i]->isSteppedOn(RED))
         {
          Serial.println("Stepped on!");
          playNextNoteInSong();  
         }
         break;
       case 2:   // 0 1 0 (green)
         if (danceMoveArray[i]->isSteppedOn(GREEN))
         {
          Serial.println("Stepped on!");
          playNextNoteInSong();    
         }
         break;
       case 1:   // 0 0 1 (blue)
         if (danceMoveArray[i]->isSteppedOn(BLUE))
         {
          Serial.println("Stepped on!");
          playNextNoteInSong(); 
         }
         break;
       case 6:   // 1 1 0 (yellow)
         if (danceMoveArray[i]->isSteppedOn(YELLOW))
         {
          Serial.println("Stepped on!");
          playNextNoteInSong();
         }    
         break;
       case 3:   // 0 1 1 (cyan)
         if (danceMoveArray[i]->isSteppedOn(CYAN))
         {
          Serial.println("Stepped on!");
          playNextNoteInSong(); 
         }       
         break;
       case 5:   // 1 0 1 (magenta)
         if (danceMoveArray[i]->isSteppedOn(MAGENTA))
         {
          Serial.println("Stepped on!");
          playNextNoteInSong();    
         }    
         break;
       default:  // 0 0 0

//const int sensor4pin = 8; // connect the first sensor to pin 8 on the Arduino Mega
//const int sensor5pin = 8; // connect the first sensor to pin 8 on the Arduino Mega

int allSongNotes[7][42] = {
              {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
              },
              {NOTE_C4, NOTE_G3, NOTE_G3, NOTE_A3, NOTE_G3, 0, NOTE_B3, NOTE_C4, 0, 0, 0, 0, 0, 0, 
               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
              }, 
              {NOTE_E4, NOTE_D4, NOTE_C4, NOTE_E4, NOTE_D4, NOTE_C4,
               NOTE_C4, NOTE_C4, NOTE_C4, NOTE_C4,
               NOTE_D4, NOTE_D4, NOTE_D4, NOTE_D4,
               NOTE_E4, NOTE_D4, NOTE_C4, 0, 0, 0, 0, 
               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
               0, 0, 0, 0, 0, 0, 0
              },
              {NOTE_A4, NOTE_A4, NOTE_C5, NOTE_D5, NOTE_F5, NOTE_F5, NOTE_D5, 
               NOTE_C5, NOTE_C5, NOTE_D5, NOTE_C5,
               NOTE_A4, NOTE_A4, NOTE_C5, NOTE_D5, NOTE_F5, 
               NOTE_F5, NOTE_D5,
               NOTE_C5, NOTE_C5, NOTE_D5, NOTE_C5,
               NOTE_C5, NOTE_C5, NOTE_C5, NOTE_A4, NOTE_C5, 
               NOTE_D5, NOTE_D5, NOTE_C5, 
               NOTE_A4, NOTE_A4, NOTE_G4, NOTE_A4, NOTE_C5,
               NOTE_G4, NOTE_A4,
               NOTE_F4, NOTE_F4, NOTE_G4, NOTE_F4, 0
              },  
              {NOTE_C4, NOTE_C4, NOTE_G4, NOTE_G4, NOTE_A4, NOTE_A4, NOTE_G4,
               NOTE_F4, NOTE_F4, NOTE_E4, NOTE_E4, NOTE_D4,
               NOTE_D4, NOTE_C4, 
               NOTE_G4, NOTE_G4, NOTE_F4, NOTE_F4, NOTE_E4, 
               NOTE_E4, NOTE_D4,
               NOTE_G4, NOTE_G4, NOTE_F4, NOTE_F4, NOTE_E4,
               NOTE_E4, NOTE_D4,
               NOTE_C4, NOTE_C4, NOTE_G4, NOTE_G4, NOTE_A4,
               NOTE_A4, NOTE_G4,
               NOTE_F4, NOTE_F4, NOTE_E4, NOTE_E4, NOTE_D4, 
               NOTE_D4, NOTE_C4
              }, 
              {NOTE_C4, NOTE_D4, NOTE_E4, NOTE_F4, NOTE_G4, NOTE_C5, 
               NOTE_A4, NOTE_C5, NOTE_G4,
               NOTE_F4, NOTE_F4, NOTE_G4, NOTE_E4, NOTE_E4, 
               NOTE_D4, NOTE_D4, NOTE_E4, NOTE_C4,
               NOTE_C4, NOTE_D4, NOTE_E4, NOTE_F4, NOTE_G4, 
               NOTE_C5,
               NOTE_A4, NOTE_C5, NOTE_G4,
               NOTE_C5, NOTE_A4, NOTE_G4, NOTE_G4, 
               NOTE_F4, NOTE_E4, NOTE_D4, NOTE_C4, 
               0, 0, 0, 0, 0, 0, 0
               }, 
              { NOTE_E5, NOTE_E5, NOTE_E5, NOTE_C5, NOTE_E5,
                NOTE_G5, NOTE_G4, 
                NOTE_C5, NOTE_G4, NOTE_E4, 
                NOTE_E4, NOTE_A4, NOTE_B4, NOTE_AS4, NOTE_A4, 
                  NOTE_G4, NOTE_E5, NOTE_G5, NOTE_A5, NOTE_F5, 
                NOTE_G5, 
                NOTE_E5, NOTE_C5, NOTE_D5, NOTE_B4, 
                  NOTE_C5, NOTE_G4, NOTE_E4, 
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
              } 
};


int allNoteDurations[7][42] = {
              {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
              },
              {4, 8, 8, 4, 4, 4, 4, 4,
               0, 0, 0, 0, 0, 0, 
               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
              }, 
              {4, 4, 2, 4, 4, 2, 
                             8, 8, 8, 8, 8, 8, 8, 8, 
                             4, 4, 2,
               0, 0, 0, 0, 
               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
               0, 0, 0, 0, 0, 0, 0
              },
              {4, 8, 8, 8, 8, 8, 8, 4, 8, 8, 2, 
               4, 8, 8, 8, 8, 8, 8, 4, 8, 8, 2, 
               4, 4, 4, 8, 8, 4, 4, 2, 
               4, 8, 8, 8, 8, 8, 8, 4, 8, 8, 2,
               0
              },  
              {4, 4, 4, 4, 4, 4, 2, 
                   4, 4, 4, 4, 4, 4, 2, 
               4, 4, 4, 4, 4, 4, 2,
               4, 4, 4, 4, 4, 4, 2,
               4, 4, 4, 4, 4, 4, 2,
               4, 4, 4, 4, 4, 4, 2
              }, 
              {8, 8, 8, 8, 4, 4, 
               4, 4, 2, 
               4, 8, 8, 4, 4, 
               4, 8, 8, 2, 
               8, 8, 8, 8, 4, 4, 
               4, 4, 2,
               4, 8, 8, 8, 4, 
               4, 4, 2,
               0, 0, 0, 0, 0, 0, 0
               }, 
              {8, 4, 4, 8, 4, 
               2, 2, 
               4, 2, 4, 
               8, 4, 4, 8, 4, 
               8, 8, 8, 4, 8, 8, 
               4, 8, 8, 2, 
               4, 4, 4,
               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
              } 
};

int long stepThreshholdRed = 2400;
int long stepThreshholdGreen = 2500;
int long stepThreshholdBlue = 2400;

CapacitiveSensor   cs_green = CapacitiveSensor(4,2);        // 10M resistor between pins 4 & 2, pin 2 is sensor pin, add a wire and or foil if desired
CapacitiveSensor   cs_red = CapacitiveSensor(13, 12);        // 10M resistor between pins 1 & 0, pin 0 is sensor pin, add a wire and or foil if desired
