exit status 1 expected unqualified-id before 'if'

{ #include <Bounce.h> // Bounce library makes button change detection easy
const int channel = (1)
};
Bounce button0 = Bounce(0, 3); // 5 = 5 ms debounce time
Bounce button1 = Bounce(1, 3); // which is appropriate for good
Bounce button2 = Bounce(2, 3); // quality mechanical pushbuttons
Bounce button3 = Bounce(3, 3)
; void setup() {
if pinMode(0, INPUT_PULLUP);
if pinMode(1, INPUT_PULLUP);
if pinMode(2, INPUT_PULLUP);
if pinMode(3, INPUT_PULLUP);
};
void loop() {
if button0.update();
if button1.update();
if button2.update();
if button3.update();
};
// Note On messages when each button is pressed
if (button0.fallingEdge()) {
(48, 99, channel); // 48 = C4
}
if (button1.fallingEdge()) {
(50, 99, channel); // 50 = D4
}
if (button2.fallingEdge()) {
(52, 99, channel); // 52 = E4
}
if (button3.fallingEdge()) {
(53, 99, channel); // 53 = F4
};
//Note Off messages when each button is released
if (button1.risingEdge()) {
(48, 0, channel); // 48 = C4

if (button2.risingEdge()) {
(50, 0, channel); // 50 = D4

if (button3.risingEdge()) {
(52, 0, channel); // 52 = E4

if (button3.risingEdge()) {
(53, 0, channel); // 53 = F4
};

// MIDI Controllers should discard incoming MIDI messages.
while (usbMIDI.read()) {
}
}

Where did you find that code?

It's difficult to see what the intention is.

Maybe work through some of the examples in the IDE?

When I compile, the below is the result.

test:1: error: stray '#' in program
 { #include <Bounce.h>  // Bounce library makes button change detection easy
   ^

test:1: error: expected unqualified-id before '{' token
 { #include <Bounce.h>  // Bounce library makes button change detection easy
 ^

test:4: error: 'Bounce' does not name a type
 Bounce button0 = Bounce(0, 3);  // 5 = 5 ms debounce time
 ^

test:5: error: 'Bounce' does not name a type
 Bounce button1 = Bounce(1, 3);  // which is appropriate for good
 ^

test:6: error: 'Bounce' does not name a type
 Bounce button2 = Bounce(2, 3);  // quality mechanical pushbuttons
 ^

test:7: error: 'Bounce' does not name a type
 Bounce button3 = Bounce(3, 3)
 ^

C:\Users\sterretje\Documents\Arduino\Projects\Forums\test\test.ino: In function 'void setup()':

test:9: error: expected '(' before 'pinMode'
   if pinMode(0, INPUT_PULLUP);
      ^

test:10: error: expected '(' before 'pinMode'
   if pinMode(1, INPUT_PULLUP);
      ^

test:11: error: expected '(' before 'pinMode'
   if pinMode(2, INPUT_PULLUP);
      ^

test:12: error: expected '(' before 'pinMode'
   if pinMode(3, INPUT_PULLUP);
      ^

C:\Users\sterretje\Documents\Arduino\Projects\Forums\test\test.ino: In function 'void loop()':

test:15: error: expected '(' before 'button0'
   if button0.update();
      ^

test:16: error: expected '(' before 'button1'
   if button1.update();
      ^

test:17: error: expected '(' before 'button2'
   if button2.update();
      ^

test:18: error: expected '(' before 'button3'
   if button3.update();
      ^

C:\Users\sterretje\Documents\Arduino\Projects\Forums\test\test.ino: At global scope:

test:21: error: expected unqualified-id before 'if'
 if (button0.fallingEdge()) {
 ^

test:24: error: expected unqualified-id before 'if'
 if (button1.fallingEdge()) {
 ^

test:27: error: expected unqualified-id before 'if'
 if (button2.fallingEdge()) {
 ^

test:30: error: expected unqualified-id before 'if'
 if (button3.fallingEdge()) {
 ^

test:34: error: expected unqualified-id before 'if'
 if (button1.risingEdge()) {
 ^

exit status 1
stray '#' in program

You have far more errors than just the one in the subject line. Start fixing them from the top; e.g. why do you use curly braces on line 1 and 3?

if (button3.risingEdge()) {
(53, 0, channel);  // 53 = F4
};

What's that?

I never cease to be amazed at how many people think they can make up their own syntax, and seem incapable of taking even 30 seconds to Google even the simplest aspects of the language. The code in this thread is close to the worst I've ever seen, with more errors per line than just about any I've ever seen. For God's sake, spend a few hours reading a beginners c/c++ tutorial before trying to write any code and wasting peoples time here....

Regards,
Ray L.