[jmsl] writing work to a midi file

jmsl at music.columbia.edu jmsl at music.columbia.edu
Tue Jul 15 17:25:09 EDT 2008


I'm going to be asking some pretty general questions for a bit, while  
I work on the basic design of my app.

This time I'm curious about midi file IO. I don't see any methods  
which allow MusicShapes to be entered directly into midi files, so I'm  
assuming we'd do something like this:

1) iterate over elements in a given MusicShape
2) get midi-compatible dimensions and create new MIDIFileEvents or  
MIDIFileMetaEvents for them
3) add the MIDI events created in 2) to a new MIDIFileTrack
4) add the track from 3) to a MIDIFileImage
5) write the image from 4) to a midi file

Sound about right? The only thing I'm not sure about is figuring out  
the proper time for the events when creating midi tracks, since the  
MusicShape holds events in seconds, while the midi tracks will hold  
them in ticks...

J.


More information about the jmsl mailing list