---
title: "MusicEventIteratorSetEventTime(_:_:)"
framework: audiotoolbox
role: symbol
role_heading: Function
path: "audiotoolbox/musiceventiteratorseteventtime(_:_:)"
---

# MusicEventIteratorSetEventTime(_:_:)

Sets the timestamp for the event at a music event iterator’s current position.

## Declaration

```swift
func MusicEventIteratorSetEventTime(_ inIterator: MusicEventIterator, _ inTimeStamp: MusicTimeStamp) -> OSStatus
```

## Parameters

- `inIterator`: The music event iterator whose current event you want to change the timestamp of.
- `inTimeStamp`: The new timestamp for the event, in beats.

## Return Value

Return Value A result code.

## Discussion

Discussion After calling this function, the music event iterator remains positioned at the same event. However, because the event has been moved to a new location on the iterator’s music track, the iterator may no longer have a next or previous event. You can test this by calling MusicEventIteratorHasPreviousEvent(_:_:) and MusicEventIteratorHasNextEvent(_:_:).

## See Also

### Iterating Over Music Events

- [NewMusicEventIterator(_:_:)](audiotoolbox/newmusiceventiterator(_:_:).md)
- [DisposeMusicEventIterator(_:)](audiotoolbox/disposemusiceventiterator(_:).md)
- [MusicEventIteratorNextEvent(_:)](audiotoolbox/musiceventiteratornextevent(_:).md)
- [MusicEventIteratorSeek(_:_:)](audiotoolbox/musiceventiteratorseek(_:_:).md)
- [MusicEventIteratorDeleteEvent(_:)](audiotoolbox/musiceventiteratordeleteevent(_:).md)
- [MusicEventIteratorGetEventInfo(_:_:_:_:_:)](audiotoolbox/musiceventiteratorgeteventinfo(_:_:_:_:_:).md)
- [MusicEventIteratorHasCurrentEvent(_:_:)](audiotoolbox/musiceventiteratorhascurrentevent(_:_:).md)
- [MusicEventIteratorHasNextEvent(_:_:)](audiotoolbox/musiceventiteratorhasnextevent(_:_:).md)
- [MusicEventIteratorHasPreviousEvent(_:_:)](audiotoolbox/musiceventiteratorhaspreviousevent(_:_:).md)
- [MusicEventIteratorPreviousEvent(_:)](audiotoolbox/musiceventiteratorpreviousevent(_:).md)
- [MusicEventIteratorSetEventInfo(_:_:_:)](audiotoolbox/musiceventiteratorseteventinfo(_:_:_:).md)
- [MusicEventIterator](audiotoolbox/musiceventiterator.md)
- [MusicEventType](audiotoolbox/musiceventtype.md)
- [ExtendedNoteOnEvent](audiotoolbox/extendednoteonevent.md)
- [ExtendedTempoEvent](audiotoolbox/extendedtempoevent.md)
