'midi in" project....

hello
I've been trying for sometime to implement a midi input on Arduino : I'm planning to build a midi module out of the MEGADRIVE (Genesis) sound chip
BUT
I stuck with this midi input...
I made a optocoupler interface no problem, with a 6N138 that seem to receive every midi byte OK but with the code below from Kuk, it sort of work execpt it doen't when you make chords.
It seems that only the first 3 bytes (one note bytes) are seen, which I don't interstand because the program should read all the byte until there is no more in the serial buffer.
how can I use the midi polyphonically ??(excuse my french;-)

thanks for your help