RedDiskInSamplerGiga:
Filter:
Classes (extension) | Red > redSampler

RedDiskInSamplerGiga
ExtensionExtension

playing soundfiles from disk - fast trigger version
Location: NOT INSTALLED!

Description

This 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.

NOTE: With this class you can not preload more than about 244 (122 if you have 2 overlaps etc.) files due to UNIX system limitations of how many files allowed to be kept open at the same time.

You may overcome this limitation with the following terminal command...

NOTE: Soundfiles with sample rate that differ from the server's current samplerate will play back at wrong speed. This because of how DiskIn works.

To test this class and see when and which files it loads, use the following command in terminal (osx only - xcode required)

Class Methods

Inherited class methods

Instance Methods

.prepareForPlay

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.

Arguments:

key

A number or a symbol.

path

A string to a soundfile.

startFrame

In samples.

numFrames

Safest to leave this as nil. Then the -numFrames below is used (default for that is 32768).

.play

Play the sample preloaded at key.

Arguments:

key

A number or a symbol.

attack

In seconds.

sustain

In seconds. If this is nil then the total length of the soundfile will be used (-attack-release). So the default: attack 0, sustain nil, release 0 will play the soundfile in its full length without an envelope.

release

In seconds.

amp

Amplitude.

out

Sets outbus and defaults to 0.

group

If nil it will use Server.defaultGroup.

loop

Should be either 0 (default), 1 or 2.

0Loop off. Play once through with finite duration (using attack+sustain+release).
1Loop on. Loop infinite until it receives a .stop (ignoring sustain).
2Loop on. Loop with finite duration (using attack+sustain+release).

.stop

Stops one voice currently playing at this key.

Arguments:

key

A number or a symbol.

release

Release time is in seconds. The voice is stolen when the sound is fully released.

.flush

Stop all currently playing voices for all keys.

.free

Clear all keys, close files, free synths and buffers.

.freeKey

Clear a key, close its file and free its synth and buffer.

.loadedKeys

Report which keys have been preloaded with soundfiles.

.playingKeys

Report which keys that currently have one or more voices playing.

.numFrames

Get or set the size of the preload buffer. The default is 32768.

.overlaps

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.

.length

Report the length in seconds of the soundfile loaded at this key.

.channels

Report the number of channels of the soundfile loaded at this key.

.buffers

Return an array of buffer for this key. The number of buffers depend on how many overlaps you had when preloading.

.voicesLeft

Return number of free voices for this key i.e. the number of non-playing voices.

.isPlaying

Return boolean if more than one voice is playing.

.amp

Set the amplitude for a running synth.

Inherited instance methods

Examples