Help understanding the MIDIUSB library

i just want help understanding how to use the MIDIUSB library so i can utilize it in my latest project.

Have you been here? :

tes i have been there however it dosen't cover MIDI CC messages.

See this thread.

https://forum.arduino.cc/index.php?topic=519031.0

Here's an article I wrote about MIDI on the Arduino. The chapter on USB MIDI isn't finished yet, but once you understand the MIDI protocol, it's really easy to do the same thing over USB using the MIDIUSB library.
Everything you need to know is on pages 16 and 17 of the MIDI USB specification.
As you can see, the last three bytes of the 4-byte USB packet are just the normal MIDI status and data bytes, and the first byte is just the message type again, but shifted 4 bits to the right.

Here's the code I use for my MIDI Controller library:

midiEventPacket_t msg = {m >> 4, m | c, d1, d2};
MidiUSB.sendMIDI(msg);
MidiUSB.flush();

Where m is the message type (0x80 - 0xE0), c the zero-based channel number (0x0-0xF) and d1 and d2 the data bytes (0x00 - 0x7F). If the message only requires 1 data byte, just set d2 to zero, it will be ignored.

Pieter