Nothing fancy. This class just loads soundfiles into RAM and then uses PlayBuf to play them back. It uses the same interface as RedDiskInSampler (except for numFrames which is is not implemented here).
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 |
How much of the file to load in samples. Leave 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 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.