MIDI in problem

As you haven't posted the code it is hard to say but MIDI consists of messages, each message is more than one byte. You have to synchronise the receiving stream so that you know that the byte you are looking at is the first one in the message.

The code in this project shows you haw it is done.
http://www.thebox.myzen.co.uk/Hardware/Glockenspiel.html