Python MIDI I/O

Discuss music production with Ableton Live.
Post Reply
Jeff Brown
Posts: 85
Joined: Wed Nov 07, 2007 5:18 am

Python MIDI I/O

Post by Jeff Brown » Sun Jul 21, 2013 1:13 am

I want to write a MIDI effect in Python -- something that can listen to my keyboard input, add a harmony*, and output both to Live. All my problems would be solved by a trivially simple piece of example code, one that just adds another note a halfstep up, or transposes its input an octave, or whatever. I could do the rest of it myself -- I can write basic Python but I'm failing to get a handle on MIDI input/output.

I installed PythonMIDI (https://github.com/vishnubob/python-midi/) and not even its own tests would run. I installed portmidizero to discover it requires portmidi; I tried installing portmidi and could not figure it out. I tried PyMIDI but it cannot output MIDI, only input it.

I expect processing the notes to be difficult enough. Does anybody know of an easy way to input and output them?

I use a Mac.

phazed
Posts: 39
Joined: Tue Jun 23, 2009 3:20 pm
Location: Cologne, Germany
Contact:

Re: Python MIDI I/O

Post by phazed » Sun Jul 21, 2013 7:56 am

Try to use

https://pypi.python.org/pypi/python-rtmidi/

It should be installable via pip as long as you have XCode on your machine. You may also want to have a look into the code of a small command line utility that i wrote using this library:

https://github.com/sourcebox/midiutil

Jeff Brown
Posts: 85
Joined: Wed Nov 07, 2007 5:18 am

Re: Python MIDI I/O

Post by Jeff Brown » Sun Jul 21, 2013 3:42 pm

Thank you so much. I hope to try this tonight.

Post Reply