---
title: "MIDIClientCreateWithBlock(_:_:_:)"
framework: coremidi
role: symbol
role_heading: Function
path: "coremidi/midiclientcreatewithblock(_:_:_:)"
---

# MIDIClientCreateWithBlock(_:_:_:)

Creates a MIDI client with a callback block.

## Declaration

```swift
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

Return Value An OSStatus result code.

## Topics

### Callbacks

- [MIDINotifyBlock](coremidi/midinotifyblock.md)
- [MIDINotification](coremidi/midinotification.md)

## See Also

### Client management

- [Incorporating MIDI 2 into your apps](coremidi/incorporating-midi-2-into-your-apps.md)
- [MIDIClientCreate(_:_:_:_:)](coremidi/midiclientcreate(_:_:_:_:).md)
- [MIDIClientDispose(_:)](coremidi/midiclientdispose(_:).md)
- [MIDIClientRef](coremidi/midiclientref.md)
