• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: MusicPlayer questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MusicPlayer questions


  • Subject: Re: MusicPlayer questions
  • From: email@hidden (Patrick Beard)
  • Date: Tue, 10 Dec 2002 06:12:05 -0800

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.

  • Follow-Ups:
    • Re: MusicPlayer questions
      • From: Lars Peters <email@hidden>
    • Sequencer Sample Java Code
      • From: email@hidden (Patrick Beard)
  • Prev by Date: Re: Live mixing; how does CA do it smoothly?
  • Next by Date: Sequencer Sample Java Code
  • Previous by thread: Re: multi-track sequencing with MusicPlayer
  • Next by thread: Sequencer Sample Java Code
  • Index(es):
    • Date
    • Thread