but notes are executed randomly,
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
Sounds like a floating input to me.How are the switches wired up?The correct way to wire up a switch / push button is between the input and ground. The enable the internal pull up resistors with a Code: [Select]pinMode(pin,INPUT_PULLUP);call in the setup function.
I follow the model of the echanter.com page.