<!--
{
  "availability" : [
    "iOS: 4.2.0 - 27.0.0",
    "iPadOS: 4.2.0 - 27.0.0",
    "macCatalyst: 13.1.0 - 27.0.0",
    "macOS: 10.0.0 - 27.0.0",
    "visionOS: 1.0.0 - 27.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "CoreMIDI",
  "identifier" : "/documentation/CoreMIDI/MIDIReadProc",
  "metadataVersion" : "0.1.0",
  "role" : "Type Alias",
  "symbol" : {
    "kind" : "Type Alias",
    "modules" : [
      "Core MIDI"
    ],
    "preciseIdentifier" : "c:@T@MIDIReadProc"
  },
  "title" : "MIDIReadProc"
}
-->

# MIDIReadProc

A function receiving MIDI input.

```
typealias MIDIReadProc = (UnsafePointer<MIDIPacketList>, UnsafeMutableRawPointer?, UnsafeMutableRawPointer?) -> Void
```

## Parameters

`pktlist`

The incoming MIDI message(s).

`readProcRefCon`

The refCon you passed to MIDIInputPortCreate or MIDIDestinationCreate

`srcConnRefCon`

A refCon you passed to MIDIPortConnectSource, which identifies the source of the data.

## Discussion

This is a callback function through which a client receives incoming MIDI messages.

A MIDIReadProc function pointer is passed to the MIDIInputPortCreate and MIDIDestinationCreate functions. The CoreMIDI framework will create a high-priority receive thread on your client’s behalf, and from that thread, your MIDIReadProc will be called when incoming MIDI messages arrive.

---

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)