<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFAudio",
  "identifier" : "/documentation/AVFAudio/AVMusicTrack/copyAndMergeEvents(in:from:mergeAt:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFAudio"
    ],
    "preciseIdentifier" : "c:objc(cs)AVMusicTrack(im)copyAndMergeEventsInRange:fromTrack:mergeAtBeat:"
  },
  "title" : "copyAndMergeEvents(in:from:mergeAt:)"
}
-->

# copyAndMergeEvents(in:from:mergeAt:)

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

```
func copyAndMergeEvents(in range: AVBeatRange, from sourceTrack: AVMusicTrack, mergeAt mergeStartBeat: AVMusicTimeStamp)
```

## Parameters

`range`

The range of beats.

`sourceTrack`

The music track to copy the events from.

`mergeStartBeat`

The start beat where the copied events merge into.

## Discussion

The system won’t modify events originally at or past the start beat. Copying events from track to track follows the same type-exclusion rules as adding events.

---

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)