 #define NOTEOFF 0x80
 #define CHANGEINSTRUMENT 0xC0
 
+#define INSTRUMENT 0x39
+
 // Values for different notes
+// Currently a C scale, starting from middle C (C4)
 int note8 = 0x48;
 int note7 = 0x47;
 int note6 = 0x45;

  // 5 ports, from 0 to 4
  for (int i = 0; i <= LASTPORT; i++) {
    if(analogRead(i) > THRESHOLD) {
      // Beam has been cut
      // i+1 is because i is 0 indexed, but the ID starts with 1
      if (i < 4) {
        musicOn(i + 1);
      } else {
        if (noteSet == 1) {
          noteSet = 2;
        } else {
          noteSet = 1;
        }
      }
    } else {
      // Hand is gone. Stop the sound
      musicOff(i + 1);
    }

  // 0xC0 is the change instrument command
  // 0x39 is the instrument ID in hex
  Serial.write(CHANGEINSTRUMENT);
  Serial.write(INSTRUMENT);
}

// Function for playing note based on ID
