scide: implement selectionLength for openDocument
[supercollider.git] / HelpSource / Classes / PV_BinShift.schelp
blob5abf38e34a68c7447fd0f66f071bba3f087b649a
1 class:: PV_BinShift
2 summary:: Shift and stretch bin position.
3 related:: Classes/FFT, Classes/IFFT, Classes/PV_MagShift
4 categories:: UGens>FFT
6 Description::
8 Shift and scale the positions of the bins. Can be used as a very crude
9 frequency shifter/scaler.
12 classmethods::
14 method::new
16 argument::buffer
18 FFT buffer.
21 argument::stretch
23 Scale bin location by factor.
26 argument::shift
28 Add an offset to bin position.
30 argument::interp
32 Set to 0 (default) for no interpolation, or 1 to linear-interpolate between bins.
35 Examples::
37 code::
39 s.boot;
42 c = Buffer.read(s, Platform.resourceDir +/+ "sounds/a11wlk01.wav");
46 SynthDef("help-binStretch", { arg out=0;
47         var in, chain;
48         in = LFSaw.ar(200, 0, 0.2);
49         chain = FFT(LocalBuf(2048), in);
50         chain = PV_BinShift(chain, MouseX.kr(0.25, 4, \exponential) );
51         Out.ar(out, 0.5 * IFFT(chain).dup);
52 }).play;
56 SynthDef("help-binStretch2", { arg out=0, soundBufnum=2;
57         var in, chain;
58         in = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);
59         chain = FFT(LocalBuf(2048), in);
60         chain = PV_BinShift(chain, MouseX.kr(0.25, 4, \exponential) );
61         Out.ar(out, 0.5 * IFFT(chain).dup);
62 }).play(s,[\out, 0, \soundBufnum, c.bufnum]);
66 SynthDef("help-binShift", { arg out=0, bufnum=0;
67         var in, chain;
68         in = LFSaw.ar(200, 0, 0.2);
69         chain = FFT(LocalBuf(2048), in);
70         chain = PV_BinShift(chain, 1, MouseX.kr(-128, 128) );
71         Out.ar(out, 0.5 * IFFT(chain).dup);
72 }).play;
76 SynthDef("help-binShift2", {  arg out=0, soundBufnum=2;
77         var in, chain;
78         in = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);
79         chain = FFT(LocalBuf(2048), in);
80         chain = PV_BinShift(chain, 1, MouseX.kr(-128, 128) );
81         Out.ar(out, 0.5 * IFFT(chain).dup);
82 }).play(s,[\out, 0, \soundBufnum, c.bufnum]);