I am currently working on producing an AI that will learn from music in midi files and then produce its own music. In order to do this I need to convert a few hundred, perhaps a few thousand in the future, midi files into images so that I can use specific algorithms to train it.
I need to understand the midi hex code to do this, but what I'm confused about is the couple of bytes after a note on or note off sequence. ex:
90 33 49 00 90 44 4b 44 90 3a 49 43 90 3f 49 8d 79
I understand that the "90" means note on, the second byte means the note pitch, the third is the velocity, but I'm not entirely sure about the fourth and/or fifth byte.
I'm assuming that the fourth and fifth byte have something to do with time intervals, because notes played at the same time appear to each have 00 after them so that no time is between them. but then why do some notes have one filled byte after them like with the 2nd and 3rd note I showed, but then the last has two bytes? Also, I thought that 8x was reserved for note endings but that last note says "8d", which I thought would be for channel 14, but the midi files I'm using have only 1 channel (just for piano).
Note: I'm pretty new here so I wasn't sure if this should be in the sound or music stackexchange, and I also don't know all the proper terminology when it comes to electronic music and midi, so any help editing my title or description to make it more clear would be appreciated.