Hello,
Thanks for the bit of extra info.
Firstly, looking at your code, please note that NORMAL midi is NOT at 38,400 - it;s actually at 31.25 Khz. If your input is NORMAL midi, then this may give rise to some problem. Maybe you're using a non-standard link, which uses the standard serial bps. Your little circuit diag though suggests a normal midi connector.
Secondly, please note the previous comment about signed/unsigned numbers, which could VERY well be your problem.
In your prog, how is 'data' defined? Come compilers will default an int and a char to signed, which may lose you the top bit. Can you define your variables as 'unsigned' to make sure. If 'data' is 'int' then this will be less of a problem, but for the data, it should be 'char' (1 byte) in which case it MUST be 'unsigned'. And, connected with this, what does 'ser.read(1)' return.
Also, not clear if your prog will take account of running status. Maybe it could, but that as prev poster notes, the data will NOT show status bytes as running status assumes a repeat of a previous one.
Geoff