class library: SynthDef - lazy implementation of removeUGen
[supercollider.git] / HelpSource / Classes / BufDur.schelp
blobce87fd5ab3236d364b6a4986cff46fc5644a0dcd
1 class:: BufDur
2 summary:: Current duration of soundfile in buffer.
3 related:: Classes/BufChannels, Classes/BufFrames, Classes/BufRateScale, Classes/BufSampleRate, Classes/BufSamples
4 categories::  UGens>Buffer>Info
6 Description::
7 Get the current duration of soundfile.
9 classmethods::
11 method::kr, ir
13 argument::bufnum
14 Buffer index.
16 returns:: the current duration.
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::
28 b = Buffer.read(s, Help.dir +/+ "sounds/a11wlk01.wav");
30 { BufRd.ar(1, b,  Sweep.ar(Impulse.ar(BufDur.kr(b).reciprocal), BufSampleRate.kr(b))) }.play;
32 b.free