continuous note on midi

hi everybody i'm new in arduino programming.
i want to tell you how to make a continuous note on midi because in the arduino examples they send a note on and then a note off but: if i want to press a button and i want that it send a midi on as long as i hold the button what code i've to write?

thanks a lot XD

Read the button.
When it is pressed send the midi note on code.
Keep reading the button until it is released then send the midi note off code.

Do you know how to read the state of a button ? Examples are available in the IDE.
Do you know how to send the midi note commands ? You have found code that does this.

yes i know how read the button and i know how send note on command.
but if i send every cycle a note on command the note on my synth sound like bip...bip....bip... and not a continuos biiip.
sorry for my explanation.

Only send the note on when the button changes from not pressed to,pressed.
Send a midi note off message when the button changes from pressed to not pressed.

stevelord:
yes i know how read the button and i know how send note on command.
but if i send every cycle a note on command the note on my synth sound like bip...bip....bip... and not a continuos biiip.
sorry for my explanation.

That has clarified the problem and Mike has given you the solution. You may find the StateChangeDetection example in the IDE helpful in implementing that solution.