NEED SOME HELP ON "sendeMIDI"

That function is stand alone and nothing more is needed.
However it only sends three byte MIDI messages, there are also two byte and one byte messages.

Midi uses 16 channels, and with a three byte message the least significant four bits of the first byte of the message is the channel number. The most significant four bits is the action or what it does.

You can get a summary of the MIdI messages here:-
https://www.midi.org/specifications-old/item/table-1-summary-of-midi-message

There is a lot more to MIDI and I spend almost two thirds of my book explaining and exploring it. I would recommend it, but then I would wouldn’t I.

https://www.apress.com/gb/book/9781484217207