Acqua - Supercollider





s.boot;

({
({RHPF.ar(OnePole.ar(BrownNoise.ar, 0.99), LPF.ar(BrownNoise.ar, 14) * 400 + 500, 0.03, 0.003)}!2) + ({RHPF.ar(OnePole.ar(BrownNoise.ar, 0.99), LPF.ar(BrownNoise.ar, 20) * 800 + 1000, 0.03, 0.005)}!2) * 4 }.play
)

// RHPF - A resonant high pass filter.
// in - input signal to be processed
// freq - cutoff frequency.
// rq - the reciprocal of Q.  bandwidth / cutoffFreq.

// OnePole.ar(in, coef, mul, add)
// A one pole filter. Implements the formula :
// out(i) = ((1 - abs(coef)) * in(i)) + (coef * out(i-1))
// in - input signal to be processed
// coef - feedback coefficient. Should be between -1 and +1

// LPF.ar(in, freq, mul, add)
// A second order low pass filter. 
// in - input signal to be processed
// freq - cutoff frequency.

// BrownNoise : Generates noise whose spectrum falls off in power by 6 dB per // octave.


SynthDef(\recordMe, {arg buffer; DiskOut.ar(buffer, In.ar(0, 2)); }).add;

// allocate a disk i/o buffer
z= Buffer.alloc(s, 65536, 2);

// create an output file for this buffer, leave it open
z.write("~/pippo.wav".standardizePath, "wav", "int16", 0, 0, true);

x = Synth(\recordMe, [\buffer, z], addAction: \addToTail);

x.free; // when done recording

z.close; // close the file

z.free; // free the buffer

Leave a Reply