HISE Docs

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:

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!). Edit on GitHub

Sample.deleteSample()



duplicateSample

Duplicates the sample. Edit on GitHub

Sample.duplicateSample()



get

Returns the sample property. Edit on GitHub

Sample.get(int propertyIndex)



getCustomProperties

Returns an object that can hold additional properties. Edit on GitHub

Sample.getCustomProperties()



getId

Returns the ID of the property (use this with the setFromJSONMethod). Edit on GitHub

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. Edit on GitHub

Sample.getRange(int propertyIndex)



loadIntoBufferArray

Loads the sample into a array of buffers for analysis. Edit on GitHub

Sample.loadIntoBufferArray()



refersToSameSample

Checks if the otherSample object refers to the same sample as this. Edit on GitHub

Sample.refersToSameSample(var otherSample)



replaceAudioFile

Writes the content of the audio data (array of buffers) into the audio file. This is undoable!. Edit on GitHub

Sample.replaceAudioFile(var audioData)



set

Sets the sample property. Edit on GitHub

Sample.set(int propertyIndex, var newValue)



setFromJSON

Sets the properties from a JSON object. Edit on GitHub

Sample.setFromJSON(var object)