Classes (extension) | Libraries > JoshUGens | UGens > FFT

PV_NoiseSynthP : PV_ChainUGen : WidthFirstUGen : UGen : AbstractFunction : Object
ExtensionExtension

Return only bins that are unstable
Source: JoshPV.sc

Description

PV_NoiseSynthP and PV_PartialSynthP base these decisions on whether or not phase data across numFrames is within a given threshold.

Class Methods

PV_NoiseSynthP.new(buffer, threshold: 0.1, numFrames: 2, initflag: 0)

Arguments:

buffer

The FFT buffer.

threshold

A phase value (in radians) with which to allow values to pass through or be zeroed out.

numFrames

The number of FFT frames needed to make the above decision.

initflag

If 0, all bins are zeroed out while the initial is calculated. If 1, all bins pass through.

Inherited class methods

Instance Methods

Inherited instance methods

Examples

s.boot;

{SinOsc.ar(440, 0, 0.5) + PinkNoise.ar(0.4)}.play; // a sample sig

(SynthDef(\partialsynth, {arg fftbuf;
 var in, chain, out;
 in = SinOsc.ar(440, 0, 0.5) + PinkNoise.ar(0.4);
 chain = FFT(fftbuf, in);
  // resynhtesize according to MouseX if 0, only sound with VERY stable changes of phase
  // will be returned. If pi, everything will be returned (+ or - pi)
 chain = PV_PartialSynthP(chain, MouseX.kr(0, pi));
 out = IFFT(chain);
 Out.ar(0, out.dup);
 }).add;
)

// the fft buf
s.sendMsg(\b_alloc, 0, 2048);

// start the synth
s.sendMsg(\s_new, \partialsynth, z = s.nextNodeID, 0, 1, \fftbuf, 0);
// free it
s.sendMsg(\n_free, z);
s.sendMsg(\b_free, 0);

(SynthDef(\noisesynth, {arg fftbuf;
 var in, chain, out;
 in = SinOsc.ar(440, 0, 0.5) + PinkNoise.ar(0.4);
 chain = FFT(fftbuf, in);
  // resynhtesize according to MouseX if 0, every thing will be returned... as the value
  // increases, bins with VERY stable change of phase are zeroed out, until everything is
  // at +-pi
 chain = PV_NoiseSynthP(chain, MouseX.kr(0, pi));
 out = IFFT(chain);
 Out.ar(0, out.dup);
 }).add;
)

// the fft buf
s.sendMsg(\b_alloc, 0, 2048);

// start the synth
s.sendMsg(\s_new, \noisesynth, z = s.nextNodeID, 0, 1, \fftbuf, 0);
// free it
s.sendMsg(\n_free, z);
s.sendMsg(\b_free, 0);


s.quit