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

Re: [pygame] Python3 version packaged?



On 21.03.2014 16:58, Michiel Overtoom wrote:
> Thanks for the tip. I was looking around for a cross-platform python midi module which can do output and timestamped input. RtMidi and its python binding looks promising. I'm creating a FretsOnFire/BandHero-like training program, for drums only.

If you try out python-rtmidi, let me know how it goes and whether you
encountered any problems. It is still marked as beta because I haven't
got much feedback from others using it yet, but the API should be
stable, I'm only adding extra functionality in extra Python modules.

There is one oddity about RtMidi and timestamps: incoming events come
with a delta time relative to the time the first event was received
after you opened the input port (the first event has a delta time of
zero). If you use the polling API (MidiIn.get_message()) there's no way
to tell exactly when that first event occured, because it could have
been at any time between when the port was opened and get_message() was
called for the first time. So these delta times are only relative and
you can't really reference them to anything except the other events.

The solution is to use the callback API, because then you'll get the
first event as soon as it appears and you can save this point in time as
a reference.


Chris