Re: Finding the duration of a MidiFile
Re: Finding the duration of a MidiFile
- Subject: Re: Finding the duration of a MidiFile
- From: Doug Wyatt <email@hidden>
- Date: Wed, 4 Oct 2006 08:45:05 -0700
On Oct 3, 2006, at 21:20 , Peter Zegelin wrote:
Does CoreAudio have an easy way to determine the duration of a
MidiFile? I am using the MusicPlayer API and cant find anything
relevant.
You can get the length of each track in beats; the length of the
longest track is the file's duration in beats (assuming that the end-
of-track markers are reasonably close to the ends of the last notes).
But there's no simple way to convert that to seconds without either
assuming that the tempo track is trivial (i.e. only has one tempo) or
building a tempo map and doing the math.
--
Doug Wyatt
Core Audio, Apple
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden