2 summary:: Shift and stretch bin position.
3 related:: Classes/FFT, Classes/IFFT, Classes/PV_MagShift
8 Shift and scale the positions of the bins. Can be used as a very crude
9 frequency shifter/scaler.
23 Scale bin location by factor.
28 Add an offset to bin position.
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;
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;
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;
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;
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]);