Sample
Functions for doing something with a single samples selected from a Sampler. You can get and filter the array of samples from the sampler with one of these functions:
- Sampler.createListFromGUISelection()
- Sampler.createListFromScriptSelection()
- Sampler.createSelection(String regex)
- Sampler.createSelectionFromIndexes(var indexData)
- Sampler.createSelectionWithFilter(var filterFunction)
const var Sampler1 = Synth.getChildSynth("Sampler1"); // Script reference to Sampler module
const var sampler_obj = Sampler1.asSampler(); // Sampler object
const var sample = sampler_obj.createSelection("foley").pop(); // single sample from regex array
Console.print(sample.get(sample.FileName));
Class methods
deleteSample
Deletes the sample from the Sampler (not just this reference!).
Sample.deleteSample()
duplicateSample
Duplicates the sample.
Sample.duplicateSample()
get
Returns the sample property.
Sample.get(int propertyIndex)
getCustomProperties
Returns an object that can hold additional properties.
Sample.getCustomProperties()
getId
Returns the ID of the property (use this with the setFromJSONMethod).
Sample.getId(int id)
getRange
Returns the value range that the given property can have (eg. the loop end might not go beyond the sample end.
Sample.getRange(int propertyIndex)
loadIntoBufferArray
Loads the sample into a array of buffers for analysis.
Sample.loadIntoBufferArray()
refersToSameSample
Checks if the otherSample object refers to the same sample as this.
Sample.refersToSameSample(var otherSample)
replaceAudioFile
Writes the content of the audio data (array of buffers) into the audio file. This is undoable!.
Sample.replaceAudioFile(var audioData)
set
Sets the sample property.
Sample.set(int propertyIndex, var newValue)
setFromJSON
Sets the properties from a JSON object.
Sample.setFromJSON(var object)