---
title: "copyAndMergeEvents(in:from:mergeAt:)"
framework: avfaudio
role: symbol
role_heading: Instance Method
path: "avfaudio/avmusictrack/copyandmergeevents(in:from:mergeat:)"
---

# copyAndMergeEvents(in:from:mergeAt:)

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

## Declaration

```swift
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

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.

## See Also

### Cutting and Copying Events

- [cutEvents(in:)](avfaudio/avmusictrack/cutevents(in:).md)
- [copyEvents(in:from:insertAt:)](avfaudio/avmusictrack/copyevents(in:from:insertat:).md)
