« Return to Thread: Time-line editor (for midi or other), and PV-spectral filter with freely settable bins

Re: Time-line editor (for midi or other), and PV-spectral filter with freely settable bins

by Scott Wilson-8 :: Rate this Message:

Reply to Author | View in Thread


On 5 May 2008, at 10:52, Iannis Zannos wrote:

2. A PV FFT UGen that permits one to filter audio input (for example white noise) by the spectrum specified by an array of values in a buffer, where each buffer is a bin representing the amplitude at a specific frequency of the FFT;

Hey Iannis,

You can do 2. just with PV_MagMul.

S.

(
//use as table
var size = 700, bufsize = 2048, sum, factor, step, env;

factor = bufsize / size;
step = factor.reciprocal;

t = Array.fill(size - 1, {|i| (i + 1).explin(1, size, 1, bufsize) - 1});
sum = t.sum;
t = t * (1 / sum);


e = Buffer.alloc(s, bufsize, 1);
d = Buffer.alloc(s, bufsize, 1);
f = Buffer.read(s,"sounds/a11wlk01.wav");

a = SCWindow("test", Rect(200 , 450, size + 40, 150));
a.view.decorator =  FlowLayout(a.view.bounds);
b = SCMultiSliderView(a, Rect(0, 0, size, 100));

c = Array.new;
size.do({arg i;
c = c.add(0.0);
});
c = c.reverse;
b.value_(c);

b.isFilled_(true);

// width in pixels of each stick 
b.indexThumbSize_(1);
// spacing on the value axis
b.gap_(0);

a.front;

env = Env(c, t);

d.loadCollection(env.asSignal(bufsize));
b.action = {arg ms; 
var ind, firstChd, lastChd, setSize, muls;
ind = ms.index;
c[ind] = ms.value[ind];
};

b.mouseUpAction = {
d.loadCollection(Env(c, t).asSignal(bufsize); );
};
)

(
SynthDef("help-magMul", { arg out=0, bufnumA=0, bufnumB=1;
var inA, chainA, inB, chainB, chain;
inA = WhiteNoise.ar(0.2);
chainA = FFT(bufnumA, inA);
chain = PV_MagMul(chainA, bufnumB); 
Out.ar(out, 0.5 * IFFT(chain).dup);
}).play(s,[\out, 0, \bufnumA, e.bufnum, \bufnumB, d.bufnum ]);
)

_______________________________________________
sc-users mailing list
sc-users@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-users

 « Return to Thread: Time-line editor (for midi or other), and PV-spectral filter with freely settable bins

LightInTheBox - Buy quality products at wholesale price