Strange - Supercollider





s.boot

b = Buffer.alloc(s,2048,1);

(
{ var in, chain;
        in = WhiteNoise.ar(0.8); // generatore di noise, mul a 0.8
        
        chain = FFT(b.bufnum, in); // Fast Fourier Transform
        
        chain = PV_RandComb(chain, 0.95, Impulse.kr(0.4));

// 95% of spectrum cleared
// Retriggering frequency = 0.4 Hz
// Phase Vocoder UGens (i.e. 'PV_...') to manipulate blocks of spectral data before reconversion
          
        IFFT(chain);
}.play(s);
)



(

{ var in, chain, output, frames = 1024;

    in = PlayBuf.ar(1, b.bufnum, BufRateScale.kr(b.bufnum), loop: -1);

    PlayBuf.ar(numChannels,bufnum,rate,trigger,startPos,loop); // PlayBuf Help

    chain = FFT(LocalBuf(frames), in);

    // shift / stretch bins
    chain = PV_BinShift(chain, MouseX.kr(1, 4, \exponential), MouseY.kr(50, 0, \linear) );

// PV_BinShift(buffer,  stretch,  shift)
// Shift and scale the positions of the bins. 
// Can be used as a very crude frequency shifter/scaler.
// buffer - fft buffer.
// stretch - scale bin location by factor.
// shift - add an offset to bin position.


    output = IFFT(chain) ! 2;

// !2 è uguale a .dup
    
}.play(s);
)

b.free;
x.free;

Leave a Reply