<!--
{
  "availability" : [
    "iOS: 4.2.0 -",
    "iPadOS: 4.2.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreMIDI",
  "identifier" : "/documentation/CoreMIDI/MIDIDeviceGetEntity(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core MIDI"
    ],
    "preciseIdentifier" : "c:@F@MIDIDeviceGetEntity"
  },
  "title" : "MIDIDeviceGetEntity(_:_:)"
}
-->

# MIDIDeviceGetEntity(_:_:)

Returns the device’s entity at a specific index.

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

## Parameters

`device`

The device to query.

`entityIndex0`

The entity index.

## Return Value

An entity reference, or `NULL` if an error occurred.

## Discussion

---

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)