---
title: "loadSoundBankInstrument(at:program:bankMSB:bankLSB:)"
framework: avfaudio
role: symbol
role_heading: Instance Method
path: "avfaudio/avaudiounitsampler/loadsoundbankinstrument(at:program:bankmsb:banklsb:)"
---

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

Loads a specific instrument from the specified soundbank.

## Declaration

```swift
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

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

## See Also

### Configuring the Sampler Audio Unit

- [loadInstrument(at:)](avfaudio/avaudiounitsampler/loadinstrument(at:).md)
- [loadAudioFiles(at:)](avfaudio/avaudiounitsampler/loadaudiofiles(at:).md)
