In post #2 I gave a link to a device (out of stock) that will convert USB MIDI to serial.
Once you have serial MIDI, there are many resources that can be Googled to find MIDI serial protocols.
You still need to write your own code to handle MIDI messages even when you have solved the USB to serial problem.
You will do better to plug your keyboard straight into a Windows PC and use PC applications to do all of the clever MIDI things.
Not sure why you would want to connect MIDI keyboard to an MCU.
Once you have serial MIDI, there are many resources that can be Googled to find MIDI serial protocols.
You still need to write your own code to handle MIDI messages even when you have solved the USB to serial problem.
You will do better to plug your keyboard straight into a Windows PC and use PC applications to do all of the clever MIDI things.
Not sure why you would want to connect MIDI keyboard to an MCU.