<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFAudio",
  "identifier" : "/documentation/AVFAudio/AVMusicTrack",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "AVFAudio"
    ],
    "preciseIdentifier" : "c:objc(cs)AVMusicTrack"
  },
  "title" : "AVMusicTrack"
}
-->

# AVMusicTrack

A collection of music events that you can offset, set to a muted state, modify independently from other track events, and send to a specified destination.

```
class AVMusicTrack
```

## Topics

### Configuring Music Track Properties

[`isMuted`](/documentation/AVFAudio/AVMusicTrack/isMuted)

A Boolean value that indicates whether the track is in a muted state.

[`isSoloed`](/documentation/AVFAudio/AVMusicTrack/isSoloed)

A Boolean value that indicates whether the track is in a soloed state.

[`offsetTime`](/documentation/AVFAudio/AVMusicTrack/offsetTime)

The offset of the track’s start time, in beats.

[`timeResolution`](/documentation/AVFAudio/AVMusicTrack/timeResolution)

The time resolution value for the sequence, in ticks (pulses) per quarter note.

[`usesAutomatedParameters`](/documentation/AVFAudio/AVMusicTrack/usesAutomatedParameters)

A Boolean value that indicates whether the track is an automation track.

### Configuring the Track Duration

[`lengthInBeats`](/documentation/AVFAudio/AVMusicTrack/lengthInBeats)

The total duration of the track, in beats.

[`lengthInSeconds`](/documentation/AVFAudio/AVMusicTrack/lengthInSeconds)

The total duration of the track, in seconds.

### Configuring the Track Destinations

[`destinationAudioUnit`](/documentation/AVFAudio/AVMusicTrack/destinationAudioUnit)

The audio unit that receives the track’s events.

[`destinationMIDIEndpoint`](/documentation/AVFAudio/AVMusicTrack/destinationMIDIEndpoint)

The MIDI endpoint you specify as the track’s target.

### Configuring the Looping State

[`isLoopingEnabled`](/documentation/AVFAudio/AVMusicTrack/isLoopingEnabled)

A Boolean value that indicates whether the track is in a looping state.

[`loopRange`](/documentation/AVFAudio/AVMusicTrack/loopRange)

The timestamp range for the loop, in beats.

[`numberOfLoops`](/documentation/AVFAudio/AVMusicTrack/numberOfLoops)

The number of times the track’s loop repeats.

### Adding and Clearing Events

[`addEvent(_:at:)`](/documentation/AVFAudio/AVMusicTrack/addEvent(_:at:))

Adds a music event to a track at the time you specify.

[`moveEvents(in:by:)`](/documentation/AVFAudio/AVMusicTrack/moveEvents(in:by:))

Moves the beat location of all events in the given beat range by the amount you specify.

[`clearEvents(in:)`](/documentation/AVFAudio/AVMusicTrack/clearEvents(in:))

Removes all events in the given beat range from the music track.

### Cutting and Copying Events

[`cutEvents(in:)`](/documentation/AVFAudio/AVMusicTrack/cutEvents(in:))

Splices all events in the beat range from the music track.

[`copyEvents(in:from:insertAt:)`](/documentation/AVFAudio/AVMusicTrack/copyEvents(in:from:insertAt:))

Copies the events from the source track and splices them into the current music track.

[`copyAndMergeEvents(in:from:mergeAt:)`](/documentation/AVFAudio/AVMusicTrack/copyAndMergeEvents(in:from:mergeAt:))

Copies the events from the source track and merges them into the current music track.

### Iterating Over Events

[`enumerateEvents(in:using:)`](/documentation/AVFAudio/AVMusicTrack/enumerateEvents(in:using:))

Iterates through the music events within the track.

[`AVMusicEventEnumerationBlock`](/documentation/AVFAudio/AVMusicEventEnumerationBlock)

A type you use to enumerate and remove music events, if necessary.

### Getting the End of Track Timestamp

[`AVMusicTimeStampEndOfTrack`](/documentation/AVFAudio/AVMusicTimeStampEndOfTrack)

A timestamp you use to access all events in a music track through a beat range.



---

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)