SuperCollider CLASSES

BufSampleRate

Buffer sample rate.

Description

Returns the buffer's current sample rate.

Class Methods

*kr (bufnum)

From superclass: BufInfoUGenBase

*ir (bufnum)

From superclass: BufInfoUGenBase

Arguments:

bufnum

Buffer index.

Returns:

the buffer's current sample rate.

Discussion:

WARNING: The .ir method is not the safest choice. Since a buffer can be reallocated at any time, using .ir will not track the changes.

Inherited class methods

Instance Methods

Inherited instance methods

Examples

b = Buffer.read(s, Platform.resourceDir +/+ "sounds/a11wlk01.wav");

// compares a 1102.5 Hz sine tone (11025 * 0.1, left) with a 1100 Hz tone (right)
// the apollo sample has a sample rate of 11.025 kHz
(
{
    var freq;
    freq = [ BufSampleRate.kr(b) * 0.1, 1100];
    SinOsc.ar(freq, 0, 0.1)
}.play;
)

b.free;