Re: MIDI files and streams

On 3/4/12 4:25 PM, Joe Berkovitz wrote:
> You've sketched the essential functionality that a MIDI API
> needs, minus clutter. As you said, chords, tempo, and all manner of
> other musical concepts can be layered on top easily.

That was the goal.

> Except for one disagreement: I think we should stay away from
> introducing a new MIDI-specific temporal unit (the "tick"). I don't see
> the need to have anything other than seconds.

Seconds are fine. If seconds are used elsewhere in the API then MIDI 
should definitely use seconds. It gets a bit tricky in the 
implementation because one has to maintain the full double precision 
timing in the scheduling buffer. Otherwise messages can get out of order 
when the times are quantized. But better to put the burden on the API 
developer than the user.

Also I forgot to mention that it is very helpful if the system supports 
out of order timestamps. For example one should be able to write:

at time 0.0 write
channel 1, programChange at 1.0 // piano
channel 1, noteOn at 2.0
channel 1, noteOff at 3.0
then rewind the timestamp value and write
channel 2, programChange at 1.0 // violin
channel 2, noteOn at 2.0
channel 2, noteOff at 3.0

This allows processing of tracks individually. It also allows multiple 
music generating threads to share a device without having to sort their 
combined output.

Phil Burk

Received on Monday, 5 March 2012 16:39:01 UTC