Sample class
Represents a single sample.
Methods
getAudioData()
Gets the PCM Float32Array
audio data and stores it internally for reuse. It decodes compressed samples if necessary.
The returned value is a Float32Array
containing the PCM audio data for the sample.
All other methods are internal.
Properties
sampleName
The sample’s name.
sampleLoopStartIndex
The sample’s loop start index. In sample data points, relative to the start of the sample.
sampleLoopEndIndex
The sample’s loop end index. In sample data points, relative to the start of the sample.
sampleType
The sample type.
isCompressed
Indicates if the sample is compressed (SF3).
sampleRate
The sample rate of the sample, in hertz.
samplePitch
The MIDI key number of the recorded pitch for this sample.
samplePitchCorrection
The pitch correction to apply in cents. It can be negative.
linkedSample
BasicSample
or undefined
. The other linked sample of the stereo pair.
linkedInstruments
BasicInstrument[]
. All the instruments that are using this sample.
Note that there may be duplicates of the same instrument if it uses the sample multiple times.
All other properties are internal.