 
 // Port I/O defines
 #define THRESHOLD 500
-#define LASTPORT 4
+#define LASTPORT 7
 #define BUTTONPORT 2
 
 // MIDI property defines
 #define VOLUME 0x7F
-#define DELAY 10
+#define DELAY 0
 
 // MIDI command defines
 #define NOTEON 0x90

/* Code for laser guzheng
 * Copyright (C) 2016 Jason Lu
 * 
 * Licensed under the MIT License

  for (int i = 0; i <= LASTPORT; i++) {
    if(analogRead(i) > THRESHOLD) {
#ifndef WIND
      if (!(lastNote & (laserArray[i]))) {
#endif
        // Beam has been cut
        // i+1 is because i is 0 indexed, but the ID starts with 1
        musicOn(i + 1);
#ifndef WIND
        lastNote |= (laserArray[i]);
      }
#endif
    } else {
#ifndef WIND
      if ((lastNote & (laserArray[i]))) {
        lastNote &= ~(laserArray[i]);
      }
#endif
      // Hand is gone. Stop the sound
      musicOff(i + 1);
    }
    // Delay 10 to prevent weird analog readings
    delay(DELAY);
  }
}

