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

# MIDIThruConnectionCreate(_:_:_:)

Creates a MIDI thru connection.

```
func MIDIThruConnectionCreate(_ inPersistentOwnerID: CFString?, _ inConnectionParams: CFData, _ outConnection: UnsafeMutablePointer<MIDIThruConnectionRef>) -> OSStatus
```

## Parameters

`inPersistentOwnerID`

A unique identifier of the owning object, such as `com.mycompany.MyApp`. If you pass `NULL`, the client owns the connection and it’s automatically disposed with the client.

`inConnectionParams`

A [`MIDIThruConnectionParams`](/documentation/CoreMIDI/MIDIThruConnectionParams) object that’s contained in a <doc://com.apple.documentation/documentation/CoreFoundation/CFData>.

`outConnection`

On successful return, a reference to the newly created connection.

## Return Value

An `OSStatus` result code.

---

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)