Re: MIDI Delta-Time to milliseconds?
[email protected] ("Sean M. Burke") Tue, 19 Oct 2004 12:35:19 -0800
| Newsgroups | perl.midi |
|---|---|
| Message-ID | <[email protected]> |
At 03:53 AM 2004-10-19, Christian Renz wrote: >I'm having difficulties to find an exact definition of "MIDI delta time" >as used in standard MIDI files. How can I convert these delta times to >milliseconds; do I need to factor in any other control messages/SMPTE >settings/.... ? What I remember is this: If I want one quarter-note (96 delta-time units) to be a half-second, I start a MIDI::Simple program with this: set_tempo 500000; # 1 qn => .5 seconds (500,000 microseconds) As to what complexity this avoids? I think the conversion of ticks to actual real time involves the Ticks parameter in the MIDI header, and the current set_tempo value. I don't think the time-signature in involved, but I can't swear to that. And there could even be another level of indirection lurking in the MIDI spec somewhere; my memory is hazy, and hopefully someone else knows. An additional caveat: I once made a MIDI version of John Cage's /4'33"/, a piece which, as the title expresses, should really last exactly four minutes and thirty-three seconds. But I distinctly remember getting a piece of email (although only one) from someone whose MIDI player said it was a different length, like five minutes ten seconds. So, buggy MIDI players have existed! But that was ages ago, and I've never heard anything like that since, so hopefully you won't run into anything like that these days. -- Sean M. Burke http://search.cpan.org/~sburke/