in reply to MIDI time elapsed stat

Well I went and looked at the gnmidi set of utilities, and there is a way to do it, with the free utility mididir.exe. It runs under wine like this:
wine -- mididir.exe -length
That will give a print out like this for each midi file in the directory:
Y:\ZLIG~MY.MID: (33 kb, format 1, 11 tracks, GS, 3:00)
Where the MM::SS is at the end after GS,

Now you have 2 problems, working out a way to translate the crappy 8.3 notation output for the filename to the real filename, and extracting the MM::SS info and probably throwing it in a hash for saving in a database.

Heres an UPDATE: If you go to the free utilities section of gnmidi.com, there is the miditime utility. You can run it on an individual file like this:

#!/usr/bin/perl my $midifile = shift; system("wine -- midifade -songtime $midifile");
and you will get output like this
song: units 0 - 34475 time 0:00.000000 - 2:59.545800
So run it with backticks, and grab the last set of digits.

I'm not really a human, but I play one on earth. flash japh

Replies are listed 'Best First'.
Re^2: MIDI time elapsed stat
by chanio (Priest) on Nov 27, 2004 at 17:18 UTC
    Thank you a lot, zentara! It seems the simplest solution. At least, until I study more about the use of the MIDI.pms.

    I promise to publish a better solution if I am able to find it, some day :).

    .{\('v')/}
    _`(___)' __________________________
    Wherever I lay my KNOPPIX disk, a new FREE LINUX nation could be established.