Send MIDI messages to a synthesizer

That code is really difficult to read with loads of statements all on a single line. Why do you define all those global b2,b3 etc.variables and then define new versions of them all inside loop()?

Some idea of what hardware you're using would be helpful. But if you're using Serial to write the MIDI via a standard MIDI Out circuit and 5-pin DIN cable to a synth or similar then it should be Serial.begin(31250). That's the standard rate that MIDI always works at.

I have no idea if the button combinations are correct but it looks as if it should do something. Since you don't have any equivalent of breath control presumably it is permanently playing one note or another. I guess this is just an early test is it?

Steve