Re: MusicPlayer questions
Re: MusicPlayer questions
- Subject: Re: MusicPlayer questions
- From: Lars Peters <email@hidden>
- Date: Tue, 10 Dec 2002 22:21:13 +0100
I not sure I remember correctly, but I think after my mail took quite a
while to reach the list (don't know why), I simply went for what I saw.
I didn't need to actually change the tempo but didn't feel very good
about assuming undocumented things (I never do).
Yes, you're right though, your answer is what I was looking for. Thanks!
Lars
Am Dienstag, 10.12.02 um 15:12 Uhr schrieb Patrick Beard:
On Thursday, November 7, 2002, at 07:10 PM, Bill Stewart wrote:
On Wednesday, November 6, 2002, at 11:54 AM, Lars Peters wrote:
Hello,
MusicPlayer.h states that MusicTimeStamp depends on the unit the
track has. If so, how can I set the unit?
The unit currently is beats per minute
In case this didn't completely answer your question (it didn't for
me), I'll add here that to set what the current BPM value should be
during playback, you use MusicSequenceGetTempoTrack(), and then call
MusicTrackNewExtendedTempoEvent() to specify at what beat the tempo
should change to. In code:
OSStatus ChangeSequenceTempo(MusicSequence sequence, MusicTimeStamp
when, Float64 beatsPerMinute)
{
OSStatus status;
MusicTrack tempoTrack;
status = MusicSequenceGetTempoTrack(sequence, &tempoTrack);
if (status == noErr)
status = MusicTrackNewExtendedTempoEvent(tempoTrack, when,
beatsPerMinute);
return status;
}
Note that the time this will happen is a function of what the tempo
was at the time this beat occurs, so it's probably a good idea to call
this at time stamp 0 to establish an initial tempo. If this was
already painfully clear to everybody, forgive me for being redundant.
- Patrick
_______________________________________________
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.