---
title: "MIDIOutputPortCreate(_:_:_:)"
framework: coremidi
role: symbol
role_heading: Function
path: "coremidi/midioutputportcreate(_:_:_:)"
---

# MIDIOutputPortCreate(_:_:_:)

Creates an output port through which a client sends outgoing MIDI messages to any MIDI destination.

## Declaration

```swift
func MIDIOutputPortCreate(_ client: MIDIClientRef, _ portName: CFString, _ outPort: UnsafeMutablePointer<MIDIPortRef>) -> OSStatus
```

## Parameters

- `client`: The client to own the newly created port.
- `portName`: The name of the port.
- `outPort`: On successful return, points to the newly created port.

## Return Value

Return Value An OSStatus result code.

## Discussion

Discussion Output ports provide a mechanism for MIDI merging. Core MIDI assumes that each output port is responsible for sending only a single MIDI stream to each destination, although a single port may address all of the destinations in the system. Multiple output ports are only necessary when an application is capable of directing multiple simultaneous MIDI streams to the same destination.

## See Also

### Port management

- [MIDIInputPortCreateWithProtocol(_:_:_:_:_:)](coremidi/midiinputportcreatewithprotocol(_:_:_:_:_:).md)
- [MIDIPortDispose(_:)](coremidi/midiportdispose(_:).md)
- [MIDIPortConnectSource(_:_:_:)](coremidi/midiportconnectsource(_:_:_:).md)
- [MIDIPortDisconnectSource(_:_:)](coremidi/midiportdisconnectsource(_:_:).md)
- [MIDIPortRef](coremidi/midiportref.md)
- [MIDIReceiveBlock](coremidi/midireceiveblock.md)
