[Media_api] PortMidi
Roger Dannenberg
rbd at cs.cmu.edu
Sat May 12 17:32:17 PDT 2007
> It seems impossible to send other midi events that note and
> control events - tempo events are meta events and require
> more byte, however in PortMidi the event is just a typedef
> of long. Is there a way?
PortMidi is not intended to model higher-level abstractions such as
tempo, tracks, and sequences. You need to translate beats to real time
and then schedule events according to this real time.
I use another library, Allegro, to read/write midi files, but this is
intentionally separated from PortMidi because almost every application
dealing with some kind of sequence wants to define its own data
structures. You are welcome to use it if it will help.
You also will probably need to write some kind of scheduler, e.g. if you
are playing multiple tracks from a midi file, you need to compute when
each track will produce its next message and manage them in some sort of
priority queue so that events are interleaved in the proper time order.
-Roger
More information about the media_api
mailing list