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

# MIDIClientCreateWithBlock(_:_:_:)

Creates a MIDI client with a callback block.

```
func MIDIClientCreateWithBlock(_ name: CFString, _ outClient: UnsafeMutablePointer<MIDIClientRef>, _ notifyBlock: MIDINotifyBlock?) -> OSStatus
```

## Parameters

`name`

The client’s name.

`outClient`

On successful return, points to the newly created MIDI client.

`notifyBlock`

An optional block on which the client receives notifications of changes to the system. This system calls this block on an arbitrary thread. Thread-safety is the block’s responsibility.

## Return Value

An `OSStatus` result code.

## Topics

### Callbacks

[`MIDINotifyBlock`](/documentation/CoreMIDI/MIDINotifyBlock)

A callback block for notifying clients of state changes.

[`MIDINotification`](/documentation/CoreMIDI/MIDINotification)

A message that describes a system state change.



---

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)