SSampler:
Filter:
SuperSampler/Classes (extension) | SuperSampler

SSampler
ExtensionExtension

A sampler synthesizer that knows what it's doing.

Description

Make sure you have installed SC3 plugins before using SuperSampler.

Sampler is a sampling synthesizer that applies SampleDescript for sound quality detection, and using detected information to determine playback bahavier. Most features of Sampler is done automatically for you.

For example, it detects the beginning of your sound samples, if there are more than one onset, it separates each onsets as different samples. There are lots of other figures you may want to experiment.

Class Methods

.new

Create a new SSampler.

Arguments:

samplerName

Name of Sampler.

dbname

Name of Sampler database. Each database may contain different Sampler libraries.

Returns:

this SSampler

.allSampler

Returns a dictionary of all samplers created.

.playArgs

Play a SamplerArguments instance. Use this method if you want to play an exactly the same sound you have created before.

Arguments:

args

A SamplerArguments to play;

Instance Methods

.init

Create a new SSampler and add it to SamplerDB.

Arguments:

samplerName

Name of SSampler.

dbname

Name of SamplerDB this SSampler belongs to. If the name of SamplerDB is not created, it will create a new SamplerDB class.

Returns:

(describe returnvalue here)

.key

Play samples by giving key numbers. If no key number provided, it chooses a random MIDI key number. Defaults are also provided by SamplerArguments class.

Arguments:

keynums

The MIDI key numbers to play, can be a single number, an array of numbers, or a function that generate the number. Negative key numbers reverses the buffer to play. It's default is a random number between 0-127.

syncmode

The strategy to syncronize different samples:

\keeplength: keep the length of all playing sound, align all at peak point of the sample with the longest attack time. This is the default strategy.

\percussive: make a percussive sound, starts all sounds from peak point.

[\parkat, time]: the peak point of the sound will be set to the scheduled time.

\stretchshort: stretch each shorter samples to fit the longest sample duration.

\nosorting: just play every sample as it is, like conventional sampler synthesizer.

dur

Duration

amp

Overall amplitude, a multiplier.

ampenv

An Envelop for amplitude, in normalized XY format. Each node in the Envelope is describe as a pair of time and amplitude in the array.

pan

Overall panning. O is the center, -1 is left and 1 is right.

panenv

An Envelop for panning, in normalized XY format. Each node in the Envelope is describe as a pair of time and panning in the array.

bendenv

An Envelop for bending pitch in the sound in normalized XY format. Each node in the Envelope is describe as a pair of time and pitch bending in the array.

texture

The number of sample sounds to be played in the same time. If nil, it will play every triggered sounds.

expand

Stretch the played samples with insertion algorithm using granular synthesis. The value will be the expected time to be stretched.

Granulation runs only when this value is not nil.

grainRate

The grain rate for stratching granular synthesizer.

grainDur

The grain duration for stratching granular synthesizer.

out

Output Bus

midiChannel

A midiChannel for storing the playing UGens in SamplerQuery class, supporting live response.

play

If true, play this sound.

Returns:

a instance of SamplerArguments class

.db

Return an array of SSamplers in the same SamplerDB database

Arguments:

samplerName

The name of the SSampler to return.

Returns:

a SSampler with the name, or a list of SSamplers if not specified.

.filenames

Get filenames loaded to this SSampler.

Returns:

An array of filenames.

.setKeyRanges

Reset range response to each key related to the anchor key number.

In SSampler, every loaded sound files is anchored to a MIDI key number. When the method .key is used, a range of MIDI key numbers are determined for each sampler to respond to the key number played.

Arguments:

strategy

Determine the method to arrange the responded MIDI key numbers for each sample:

\keynumRadious: Give a range radious in infoArray from each anchor keynums as responsive range.

\fullrange: Every sample is responded in full range of midi key number.

\keynumOnly: Only respond to the anchored key number.

infoArray

Information array provided to respond to the strategy.

.keynums

Anchor key numbers for each sample.

Returns:

An array of key numbers setted as anchor for each sample in the list.

.gui

Opens a gui window, for now you can listen to each sample in the sampler independently, set the anchor key number and response range of each sample.

.samples

All samples are stored here. Samples in SuperSampler is stored as classs of SampleDescript. You can extract sample informations stored in the class.

Returns:

An array of SampleDescript classes.

.dbs

The database storing this SSampler. The name \default is assigned if not specified.

Returns:

A SamplerDB class.

.load

Load sound files into a Sampler. All sound files will be analyzed and stored as SampleDescript class, and load into buffers.

Arguments:

soundfiles

A list of soundfiles to load.

server

The server to load all samples into buffers.

filenameAsKeynum

Use key numbers provided in the file names as anchored key number for each file.

normalize

This is a argument for SCMIR, making SCMIR to normalize it's data for analyzation.

startThresh

Threshold for starting time detection, it's a multiplier to the peak amplitude of this sound sample.

endThresh

Threshold for ending time detection, it's a multiplier to the peak amplitude of this sound sample.

override

A boolean that determines whether to override samples that has loaded before with the same filename.

action

A function that triggers after the sampler is loaded.

.keyRanges

Ranges of responding MIDI key numbers of each samples.

Returns:

An array of MIDI key numbers indicating the upper and lower key numbers with each key ranges. In a format like this:

|-------- Each Sample -------------| |-----Each Sample---

|----Section----| |----Section----| |----Section----|

[[[upper, lower], [upper, lower]..], [[upper, lower], [upper, lower]...], ....]

.playArgs

Play a SamplerArguments instance. Use this method if you want to play an exactly the same sound you have created before.

Arguments:

args

A SamplerArguments to play;

.playEnv

The SSampler will fit it's sound into the provided Envelope automatically.

Arguments:

env

The amplitude envelope to play. It can be an instance of Env class or an breakpoint envelope, such as [x1, y1, x2, y2, ..]

keynums

The MIDI key numbers assigned to play. It can also be an array of nubwers or a function generating the number. It's defaulted a random number between 0-127.

dur

Duration of the sound to play. The sound will start from 1/2 of this value before the peak of the sample, not the beginning of the sound file.

amp

Amplitude multiplier.

pan

Panning, from -1 (left) to 1 (right).

maxtexture

The maxinum number of sounds to be played simultaneously base on the amplitude value in the envelope. More sounds would be played at the peak of the envelope.

out

Output Bus

midiChannel

A midiChannel for storing the playing UGens in SamplerQuery class, supporting live response.

Examples