<!--
{
  "availability" : [
    "iOS: 5.0.0 -",
    "iPadOS: 5.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.5.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AudioToolbox",
  "identifier" : "/documentation/AudioToolbox/MusicSequenceSetSequenceType(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Audio Toolbox"
    ],
    "preciseIdentifier" : "c:@F@MusicSequenceSetSequenceType"
  },
  "title" : "MusicSequenceSetSequenceType(_:_:)"
}
-->

# MusicSequenceSetSequenceType(_:_:)

Sets the sequence type for a music sequence.

```
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 [`MusicSequenceType`](/documentation/AudioToolbox/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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)