# LoadInstrument

Loads Instrument and Template in one call.

### Synopsis

`Item LoadInstrument (char *Name, Item AudioDevice, uint8 Priority)`

### Description

This functions combines the actions of `LoadInsTemplate()` and `CreateInstrument()`, and returns the resulting Instrument item.

Call `UnloadInstrument()` (not `DeleteInstrument()`) to free an Instrument created by this function. Calling `DeleteInstrument()` deletes the Instrument, but not the Template, leaving you with an unaccessible Template Item that you can't delete.

### Arguments

Name
  Name of the file containing the instrument template.

AudioDevice
  Audio device Item for instrument. 0 indicates the default audio device, the DSP, which is the only valid audio device item at the present time.

Priority
  Determines order of execution in DSP. Set from 0 to 200. A typical value would be 100. This also determines the priority over other instruments when voices are stolen for dynamic voice allocation.

### Return Value

The function returns an Instrument item number (a positive value) if successful or an error code (a negative value) if an error occurs.

### Implementation

Folio call implemented in Audio folio V20.

### Associated Files

audio.h

### See Also

``UnloadInstrument`(), LoadInsTemplate(), CreateInstrument()`