Function

MusicSequenceSetSequenceType

Sets the sequence type for a music sequence.

Declaration

OSStatus MusicSequenceSetSequenceType(MusicSequence inSequence, MusicSequenceType inType);

Parameters

inSequence

The music sequence whose sequence type you want to set.

inType

The type of sequence to assign to the music sequence. For the list of available sequence types, see MusicSequenceType. The default sequence type is kMusicSequenceType_Beats.

Return Value

A result code.

Discussion

The sequence type can be set to kMusicSequenceType_Beats at any time. The sequence type can only be set to kMusicSequenceType_Seconds or kMusicSequenceType_Samples if there are no tempo events already in the sequence.

The following considerations pertain to the various sequence types:

  • kMusicSequenceType_Beats—Tempo is specified as beats-per-minute. A music sequence of this type can contain any number of tempo events.

  • kMusicSequenceType_Samples—Tempo is specified as a sample rate, in terms of samples-per-second. If you set the tempo to 44,100 using a sequence of this type, then 44,100 beats corresponds to a duration of one second.

  • kMusicSequenceType_Seconds—The tempo should be set to 60; a beat is a second.

After setting a music sequence to the kMusicSequenceType_Samples or kMusicSequenceType_Seconds type, add a single tempo event to specify the tempo.

A meta event of interest for the kMusicSequenceType_Seconds sequence type is the SMPTE Offset meta event, which is stored in the tempo track. The sequence doesn't do anything with this event.

See Also