Well, I don't know how you're making the connection, you don't say. By 'midi', are you referring to the standard midi cable (which is a serial link), or is USB involved (which is also serial) and how is the serial data established at the PC end, and how is it turned back into 8 bit data at the other end.
If the data is never more than 127, then you're losing a bit somewhere. Bit 7 (of bits 0 to 7) isn't getting through. Assuming it's being sent in the first place?
Geoff
I just send from my PC with Ableton to my Raspberry with serial MIDi.
therefore I used the connection that I send and this Python code.
import serial
ser = serial.Serial('/dev/ttyAMA0', baudrate=38400)
message = [0, 0, 0]
while True:
i = 0
while i < 3:
data = ord(ser.read(1)) # read a byte
if data >> 7 != 0:
i = 0 # status byte! this is the beginning of a midi message!
message[i] = data
i += 1
if i == 2 and message[0] >> 4 == 12: # program change: don't wait for a
message[2] = 0 # third byte: it has only 2 bytes
i = 3
messagetype = message[0] >> 4
messagechannel = (message[0] & 15) + 1
note = message[1] if len(message) > 1 else None
velocity = message[2] if len(message) > 2 else None
if messagetype == 9: # Note on
print 'Note on'
elif messagetype == 8: # Note off
print 'Note off'
elif messagetype == 12: # Program change
print 'Program change'
Thanks in advance
Dominik