# ReleaseInstrument

Instruct an instrument to begin to finish (Note Off).

### Synopsis

`Err ReleaseInstrument (Item Instrument, TagArg *tagList)
Err ReleaseInstrumentVA (Item Instrument, uint32 tag1, ...)`

### Description

This tells an Instrument to progress into its "release phase" if it hasn't already done so. This is equivalent to a MIDI Note Off event. Any Samples or Envelopes that are attached are set to their release portion, which may or may not involve a release loop. The sound may continue to be produced indefinitely depending on the release characteristics of the instrument.

This has no audible effect on instruments that don't have some kind of sustain loop (e.g. sawtooth.dsp).

Affects only instruments in the AF_STARTED state: sets them to the AF_RELEASED state. By default if and when an instrument reaches the end of its release phase, it stays in the AF_RELEASED state until explicitly changed (e.g. `StartInstrument()`, `StopInstrument()`). If one of this Instrument's running Attachments has the AF_ATTF_FATLADYSINGS flag set, the Instrument is automatically stopped when that Attachment completes. In that case, the instrument goes into the AF_STOPPED state, or, if the Instrument has the AF_INSF_AUTOABANDON flag set, the AF_ABANDONED state.

### Arguments

Instrument
  The item number for the instrument.

### Tags

AF_TAG_TIME_SCALE
  (ufrac16) Scale times for all Envelopes attached to this Instrument. Original value is derived from the AF_TAG_TIME_SCALE provided when the Envelope Attachment was made. This value remains in effect until another AF_TAG_TIME_SCALE is passed to `StartInstrument()` or `ReleaseInstrument()`.

### Return Value

The function returns a non-negative value if successful or an error code (a negative value) if an error occurs.

### Implementation

SWI implemented in Audio folio V20.

### Associated Files

audio.h

### See Also

``StartInstrument`(), StopInstrument(), PauseInstrument(), ResumeInstrument(), Instrument`