Controlling a Guitar Effect (DigiTech Whammy) with MIDI

I can't see how your first code that you posted does much of anything.

Your second code could be improved by modifying it to use state change detection.

Look in the examples in the digital tab for "statechangedetection". EDIT: USE the code that you got from the "bounce" example and add the state change detection method.

I reformatted your second code to make it easier to read. Make some changes and I will try to help you if you still have trouble.

//Button 1
int ledPin = 12;                      //led output
int buttonPin = 10;                   //button input pin             
int buttonVal = 0;                    //variable for reading the button status
int buttonState = 0;                  //variable to hold the buttons current state
int bounceCheck = 0;                  //variable for debouncing

void setup() {
  pinMode(ledPin, OUTPUT);            //declare LED as output
  pinMode(buttonPin, INPUT);          //declare pushbutton as input
  Serial.begin(31250);                //MIDI communicates at 31250 baud
}

void loop()
{
  ////////////////////////////TOGGLE////////////////////////////////////
  buttonVal = digitalRead(buttonPin);     //read input value from button
  delay(5);                              //wait 10ms
  bounceCheck = digitalRead(buttonPin);   //check again


    if(buttonVal == bounceCheck)
  { //if val is the same then not a bounce
    if (buttonVal == HIGH && buttonState == 1) 
    {    //check if the input is HIGH
      digitalWrite(ledPin, HIGH);         //turn LED OFF
      midiOUT(0xC0, 0, 1);              //Note ON (CH 1), C1, velocity 127
      buttonState = 0;
    }

    if(buttonVal == LOW && buttonState == 0)
    {
      digitalWrite(ledPin, LOW);       //turn LED ON
      midiOUT(0xC0, 0, 0);           //Note ON (CH 1), middle C1, velocity 0
      buttonState = 1;
    }
  }
}
//////////////////////////////////YOUR FUNCTION/////////////
void midiOUT(char command, char value1, char value2)
{
  Serial.print(command);
  Serial.print(value1);
  Serial.print(value2);
}