SuperCollider Forum
June 18, 2013, 05:39:15 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: The SuperCollider forum is currently experiencing a rash of spambot registrations. New user requests may not be approved quickly as a result -- and if your email address looks like spam, it might not be approved at all. We are working to improve the security of the registration process, and to provide alternate means to contact the administrators to get a new account. Thanks for your patience.
 
   Home   Help Search Calendar Login Register  
Pages: [1]
  Print  
Author Topic: filter response util  (Read 2687 times)
0 Members and 1 Guest are viewing this topic.
daf
Guest
« on: January 07, 2006, 05:38:56 PM »

hello, this is a little utiltiy i made to look at filter responses.....quite educational

(
   var w,m,fftBuf,getBuf;
   var updateTime = 0.01,tag=true;
   
   getBuf = {
      var capture;
      fftBuf.getn(0, fftBuf.numFrames, { |recvd|
         var z, c;
         z = recvd.clump(2).flop;
         z = [Signal.newFrom(z[0]), Signal.newFrom(z[1])];
         c = Complex(z[0], z[1]);
         capture=c.magnitude.round(0.01)/80;
         { m.value=(m.value.max(capture)) }.defer
      })
   };
   
   w = SCWindow("averager",Rect(100,100,400,400)).front;
   w.onClose = { tag = false };
   
   m = SCMultiSliderView(w,Rect(10,10,380,380));
   
   m.drawLines_(true).drawRects_(false).readOnly_(true)
      .thumbSize_(1).valueThumbSize_(0);
   
   fftBuf = Buffer.alloc(s,256);
   
   SynthDef(\fftScoper, {
      var src = Impulse.ar(100) * 20;
      FFT(fftBuf.bufnum,
         //RHPF.ar(src,4000,0.5)
         //RLPF.ar(BRF.ar(src,6000,0.04),9000,0.2)
         //RLPF.ar(BRF.ar(src,,9000,0.4),0.1)
         //RHPF.ar(src,4000)
         RHPF.ar(RLPF.ar(src,9000,0.4),1000,0.2)
         //Resonz.ar(src,4000,2)
         //BPF.ar(src,4000,2)
         //OnePole.ar(src,0.4)
      )
   }).send(s);
   
   play({
      s.sync;
      Synth(\fftScoper);
      s.sync;
      5.do({
         value(getBuf);
         wait(updateTime)
      })
   }.r);
)
« Last Edit: January 17, 2006, 05:55:01 PM by daf » Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!