---
title: "MIDISetupAddDevice(_:)"
framework: coremidi
role: symbol
role_heading: Function
path: "coremidi/midisetupadddevice(_:)"
---

# MIDISetupAddDevice(_:)

Adds a driver-owned MIDI device to the current MIDI setup.

## Declaration

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

## Parameters

- `device`: The device to add.

## Return Value

Return Value An OSStatus result code.

## Discussion

Discussion Only MIDI drivers may call this function.

## See Also

### Managing Devices

- [MIDISetupRemoveDevice(_:)](coremidi/midisetupremovedevice(_:).md)
