linux: shared memory interface - link with librt
[supercollider.git] / HelpSource / Classes / BufFrames.schelp
blob0b65472492220ed2832334f53416edc161ce22f8
1 class:: BufFrames
2 summary:: Current number of frames allocated in the buffer.
3 related:: Classes/BufChannels, Classes/BufDur, Classes/BufRateScale, Classes/BufSampleRate, Classes/BufSamples
4 categories::  UGens>Buffer>Info
6 Description::
7 Get the current number of allocated frames.
9 classmethods::
11 method::kr, ir
13 argument::bufnum
14 Buffer index.
16 returns:: the current number of allocated frames.
18 discussion::
19 warning::
20 The  code::.ir::  method is not the safest choice.
21 Since a buffer can be reallocated at any time, using
22 code::.ir::  will not track the changes.
25 Examples::
27 code::
29 b = Buffer.read(s, Help.dir +/+ "sounds/a11wlk01.wav");
31 // indexing with a phasor
32 { BufRd.ar(1, b, Phasor.ar(0, BufRateScale.kr(b), 0, BufFrames.kr(b))) }.play;
34 // indexing by hand
35 { BufRd.ar(1, b, K2A.ar(MouseX.kr(0, BufFrames.kr(b)))) }.play;
37 b.free