<!--
{
  "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/AVAudioUnitSampler/loadSoundBankInstrument(at:program:bankMSB:bankLSB:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFAudio"
    ],
    "preciseIdentifier" : "c:objc(cs)AVAudioUnitSampler(im)loadSoundBankInstrumentAtURL:program:bankMSB:bankLSB:error:"
  },
  "title" : "loadSoundBankInstrument(at:program:bankMSB:bankLSB:)"
}
-->

# loadSoundBankInstrument(at:program:bankMSB:bankLSB:)

Loads a specific instrument from the specified soundbank.

```
func loadSoundBankInstrument(at bankURL: URL, program: UInt8, bankMSB: UInt8, bankLSB: UInt8) throws
```

## Parameters

`bankURL`

The URL for a soundbank file, either a DLS bank (`.dls`) or a SoundFont bank (`.sf2`).

`program`

The program number for the instrument to load.

`bankMSB`

The most significant bit for the bank number for the instrument to load. This is usually `0x79` for melodic instruments and `0x78` for percussion instruments.

`bankLSB`

The least significant bit for the bank number for the instrument to load. This is often `0` and represents the bank variation.

## Discussion

> Important:
> This method reads from the file and allocates memory. Don’t call it on a real-time thread.

---

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)