I finally dug my Yamaha YPG-625 out and was surprised to see that it doesn't have a "real" midi port, just a USB port, so I hooked it up to see if it would do anything under Ubuntu. It came up as /dev/midi2 so I started up lua5.3 and was able to read raw midi data.
Code

a=io.open("/dev/midi2","r")
for j=1,32 do b=a:read(500) t=os.time() for i =1,#b do print (t,j,i,string.format("%x",b:byte(i))) end end

There's a whole bunch of MIDI System Real-Time Messages with 0xf8 and 0xfe so if I don't print those I can see the notes:

for j=1,32 do b=a:read(200) t=os.time() for i =1,#b do d=b:byte(i) if not ((d == 0xf8) or (d==0xfe)) then print (t,j,i,string.format("%x",b:byte(i))) end end end

1559056749	3	186	90
1559056749	3	187	3c
1559056749	3	188	53
1559056749	3	194	90
1559056749	3	195	3c
1559056749	3	196	0



So I thought I'd see if that passport midi would be able to use the keyboard:
Code
./mame64 apple2e -listmidi

MIDI input ports:
Midi Through Port-0 (default)
Portable Grand MIDI 1 

MIDI output ports:
Midi Through Port-0 (default)
Portable Grand MIDI 1 


./mame64 apple2e -sl2 midi -midiin  "Portable Grand MIDI 1" -verbose -flop1 ../../Passport\ designs\ -\ Master\ tracks\ v1.8.dsk 
./mame64 apple2e -sl2 midi -midiin  "Portable Grand MIDI 1" -verbose -flop1 ../../Passport\ designs\ -\ MIDI8\ plus\ v1.2.dsk 
and the software seems to work to record a few notes (first I have to set one of the tracks to REC) but then crashes...