PlayBuf:
Filter:
Classes | UGens > Buffer

PlayBuf : MultiOutUGen : UGen : AbstractFunction : Object

Sample playback oscillator.
Source: BufIO.sc

Description

Plays back a sample resident in memory.

Class Methods

PlayBuf.ar(numChannels, bufnum: 0, rate: 1.0, trigger: 1.0, startPos: 0.0, loop: 0.0, doneAction: 0)

PlayBuf.kr(numChannels, bufnum: 0, rate: 1.0, trigger: 1.0, startPos: 0.0, loop: 0.0, doneAction: 0)

Arguments:

numChannels

Number of channels that the buffer will be. This must be a fixed integer. The architecture of the SynthDef cannot change after it is compiled.

bufnum

The index of the buffer to use.

NOTE: If you supply a bufnum of a buffer with a differing number of channels than the one specified in this PlayBuf, it will post a warning and output the channels it can.
rate

1.0 is the server's sample rate, 2.0 is one octave up, 0.5 is one octave down -1.0 is backwards normal rateā€¦ etc. Interpolation is cubic.

trigger

A trigger causes a jump to the startPos. A trigger occurs when a signal changes from negative value to positive value.

startPos

Sample frame to start playback.

loop

1 means true, 0 means false. This is modulateable.

doneAction

an integer representing an action to be executed when the buffer is finished playing. This can be used to free the enclosing synth, etc. See Done for more detail. doneAction is only evaluated if loop is 0.

Inherited class methods

Instance Methods

Inherited instance methods

Examples

In the above example, note how the doneAction: Done.freeSelf causes the synth to free itself when the buffer reaches its end.

Note again that the number of channels must be fixed for the SynthDef. It cannot vary depending on which buffer you use.