<!--
{
  "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

[`-  initWithAudioComponentDescription:`](/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.

[`-  sendPressureForKey: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.

[`-  sendMIDIEventList:`](/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.

## Relationships

### Conforms To

[`Hashable`](/documentation/Swift/Hashable)

[`AVAudioStereoMixing`](/documentation/AVFAudio/AVAudioStereoMixing)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`Equatable`](/documentation/Swift/Equatable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`CVarArg`](/documentation/Swift/CVarArg)

[`AVAudioMixing`](/documentation/AVFAudio/AVAudioMixing)

[`AVAudio3DMixing`](/documentation/AVFAudio/AVAudio3DMixing)

[`Sendable`](/documentation/Swift/Sendable)

### Inherits From

[`AVAudioUnit`](/documentation/AVFAudio/AVAudioUnit)

### Inherited By

[`AVAudioUnitSampler`](/documentation/AVFAudio/AVAudioUnitSampler)

---

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)