How to use Python to generate real-time midi signal and output it to midi device?

1.8k Views Asked by At

I've been working on a project of MIDI. The aim is to input parameters to Python and base on these inputs to generate correspond MIDI signal then output from my Mac to other MIDI device.

After a survey, I know there are two libraries exist which might meet my requirement, which are MIDIutil and pygame.

However, MIDIutil seems only output the midi file, and not able to output the real-time signal. On the other hand, Pygame is a real pain of Mac Mountain Lion user. I have working on it for 1 week and still stuck at same stage. (Unable to initial midi, the log constantly shows unable to find "pypm" module. What is pypm module?), I've tried to find solution on google, non of them able to solve the problem I faced.

As a result, I would like to ask if there is any other library recommended that might suit my requirement?

I'm using Mountain Lion 10.8.4 with python 2.7(original from Mac)

Thank you very much.

James

1

There are 1 best solutions below

1
Arru On

Python-RTMIDI is in alpha stages (haven't tried it yet myself, but it's my primary choice for an upcoming hardware synth editor project) It's a C++ Python extension, so it might not be painless to setup but then you get CoreMIDI as well as optional JACK support, might be worth your while.