Python to send Midi commands to iPad via USB

Chris Angelico rosuav at gmail.com
Thu Jan 24 06:56:42 EST 2013


On Thu, Jan 24, 2013 at 10:48 PM,  <mikprog at gmail.com> wrote:
> Thanks for your help Chris!
> forgive my ignorance, but I am not sure what you mean.
> I've installed pmidi and what I get is:
>
> ~$ pmidi -p 128:0 No.19.mid
> Could not open file No.19.mid
>
> Doesn't that mean that the iPad is not seen?

Heya! That was just an example; I used track number 19 from the opera
"Iolanthe" as my test file. Pick any other MIDI file you have handy.
Though, I may have my commands mixed up; aplaymidi may be more what
you want.

In any case, the key is the port number. Try this to enumerate ports:

$ aplaymidi -l

That's lower-case l for list. If that tells you about something that
looks like your iPad, you're in luck, ALSA has already done most of
the work! And you should be able to play any file with:

$ aplaymidi -p X:Y some-file.mid

where X:Y is from the first column of aplaymidi -l output.

On my system currently, I have 128:0 through 128:3 from TiMidity, and
14:0 "Midi Through". When my USB device is connected, I get a couple
more ports from it.

ChrisA



More information about the Python-list mailing list