HostTime and the Music Player (was What is HostTime?)
HostTime and the Music Player (was What is HostTime?)
- Subject: HostTime and the Music Player (was What is HostTime?)
- From: Bill Stewart <email@hidden>
- Date: Mon, 3 Feb 2003 17:50:31 -0800
Indeed...
There are a couple of calls that you can look at for doing this kind of
thing...
MusicPlayerGetHostTimeForBeats
MusicPlayerGetBeatsForHostTime
Those calls will do conversions based on the time that you started the
player (you can't look at times before that of course)...
If you are editing the tempo track whilst doing this, that will be
incorrect - a known bug that we planning on fixing for the next release.
The MusicSequence has also a pair of similar calls for converting
to/from host time to beat representations - these calculations are
ALWAYS done with the current tempo track, so adding or removing tempo
events will change the values that are returned from those calls - that
is expected behaviour
Bill
There's On Thursday, January 30, 2003, at 11:50 AM, Vigour Vigour
wrote:
>
I think I got it now, please correct me if I'm wrong.
>
>
HostTime is a timer that starts from zero when my Mac starts. It
>
cannot be set to zero (or anything else), the timer increases until it
>
wraps around. So...
>
>
If I want to make a sequencer I can use it this way:
>
>
When recording the sequence:
>
1 - I set a variable (recordstarttimestamp) to value of HostTime at
>
the moment I press the record button.
>
>
2 - Every time I recieve midi I set the timestamp to
>
HostTime-recordstarttimestamp and save.
>
>
When playing back the sequence:
>
1 - I set a variable (playstarttimestamp) to value of HostTime at the
>
moment I press the play button.
>
>
2 - I send out my midi messages with timestamp set to
>
playstarttimestamp+recorded timestamps.
>
>
Is this the correct method?
>
>
Best regards Peter
>
>
>
> From: "Vigour Vigour" <email@hidden>
>
> To: email@hidden
>
> Subject: What is HostTime?
>
> Date: Thu, 30 Jan 2003 12:00:17 +0000
>
>
>
> Hi!
>
>
>
> I wonder what HostTime really is? Is it a timer that starts ticking
>
> as soon I turn on my Mac and never stop? And a timer that can never
>
> be reset to zero?
>
>
>
> Let us say that I record a sequence of midi bytes. What do I need to
>
> do with the timestamp to be able to play them back later? I mean, the
>
> timestamp that comes in is too old to be usefull in the future so
>
> some kind of calculating (adding) is needed.
>
>
>
> Best regards Peter
>
>
>
> _________________________________________________________________
>
> The new MSN 8: smart spam protection and 2 months FREE*
>
> http://join.msn.com/?page=features/junkmail
>
> _______________________________________________
>
> coreaudio-api mailing list | email@hidden
>
> Help/Unsubscribe/Archives:
>
> http://www.lists.apple.com/mailman/listinfo/coreaudio-api
>
> Do not post admin requests to the list. They will be ignored.
>
>
_________________________________________________________________
>
Help STOP SPAM with the new MSN 8 and get 2 months FREE*
>
http://join.msn.com/?page=features/junkmail
>
_______________________________________________
>
coreaudio-api mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
>
Do not post admin requests to the list. They will be ignored.
>
>
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________
__
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.