updated FDNMF test code, helpfile-in-progress and class description (and filename)

corrected FDSTFTPass class description and helpfile
corrected FDGain helpfile
nix
Pierre Alexandre Tremblay 7 years ago
parent a34cbe6afd
commit 8302eefdb8

@ -17,7 +17,7 @@ y = Buffer.new(s);
// without sources
r = Routine{
t = Main.elapsedTime;
FDNMF.nmf(s,b,0,-1,0,-1,nil,x,0,y,0,5,100,~frame_size,~hop_size,~fft_size);
FDNMF.nmf(s,b,0,-1,0,-1,nil,x,0,y,0,5,100,0,~frame_size,~hop_size,~fft_size);
s.sync;
(Main.elapsedTime - t).postln;
}.play
@ -27,7 +27,7 @@ r = Routine{
(
r = Routine{
t = Main.elapsedTime;
FDNMF.nmf(s,b, 0,-1,0,-1,c,nil,0,nil,0,5,100,~frame_size,~hop_size,~fft_size);
FDNMF.nmf(s,b, 0,-1,0,-1,c,nil,0,nil,0,5,100,0,~frame_size,~hop_size,~fft_size);
s.sync;
(Main.elapsedTime - t).postln;
}.play
@ -78,6 +78,7 @@ c.plot;x.plot; y.plot;
// test with stereo input
Buffer.freeAll(s)
b.play
(
b = Buffer.read(s,"/Users/pa/Desktop/verystereo.wav");
@ -92,12 +93,12 @@ y = Buffer.new(s);
(
r = Routine{
t = Main.elapsedTime;
FDNMF.nmf(s,b,0,-1,0,-1,c,x,0,y,0,5,100,~frame_size,~hop_size,~fft_size);
FDNMF.nmf(s,b,0,-1,0,-1,c,x,0,y,0,5,100,0,~frame_size,~hop_size,~fft_size);
s.sync;
(Main.elapsedTime - t).postln;
}.play
)
{PlayBuf.ar(10,c.bufnum,doneAction:2)[2].dup}.play
{PlayBuf.ar(10,c.bufnum,doneAction:2)[9].dup}.play
c.getn(0, 10, {|x|x.postln})

@ -1,5 +1,5 @@
class:: FDGain
summary:: Real-Time Gain Changer
summary:: Real-Time Buffered Gain Changer
categories:: UGens>Algebraic
related::Classes/UnaryOpFunction
@ -15,21 +15,13 @@ ARGUMENT:: in
The input to be processed
ARGUMENT:: frameSize
The size of the real-time i/o buffer. It will add that much latency to the signal.
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
Audio or control rate change of the gain.
returns:: nothing
INSTANCEMETHODS::
METHOD:: checkInputs
This makes sure the value and phase inputs are both at audio rate.
returns::
A slap on the wrist, should it not be the case.
Same as input, delayed by the windowSize, multiplied by the gain factor.
EXAMPLES::
Summing with the inverse (gain of -1) with a delay of the latency gives us CPU-expensive silence.
@ -38,9 +30,9 @@ EXAMPLES::
::
Varying the gain at audio rate.
code::
{ FDGain.ar(PinkNoise.ar(0.1), gain:LFSaw.ar(1)) }.play
{ FDGain.ar(PinkNoise.ar(0.1), gain:LFTri.ar(1)) }.play
::
Varying the gain at comtrol rate.
Varying the gain at comtrol rate, in beautiful stereo.
code::
{ FDGain.ar(PinkNoise.ar(0.1), gain:LFSaw.kr(0.5)) }.play
{ FDGain.ar(SinOsc.ar([222,333],mul:0.1), gain:LFTri.kr([0.5,0.7])) }.play
::

@ -79,7 +79,6 @@ INSTANCEMETHODS::
EXAMPLES::
code::
b = Buffer.read(s,"../../AudioFiles/01-mix.wav".resolveRelative);
thisProcess.nowExecutingPath
b = Buffer.read(s,"../../../AudioFiles/01-mix.wav".resolveRelative);
b.play
::

@ -6,8 +6,6 @@ FDNMF {
if(srcBuf.bufnum.isNil) { Error("Invalid buffer").format(thisMethod.name, this.class.name).throw};
dstBuf.bufnum.postln;
server.sendMsg(\cmd, \BufNMF,
srcBuf.bufnum, startAt, nFrames, startChan, nChans,
if(dstBuf.isNil, -1, {dstBuf.bufnum}),

@ -1,2 +1,49 @@
//Ar modulator
{FDSTFTPass.ar(SinOsc.ar(440),1024,256,2048)}.play
TITLE:: FDSTFTPass
summary:: Real-Time FFT/IFFT return trip.
categories:: UGens>Algebraic
related:: Classes/UnaryOpFunction
DESCRIPTION::
A sanity test for the FluCoMa Real-Time Client FFT/IFFT Wrapper footnote::This was made possible thanks to the FluCoMa project (http://www.flucoma.org/) funded by the European Research Council (https://erc.europa.eu/) under the European Unions Horizon 2020 research and innovation programme (grant agreement No 725899).::
CLASSMETHODS::
METHOD:: ar
The audio rate version of the object.
ARGUMENT:: in
The input to be passed-through
ARGUMENT:: windowSize
The size of the buffered window to be analysed, in samples. It will add that much latency to the signal. This is not modulatable.
ARGUMENT:: hopSize
How much the buffered window moves forward, in samples. This is not modulatable.
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.
returns::
Same as input, delayed by the windowSize.
EXAMPLES::
code::
Summing with the inverse (gain of -1) with a delay of the latency gives us CPU-expensive silence.
code::
{ var source = PinkNoise.ar(0.1); DelayN.ar(source, delaytime:1024/s.sampleRate, mul: -1) + FDSTFTPass.ar(source, 1024, 256, 1024); }.play
::
Larger, oversampled, FFT
code::
{ FDSTFTPass.ar(PinkNoise.ar(0.1), 2048, 128, 8192) }.play
::
Stereo Input Tests.
code::
{ FDSTFTPass.ar([SinOsc.ar(222,mul: 0.1), PinkNoise.ar(Decay.ar(Impulse.ar(0.666,mul: 0.1), 0.5))], fftSize:1024)}.play
::
Stereo Parameter Tests.
code::
{ FDSTFTPass.ar(SinOsc.ar(222,mul: 0.1), [1024,8192],256,8192)}.play
::

@ -1,5 +1,5 @@
FDSTFTPass : UGen {
*ar { arg in = 0, windowsize=1024, hopsize=256, fftsize=windowsize;
^this.multiNew('audio', in.asAudioRateInput(this),windowsize, hopsize, fftsize)
*ar { arg in = 0, windowSize= 1024, hopSize= 256, fftSize= -1;
^this.multiNew('audio', in.asAudioRateInput(this),windowSize, hopSize, fftSize)
}
}

Loading…
Cancel
Save