Hi, I've added the start of a midi module using portmidi. It's a python module at the moment, and uses the pyportmidi wrapper underneath.
It's in lib/midi.py in subversion control, and once it's finished will be available as pygame.midi Lenard has also added portmidi to the windows prebuilts, so the portmidi dlls are available on windows. I also wrote a little sampler type program to play with the other week, and it seems to get ok latency with my midi controller. I haven't timed the latency, but it seems faster than my qwerty keyboard input for example. I converted the midi input events into pygame events, so it was very simple to use... just like any other pygame input (mouse, keyboard, joystick etc) My next step is to write the bindings for portmidi directly... I was going to try and use pyportmidi, but decided against it. since pyportmidi is written in pyrex, whereas pygame uses C modules. Also pyportmidi hasn't been updated since 2005, and doesn't seem to have wide distribution(eg not in debian, or macports). cheers, On Wed, Dec 17, 2008 at 1:12 PM, Lenard Lindstrom <[email protected]> wrote: > That looks good. test.exe works for me too, except when it is killed > prematurely. It still quits, but gives me an error message as well. Anyway, > I will look at adding portmidi to the Windows dependency build process. I > just need to make sure it is optional. > > Lenard > > René Dudfield wrote: >> >> cool, I'll try out the midi tests some more on the weekend. test.exe >> with option 6 seems to work for me. >> >> yeah, I've used pyportmidi :) I think a few things need to be redone >> though, but maybe I should just use that, and send them patches (or >> point them to the pygame svn). >> >> I've already got code to convert midi events into pygame events... >> which is useful if you want to handle midi events in the same way as >> keyboard/mouse/joystick events. Also did some code to run the midi >> stuff as a background thread, which I think will make it easier for >> people - so they don't need to manage the midi streams themselves. >> >> > > -- > Lenard Lindstrom > <[email protected]> > >
