---
title: "MIDIDeviceGetEntity(_:_:)"
framework: coremidi
role: symbol
role_heading: Function
path: "coremidi/mididevicegetentity(_:_:)"
---

# MIDIDeviceGetEntity(_:_:)

Returns the device’s entity at a specific index.

## Declaration

```swift
func MIDIDeviceGetEntity(_ device: MIDIDeviceRef, _ entityIndex0: Int) -> MIDIEntityRef
```

## Parameters

- `device`: The device to query.
- `entityIndex0`: The entity index.

## Return Value

Return Value An entity reference, or NULL if an error occurred.

## See Also

### Device lookup

- [MIDIGetNumberOfDevices()](coremidi/midigetnumberofdevices().md)
- [MIDIGetDevice(_:)](coremidi/midigetdevice(_:).md)
- [MIDIGetNumberOfExternalDevices()](coremidi/midigetnumberofexternaldevices().md)
- [MIDIGetExternalDevice(_:)](coremidi/midigetexternaldevice(_:).md)
- [MIDIDeviceGetNumberOfEntities(_:)](coremidi/mididevicegetnumberofentities(_:).md)
- [MIDIDeviceRef](coremidi/midideviceref.md)
