---
title: MIDIReadBlock
framework: coremidi
role: symbol
role_heading: Type Alias
path: coremidi/midireadblock
---

# MIDIReadBlock

A block receiving MIDI input.

## Declaration

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

## Parameters

- `pktlist`: The incoming MIDI message(s).
- `srcConnRefCon`: A refCon you passed to MIDIPortConnectSource, which identifies the source of the data.

## Discussion

Discussion This is a callback block through which a client receives incoming MIDI messages. A MIDIReadBlock is passed to the MIDIInputPortCreateWithBlock and MIDIDestinationCreateWithBlock 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)
- [MIDIReadProc](coremidi/midireadproc.md)
