Gain and STFTPass - post-refactor check and corrections

nix
Pierre Alexandre Tremblay 7 years ago
parent 474470c1f2
commit 1801dc8b91

@ -1,5 +1,5 @@
FluidSTFTPass : UGen { FluidSTFTPass : UGen {
*ar { arg in = 0, windowSize= 1024, hopSize= 256, fftSize= -1, maxFFTSize = 16384; *ar { arg in = 0, winSize= 1024, hopSize= -1, fftSize= -1, maxFFTSize = 16384;
^this.multiNew('audio', in.asAudioRateInput(this),windowSize, hopSize, fftSize, maxFFTSize) ^this.multiNew('audio', in.asAudioRateInput(this), winSize, hopSize, fftSize, maxFFTSize)
} }
} }

@ -16,20 +16,17 @@ METHOD:: ar
ARGUMENT:: in ARGUMENT:: in
The input to be processed The input to be processed
ARGUMENT:: frameSize
The size of the real-time i/o buffer, in samples. It will add that much latency to the signal. This is not modulatable.
ARGUMENT:: gain ARGUMENT:: gain
Audio or control rate change of the gain. Audio or control rate change of the gain.
RETURNS:: RETURNS::
Same as input, delayed by the frameSize, multiplied by the gain factor. Same as input, multiplied by the gain factor.
EXAMPLES:: EXAMPLES::
Summing with the inverse (gain of -1) with a delay of the latency gives us CPU-expensive silence. Summing with the inverse (gain of -1) with a delay of the latency gives us CPU-expensive silence.
CODE:: CODE::
{ var source = PinkNoise.ar(0.1); DelayN.ar(source,delaytime:1000/s.sampleRate) + FluidGain.ar(source,1000,-1); }.play { var source = PinkNoise.ar(0.1); source + FluidGain.ar(source,-1); }.play
:: ::
Varying the gain at audio rate. Varying the gain at audio rate.
CODE:: CODE::

@ -17,13 +17,17 @@ ARGUMENT:: in
The input to be passed-through The input to be passed-through
ARGUMENT:: winSize ARGUMENT:: winSize
The size of the buffered window to be analysed, in samples. It will add that much latency to the signal. This is not modulatable. The size of the buffered window to be analysed, in samples. It will add that much latency to the signal.
ARGUMENT:: hopSize ARGUMENT:: hopSize
How much the buffered window moves forward, in samples. This is not modulatable. How much the buffered window moves forward, in samples. The -1 default value will default to half of winSize (overlap of 2).
ARGUMENT:: fftSize ARGUMENT:: fftSize
How large will the FFT be, zero-padding the buffer to the right size, which should be bigger than the windowSize argument, bigger than 4 samples, and should be a power of 2. This is a way to oversample the FFT for extra precision. The -1 default value will default to windowSize. This is not modulatable. How large will the FFT be, zero-padding the buffer to the right size, which should be bigger than the windowSize argument, bigger than 4 samples, and should be a power of 2. This is a way to oversample the FFT for extra precision. The -1 default value will default to windowSize.
ARGUMENT:: maxFFTSize
How large can the FFT be, by allocating memory at instantiation time. This is not modulatable.
RETURNS:: RETURNS::
Same as input, delayed by the winSize. Same as input, delayed by the winSize.
@ -33,7 +37,7 @@ EXAMPLES::
Summing with the inverse (gain of -1) with a delay of the latency gives us CPU-expensive silence. Summing with the inverse (gain of -1) with a delay of the latency gives us CPU-expensive silence.
CODE:: CODE::
{ var source = PinkNoise.ar(0.1); DelayN.ar(source, delaytime:1024/s.sampleRate, mul: -1) + FluidSTFTPass.ar(source, 1024, 256, 1024); }.play { var source = PinkNoise.ar(0.1); DelayN.ar(source, delaytime:1024/s.sampleRate, mul: -1) + FluidSTFTPass.ar(source, 1024); }.play
:: ::
Larger, oversampled, FFT Larger, oversampled, FFT
CODE:: CODE::
@ -47,3 +51,11 @@ Stereo Parameter Tests.
CODE:: CODE::
{ FluidSTFTPass.ar(SinOsc.ar(222,mul: 0.1), [1024,8192],256,8192)}.play { FluidSTFTPass.ar(SinOsc.ar(222,mul: 0.1), [1024,8192],256,8192)}.play
:: ::
Modulating Window Param Tests.
CODE::
{ var source = SinOsc.ar(222,mul: 0.1); [source, FluidSTFTPass.ar(source,LFNoise0.kr(1).range(10,10000))] }.play
::
Very Short FFT test.
CODE::
{ var source = SinOsc.ar(222,mul: 0.1); [source, FluidSTFTPass.ar(source,10)] }.play
::

Loading…
Cancel
Save