---
title: "MIDISetupAddExternalDevice(_:)"
framework: coremidi
role: symbol
role_heading: Function
path: "coremidi/midisetupaddexternaldevice(_:)"
---

# MIDISetupAddExternalDevice(_:)

Adds an external MIDI device to the current MIDI setup.

## Declaration

```swift
func MIDISetupAddExternalDevice(_ device: MIDIDeviceRef) -> OSStatus
```

## Parameters

- `device`: The device to add.

## Return Value

Return Value An OSStatus result code.

## See Also

### Managing External Devices

- [MIDIExternalDeviceCreate(_:_:_:_:)](coremidi/midiexternaldevicecreate(_:_:_:_:).md)
- [MIDISetupRemoveExternalDevice(_:)](coremidi/midisetupremoveexternaldevice(_:).md)
