---
title: MIDIReadProc
framework: coremidi
role: symbol
role_heading: Type Alias
path: coremidi/midireadproc
---

# MIDIReadProc

A function receiving MIDI input.

## Declaration

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

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.

## See Also

### Deprecated Functions

- [MIDIInputPortCreate(_:_:_:_:_:)](coremidi/midiinputportcreate(_:_:_:_:_:).md)
- [MIDIInputPortCreateWithBlock(_:_:_:_:)](coremidi/midiinputportcreatewithblock(_:_:_:_:).md)
- [MIDISourceCreate(_:_:_:)](coremidi/midisourcecreate(_:_:_:).md)
- [MIDIDestinationCreate(_:_:_:_:_:)](coremidi/mididestinationcreate(_:_:_:_:_:).md)
- [MIDIDestinationCreateWithBlock(_:_:_:_:)](coremidi/mididestinationcreatewithblock(_:_:_:_:).md)
- [MIDIPacketListInit(_:)](coremidi/midipacketlistinit(_:).md)
- [MIDIPacketListAdd(_:_:_:_:_:_:)](coremidi/midipacketlistadd(_:_:_:_:_:_:).md)
- [MIDISend(_:_:_:)](coremidi/midisend(_:_:_:).md)
- [MIDIReceived(_:_:)](coremidi/midireceived(_:_:).md)
- [MIDIReadBlock](coremidi/midireadblock.md)
