in reply to MIDI time elapsed stat

I've always wanted to figure this out using pure perl, so here it is. See Midi Playlength calculator.

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 29, 2004 at 05:07 UTC
    You're the best!

    Perhaps it might help to also read this tip that I found yesterday.

    I can't judge your recent code until I study a little more about Midi. I've also got the MIDI.PM family. And I guess that most might be obtained with MIDI::Score. But it's all my guessing.

    Besides, I managed to use Midifade by providing a Win-DOS short midi filename (but keeping also the long filename). I used dir /X instead of opendir. Then, some splitting whitespaces would provide both: short and long filename to do all the job.

    I had some complains, I guess, with the speed of the qx commands but I have overcome that difficult part.

    Anyway, I am interested in studying a bit more about handling MIDI files and your code would be of great help.

    Lot's of thanks, zentara!

    .{\('v')/}
    _`(___)' __________________________
    Wherever I lay my KNOPPIX disk, a new FREE LINUX nation could be established.
      Yes, I have the information from your tip, but just couldn't seem to "get my head around it". :-) I tried testing on midi files ranging from 96 ticks/qn to 480 ticks/qn, and could only get good results with perl if I used a different equation for each range...sort of a lookup table. However, the gnmidi utility was always correct, and the various midi players also report correct time. The gnmidi source is not open source, so I can't see what he does, but I may look at the open source midi players, and see how they compute it in C. It's got to be a simple equation, yet it's implementation eludes me. :-(

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