Usually, there's not a lot that you need to do with midi. It's just the data that devices send to each other, and the devices take care of most things..
It would be helpful if you said more about what you're thinking of doing (programming) that would involve midi.
Otherwise, there are documents that you can get via this web site that might be a help. The best thing would be to get the detailed specification for Midi Files, and then start with programs that either manipulate existing midi files, or create new ones. You would be able to find various examples of such software, in various languages, to download via the web. Then study the contents of existing midi files to understand how they work.
Regarding the programming, which language were you thinking of using?
Geoff