 
 /*
   Send register address to this function and it returns byte value
-  for the magnetometer register's contents
-*/
+ for the magnetometer register's contents
+ */
 byte Readi2cRegisters(int numberbytes, byte command)
 {
   byte i = 0;

    if ((redMatch == true) && (blueMatch == true) && (greenMatch = true))
    {
      Serial.println(colorary[y]);
      switchnum = y;
      break;
    }
    switch(switchnum)
    {
      case 0:
      playNote("C", 4, 300);
      break;
      case 1:
      playNote("D", 4, 300);
      break;
      case 2:
      playNote("E", 4, 300);
      break;
      case 3: 
      playNote("F", 4, 300);
      break;
      case 4:
      playNote("G", 4, 300);
      break;
      case 5:
      playNote("A", 4, 300);
      break;
      case 6:
      playNote("B", 4, 300);   
      break;
    }
  }
}

String notes[] = {"C","C#","D","D#","E","F","F#","G","G#","A","A#","B"};
int index;

void noteOn(byte channel, byte pitch, byte velocity) {
  MIDIEvent noteOn = {0x09, 0x90 | channel, pitch, velocity};
  MIDIUSB.write(noteOn);
}

void noteOff(byte channel, byte pitch, byte velocity) {
  MIDIEvent noteOff = {0x08, 0x80 | channel, pitch, velocity};
  MIDIUSB.write(noteOff);
}


  // Basic RGB color differentiation can be accomplished by comparing the values and the largest reading will be
  // the prominent color


  const int sizeRow = 9; // RGB
  const int sizeCol = 3; // nine colors
  int constanterror = 5000;
  bool redMatch = false;
  bool greenMatch = false;
  bool blueMatch = false;
  long int ary[sizeRow][sizeCol] =
  { 
    {
      19000, 12200, 5500            }
    , // red
    {
      12000, 6800, 3750            }
    , // orange
    {
      35000, 38700, 15150            }
    , // yellow
    {
      6700, 15700, 7800            }
    , // green
    {
      6050, 1000, 10200            }
    , // blue
    {
      11000, 12500, 10900            }
    , // indigo
    {
      5200, 4900, 5100            }
    , // violet
    {
      200, 120, 55            }
    , // black
    {
      44000, 53100, 34200            } // white
  }; 
  String colorary [9] = {
    "red", "orange", "yellow", "green", "blue", "indigo", "violet", "black", "white"      };
  for (int y = 0; y < 9; y++)
  {
    if ((red_color < (ary[0][y] + constanterror)) && (red_color > (ary[0][y] - constanterror)))
