<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFAudio",
  "identifier" : "/documentation/AVFAudio/AVAudioUnitMIDIInstrument",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "AVFAudio"
    ],
    "preciseIdentifier" : "c:objc(cs)AVAudioUnitMIDIInstrument"
  },
  "title" : "AVAudioUnitMIDIInstrument"
}
-->

# AVAudioUnitMIDIInstrument

An object that represents music devices or remote instruments.

```
class AVAudioUnitMIDIInstrument
```

## Overview

Use an [`AVAudioUnitMIDIInstrument`](/documentation/AVFAudio/AVAudioUnitMIDIInstrument) in a chain that processes real-time (live) input and has the general concept of music events; for example, notes.

## Topics

### Creating a MIDI instrument

[`init(audioComponentDescription:)`](/documentation/AVFAudio/AVAudioUnitMIDIInstrument/init(audioComponentDescription:))

Creates a MIDI instrument audio unit with the component description you specify.

### Sending information to the MIDI instrument

[`sendController(_:withValue:onChannel:)`](/documentation/AVFAudio/AVAudioUnitMIDIInstrument/sendController(_:withValue:onChannel:))

Sends a MIDI controller event to the instrument.

[`sendMIDIEvent(_:data1:)`](/documentation/AVFAudio/AVAudioUnitMIDIInstrument/sendMIDIEvent(_:data1:))

Sends a MIDI event which contains one data byte to the instrument.

[`sendMIDIEvent(_:data1:data2:)`](/documentation/AVFAudio/AVAudioUnitMIDIInstrument/sendMIDIEvent(_:data1:data2:))

Sends a MIDI event which contains two data bytes to the instrument.

[`sendMIDISysExEvent(_:)`](/documentation/AVFAudio/AVAudioUnitMIDIInstrument/sendMIDISysExEvent(_:))

Sends a MIDI System Exclusive event to the instrument.

[`sendPitchBend(_:onChannel:)`](/documentation/AVFAudio/AVAudioUnitMIDIInstrument/sendPitchBend(_:onChannel:))

Sends a MIDI Pitch Bend event to the instrument.

[`sendPressure(_:onChannel:)`](/documentation/AVFAudio/AVAudioUnitMIDIInstrument/sendPressure(_:onChannel:))

Sends a MIDI channel pressure event to the instrument.

[`sendPressure(forKey:withValue:onChannel:)`](/documentation/AVFAudio/AVAudioUnitMIDIInstrument/sendPressure(forKey:withValue:onChannel:))

Sends a MIDI Polyphonic key pressure event to the instrument.

[`sendProgramChange(_:onChannel:)`](/documentation/AVFAudio/AVAudioUnitMIDIInstrument/sendProgramChange(_:onChannel:))

Sends MIDI Program Change and Bank Select events to the instrument.

[`sendProgramChange(_:bankMSB:bankLSB:onChannel:)`](/documentation/AVFAudio/AVAudioUnitMIDIInstrument/sendProgramChange(_:bankMSB:bankLSB:onChannel:))

Sends MIDI Program Change and Bank Select events to the instrument.

[`send(_:)`](/documentation/AVFAudio/AVAudioUnitMIDIInstrument/send(_:))

Sends a MIDI event list to the instrument.

### Starting and stopping play

[`startNote(_:withVelocity:onChannel:)`](/documentation/AVFAudio/AVAudioUnitMIDIInstrument/startNote(_:withVelocity:onChannel:))

Sends a MIDI Note On event to the instrument.

[`stopNote(_:onChannel:)`](/documentation/AVFAudio/AVAudioUnitMIDIInstrument/stopNote(_:onChannel:))

Sends a MIDI Note Off event to the instrument.



---

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)