[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Getting midi events for midi files playing in pygame



On Wed, Oct 27, 2010 at 09:20:49AM -0700, Ivan DelSol wrote:
> I'm writing a visualizer for midi in pygame. Currently, I play a midi
> file in one program and get midi events in pygame via a virtual patch
> cable.
> I'd much rather play the midi file in pygame and receive the events,
> so that the user doesn't have to run a virtual patch program at the
> same time. Is that possible?

Not directly in pygame. Pygame's midi support is based on SDL_mixer 
which gets its midi support form an embedded copy of timidity, so the 
midi events have been rendered to wave data long before python gets 
ahold of it.

But you could certainly play your midi using some other python midi 
package (PyMidi? I dunno) and use pygame for the visualization.

---
James Paige