Duration of midi file

Peter McCulloch's icon

Does anybody know a way of finding out the length of a midifile without
having to play through it? (i.e. something akin to sfinfo~ for midi
files)

I'm working on a patch that converts a midi-file to a bitmasked
buffer~. Currently I'm playing through the file in real-time, but it
there's a faster way, it'd be nice...

thanks,

Peter McCulloch

Gary Lee Nelson's icon

I do this with jit.qt.movie. Quicktime reads and plays midi files so you
can read them into jit.qt.movie, ask the right questions, et voila!

Max Patch
Copy patch and select New From Clipboard in Max.

Cheers,
Gary Lee Nelson
TIMARA Department
Oberlin College
www.timara.oberlin.edu/GaryLeeNelson

f.e's icon

Java ? You may use the javax.sound.midiFileFormat class, then request
its microsecondsLength (long) field/property. I'm about to put it in my
MidiConverter object, in order to make it a kind of [mfinfo], for those
who don't own Jitter (as Gar says, you may also use jit.qt.movie for
this...)

f.e

Gary Lee Nelson's icon

Any chance you have a java applet that plays type 1 midi files?

Cheers,
Gary Lee Nelson
TIMARA Department
Oberlin College
www.timara.oberlin.edu/GaryLeeNelson