---
title: "MusicSequenceSetSequenceType(_:_:)"
framework: audiotoolbox
role: symbol
role_heading: Function
path: "audiotoolbox/musicsequencesetsequencetype(_:_:)"
---

# MusicSequenceSetSequenceType(_:_:)

Sets the sequence type for a music sequence.

## Declaration

```swift
func MusicSequenceSetSequenceType(_ inSequence: MusicSequence, _ inType: MusicSequenceType) -> OSStatus
```

## 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 doc://com.apple.audiotoolbox/documentation/AudioToolbox/MusicSequenceType. The default sequence type is kMusicSequenceType_Beats.

## Return Value

Return Value A result code.

## Discussion

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

### Managing Music Sequences

- [NewMusicSequence(_:)](audiotoolbox/newmusicsequence(_:).md)
- [DisposeMusicSequence(_:)](audiotoolbox/disposemusicsequence(_:).md)
- [MusicSequenceBarBeatTimeToBeats(_:_:_:)](audiotoolbox/musicsequencebarbeattimetobeats(_:_:_:).md)
- [MusicSequenceBeatsToBarBeatTime(_:_:_:_:)](audiotoolbox/musicsequencebeatstobarbeattime(_:_:_:_:).md)
- [MusicSequenceDisposeTrack(_:_:)](audiotoolbox/musicsequencedisposetrack(_:_:).md)
- [MusicSequenceFileCreate(_:_:_:_:_:)](audiotoolbox/musicsequencefilecreate(_:_:_:_:_:).md)
- [MusicSequenceFileCreateData(_:_:_:_:_:)](audiotoolbox/musicsequencefilecreatedata(_:_:_:_:_:).md)
- [MusicSequenceFileLoad(_:_:_:_:)](audiotoolbox/musicsequencefileload(_:_:_:_:).md)
- [MusicSequenceFileLoadData(_:_:_:_:)](audiotoolbox/musicsequencefileloaddata(_:_:_:_:).md)
- [MusicSequenceGetAUGraph(_:_:)](audiotoolbox/musicsequencegetaugraph(_:_:).md)
- [MusicSequenceGetBeatsForSeconds(_:_:_:)](audiotoolbox/musicsequencegetbeatsforseconds(_:_:_:).md)
- [MusicSequenceGetIndTrack(_:_:_:)](audiotoolbox/musicsequencegetindtrack(_:_:_:).md)
- [MusicSequenceGetInfoDictionary(_:)](audiotoolbox/musicsequencegetinfodictionary(_:).md)
- [MusicSequenceGetSMPTEResolution(_:_:_:)](audiotoolbox/musicsequencegetsmpteresolution(_:_:_:).md)
- [MusicSequenceGetSecondsForBeats(_:_:_:)](audiotoolbox/musicsequencegetsecondsforbeats(_:_:_:).md)
