AttachSample

Connects sample to instrument's FIFO.

Synopsis

Item AttachSample( Item Instrument, Item Sample, char *FIFOName )

Description

This function connects a sample to a named input FIFO for an instrument. This sample will be played when the instrument is started. See the instrument's documentation for the names of its FIFOs. If the function is successful, it returns an attachment item number.

When you finish with the attachment between sample and instrument, you should call DetachSample() to detach and free the attachment's resources.

Multisamples: If more than one sample is attached to a FIFO and the instrument is started with a specified pitch, then the list of samples is searched for the first sample whose range of notes and velocities matches the desired note index (pitch). The LowNote and HighNote, and LowVelocity and HighVelocity are read from the AIFF file. The values from the file can be overwritten using SetAudioItemInfo().

Arguments

Instrument
The item number of the instrument.
Sample
The item number of the sample.
FIFOName
Name of an input FIFO (set to NULL for the first or only FIFO).

Return Value

The function returns the item number of the attachment 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

DetachSample(), SetAudioItemInfo(), LoadSample(), UnloadSample(), DebugSample(), CreateSample(), ScanSample(), GetAudioItemInfo()