This class buffers a small portion of a soundfile in RAM and then streams the rest from disk. It is built around the DiskIn ugen and makes it quick and easy to preload and manage lots of samples - much more than you could fit in your RAM. It associates each soundfile with a key (usually a number or a symbol) and can simultaneously play n
overlaps of each sound.
This class has a small delay before starting the sound as it buffers or 'cues' data right before playing. On the other hand it can deal with an almost unlimited number of samples. So it will not trigger instantaneously but still be pretty quick. How quick depends on the -numFrames and general disk drive activity. The subclass RedDiskInSamplerGiga is recommended if you need your samples to start instantly e.g. when syncing to a beat.
Do not use this class for granular synthesis or for playing heaps of sounds at once. Remember that it streams data from disk. For playing very many soundfiles at once, use the RedSampler class.
Create a new sampler on a server.
server |
If this is |
Attach a soundfile to a key (number or symbol) and create buffers - one for each overlapping voice. This method is also has the alias preload
for backward compatibility.
key |
A number or a symbol. |
path |
A string to a soundfile. |
startFrame |
In samples. |
numFrames |
Safest to leave this as |
Play the sample preloaded at key.
key |
A number or a symbol. | ||||||
attack |
In seconds. | ||||||
sustain |
In seconds. If this is | ||||||
release |
In seconds. | ||||||
amp |
Amplitude. | ||||||
out |
Sets outbus and defaults to 0. | ||||||
group |
If | ||||||
loop |
Should be either 0 (default), 1 or 2.
|
Stops one voice currently playing at this key.
key |
A number or a symbol. |
release |
Release time is in seconds. The voice is stolen when the sound is fully released. |
Stop all currently playing voices for all keys.
Clear all keys, close files, free synths and buffers.
Clear a key, close its file and free its synth and buffer.
Report which keys have been preloaded with soundfiles.
Report which keys that currently have one or more voices playing.
Get or set the size of the preload buffer. The default is 32768.
Get or set number of overlaps or voices allowed to play per key at once. The default is 2. You will need to -prepareForPlay again after setting this.
Report the length in seconds of the soundfile loaded at this key.
Report the number of channels of the soundfile loaded at this key.
Return an array of buffer for this key. The number of buffers depend on how many overlaps you had when preloading.
Return number of free voices for this key i.e. the number of non-playing voices.
Return boolean if more than one voice is playing.
Set the amplitude for a running synth.