<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: 10.0.0 - 10.6.0",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreMIDI",
  "identifier" : "/documentation/CoreMIDI/MIDISetupToData",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core MIDI"
    ],
    "preciseIdentifier" : "c:@F@MIDISetupToData"
  },
  "title" : "MIDISetupToData"
}
-->

# MIDISetupToData

Creates an XML representation of a MIDISetup object.

```
extern OSStatus MIDISetupToData(MIDISetupRef setup, CFDataRef*outData);
```

## Parameters

`setup`

The MIDISetup object whose XML representation is to be returned.

`outData`

On successful return, points to a newly-created CFDataRef containing the XML text. The client is responsible for releasing this CFData object when done with it.

## Return Value

An OSStatus result code.

## Discussion

As of CoreMIDI 1.1, it is usually not necessary to call this function, as CoreMIDI manages a single persistent MIDISetup itself.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)