class library: SynthDef - lazy implementation of removeUGen
[supercollider.git] / HelpSource / Classes / PV_BinShift.schelp
blob8842d34df9a79951c2dd89bac670b5b0d81f2bd3
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.
31 Examples::
33 code::
35 s.boot;
38 b = Buffer.alloc(s,2048,1);
39 c = Buffer.read(s, Help.dir +/+ "sounds/a11wlk01.wav");
43 SynthDef("help-binStretch", { arg out=0, bufnum=0;
44         var in, chain;
45         in = LFSaw.ar(200, 0, 0.2);
46         chain = FFT(bufnum, in);
47         chain = PV_BinShift(chain, MouseX.kr(0.25, 4, \exponential) );
48         Out.ar(out, 0.5 * IFFT(chain).dup);
49 }).play(s,[\out, 0, \bufnum, b.bufnum]);
53 SynthDef("help-binStretch2", { arg out=0, bufnum=0, soundBufnum=2;
54         var in, chain;
55         in = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);
56         chain = FFT(bufnum, in);
57         chain = PV_BinShift(chain, MouseX.kr(0.25, 4, \exponential) );
58         Out.ar(out, 0.5 * IFFT(chain).dup);
59 }).play(s,[\out, 0, \bufnum, b.bufnum, \soundBufnum, c.bufnum]);
63 SynthDef("help-binShift", { arg out=0, bufnum=0;
64         var in, chain;
65         in = LFSaw.ar(200, 0, 0.2);
66         chain = FFT(bufnum, in);
67         chain = PV_BinShift(chain, 1, MouseX.kr(-128, 128) );
68         Out.ar(out, 0.5 * IFFT(chain).dup);
69 }).play(s,[\out, 0, \bufnum, b.bufnum]);
73 SynthDef("help-binShift2", {  arg out=0, bufnum=0, soundBufnum=2;
74         var in, chain;
75         in = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);
76         chain = FFT(bufnum, in);
77         chain = PV_BinShift(chain, 1, MouseX.kr(-128, 128) );
78         Out.ar(out, 0.5 * IFFT(chain).dup);
79 }).play(s,[\out, 0, \bufnum, b.bufnum, \soundBufnum, c.bufnum]);