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

[pygame] Re: Determining note duration from midi input



Hi Luke

On Apr 2, 11:21 am, Luke Paireepinart <rabidpoob...@xxxxxxxxx> wrote:
> On Fri, Apr 2, 2010 at 3:46 AM, Neilen <nmar...@xxxxxxxxx> wrote:
> > Hi,
>
>
> > Can you create a minimal version of your code and post it to pastebin or
> something?
> I've never used pygame.midi before but I've used midi for a lot of things,
> so I might be able to help.

Thanks!

Code is here: http://pastebin.com/MfB1GgmP

Please excuse the hard coded device numbers, just some rough
experimental code. It is essentially a reduced version of the pygame
examples/midi.py input case. The loop basically checks the pygame
event queue, handles any events and then polls the midi device. Any
midi events found are pushed onto the pygame queue. I (as an
experiment) added the absolute timestamp (variable mt). Would have
been better to include that in the event data for "real" code of
course.

Regards
Neilen

> -Luke