[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] FFT + SCSoundFileView



thank you
f
On 28 Sep 2005, at 10:40, scott smith wrote:

Fabrice, is this of any help ?
not done anything with SCSoundFileView and FFT.

my other reason for posting is a slightly related question:
how do those wicked colour FFT plots I've seen in some progs work?

(
n=256;
b=Buffer.alloc(s,n);
)

{ FFT(b.bufnum,AudioIn.ar(1)) }.play

(
var limit=120;
w=SCWindow("scope",Rect(100,100,400,400)).front;
m=SCMultiSliderView(w,Rect(10,10,380,380))
.thumbSize_(1).drawRects_(false).drawLines_(true);


~array=Array.new;


~task=Task({
inf.do({ |i|
b.getn(0,n,{ |buf|
var z,c;
z=buf.clump(2).flop;
z=[Signal.newFrom(z[0]),Signal.newFrom(z[1])];
c=Complex(z[0],z[1]).magnitude.round(0.01);
if(i<limit,{~array=~array.grow(1).add(c) });
defer({ m.value=c/50 })
});
0.04.wait
})
})
)

~task.start
~task.stop

//plot
(
var l=5,nX,nY;
nX=~array.size;
nY=~array.first.size;
w=SCWindow("",Rect(100,100,l*nX+20,l*nY+20)).front;
nX.do({ |x|
nY.do({ |y|
SCStaticText(w,Rect(l*x+10,l*y+10,l,l))
.backColor_(Color( * ((~array[x][y].clip(0,1) )!3) ))
})
})
)


_______________________________________________________________
Situated in Italy, what is Stromboli?

postmaster.co.uk
http://www.postmaster.co.uk/cgi-bin/meme/quiz.pl?id=181
_______________________________________________
sc-users mailing list
sc-users@xxxxxxxxxxxxxxx
http://www.create.ucsb.edu/mailman/listinfo/sc-users


------------------------------------------------------------
Fabrice Mogini

Mobile: +44 7834279698
email: fabrice.mogini@xxxxxxxxxx
website: http://freespace.virgin.net/fabrice.mogini/
Address: Top floor 49 Bavaria Road,
London N19 4EU
U.K.
---------------------------------------------------------------------------------------