 void musicOn(int ID) {
   switch (ID) {
   case 1:
-    noteOn(0x90, note1, 0x7F);
+    noteOn(NOTEON, note1, VOLUME);
     break;
   case 2:
-    noteOn(0x90, note2, 0x7F);
+    noteOn(NOTEON, note2, VOLUME);
     break;
   case 3:
-    noteOn(0x90, note3, 0x7F);
+    noteOn(NOTEON, note3, VOLUME);
     break;
   case 4:
-    noteOn(0x90, note4, 0x7F);
+    noteOn(NOTEON, note4, VOLUME);
     break;
   case 5:
-    noteOn(0x90, note5, 0x7F);
+    noteOn(NOTEON, note5, VOLUME);
     break;
   case 6:
-    noteOn(0x90, note6, 0x7F);
+    noteOn(NOTEON, note6, VOLUME);
     break;
   case 7:
-    noteOn(0x90, note7, 0x7F);
+    noteOn(NOTEON, note7, VOLUME);
     break;
   case 8:
-    noteOn(0x90, note8, 0x7F);
+    noteOn(NOTEON, note8, VOLUME);
     break;
   default:
-    noteOn(0x80, note1, 0x00);
+    noteOn(NOTEOFF, note1, 0x00);
     break;
   }
 }

 
// Some defines
#define THRESHOLD 700

// Values for different notes
int note8 = 0x68;

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

