ExtensionThis version is recommended when syncing to a beat, triggering samples from MIDI or just need to start sample playback instantly. It works similar to the commercial giga sampler software as it preloads/cues small buffers into RAM and then streams the rest from disk. This allows you to have quick access to gigabytes of samples. Many more soundfiles than would fit in RAM.
This subclass works just as its parent RedDiskInSampler except that the preload happens when a sample stops. Therefore all preloaded soundfiles are kept open all the time and can thereby start playing right away.
You may overcome this limitation with the following terminal command...
To test this class and see when and which files it loads, use the following command in terminal (osx only - xcode required)
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.