corrected the signature of all NRT buffer pointing class definition (fdNMF and fdTransients) to make them more sc. - and changed all the test code accordingly.
corrected a bug in the fdTransients \cmd def (s missing) made a backbone helpfile for fdTransients corrected an error in helpfile of FSDTFTnix
parent
50027f1ca3
commit
059ef7d3a1
@ -0,0 +1,39 @@
|
||||
s.reboot
|
||||
////////////////////////////
|
||||
// test for efficiency
|
||||
|
||||
(
|
||||
b = Buffer.read(s,"/Users/pa/Documents/documents@hudd/research/projects/fluid corpus navigation/research/archives-2017-18/denoise_stn/sources/01-mix.wav");
|
||||
c = Buffer.new(s);
|
||||
d = Buffer.new(s);
|
||||
)
|
||||
|
||||
(
|
||||
// without basic params
|
||||
Routine{
|
||||
t = Main.elapsedTime;
|
||||
FDTransients.process(s,b.bufnum, transBufNum:c.bufnum, resBufNum:d.bufnum);
|
||||
s.sync;
|
||||
(Main.elapsedTime - t).postln;
|
||||
}.play
|
||||
);
|
||||
|
||||
c.query;
|
||||
c.play;
|
||||
d.query;
|
||||
d.play;
|
||||
|
||||
//nullsumming tests
|
||||
{(PlayBuf.ar(1,c.bufnum))+(PlayBuf.ar(1,d.bufnum))+(-1*PlayBuf.ar(1,b.bufnum,doneAction:2))}.play
|
||||
|
||||
|
||||
// with everything changed to make it much faster
|
||||
(
|
||||
Routine{
|
||||
t = Main.elapsedTime;
|
||||
FDTransients.process(s,b.bufnum, 44100, 44100, 0, 0, c.bufnum, d.bufnum, 100, 512,256,1,2,1,12,20);
|
||||
s.sync;
|
||||
(Main.elapsedTime - t).postln;
|
||||
}.play
|
||||
);
|
||||
|
||||
@ -1,16 +1,13 @@
|
||||
FDNMF {
|
||||
*process { arg server, srcBuf, startAt = 0, nFrames = -1,startChan = 0,nChans = -1, dstBuf, dictBuf, dictFlag = 0, actBuf, actFlag = 0, rank = 1, iterations = 100, sortFlag = 0, windowSize = 1024, hopSize = 256, fftSize = -1, windowType = 0, randomSeed = -1;
|
||||
*process { arg server, srcBufNum, startAt = 0, nFrames = -1, startChan = 0, nChans = -1, dstBufNum, dictBufNum, dictFlag = 0, actBufNum, actFlag = 0, rank = 1, iterations = 100, sortFlag = 0, windowSize = 1024, hopSize = 256, fftSize = -1, windowType = 0, randomSeed = -1;
|
||||
|
||||
var dstBufNum,dictBufNum,actBufNum;
|
||||
|
||||
if(srcBuf.bufnum.isNil) { Error("Invalid buffer").format(thisMethod.name, this.class.name).throw};
|
||||
if(srcBufNum.isNil) { Error("Invalid buffer").format(thisMethod.name, this.class.name).throw};
|
||||
|
||||
server = server ? Server.default;
|
||||
dstBufNum = dstBufNum ? -1;
|
||||
dictBufNum = dictBufNum ? -1;
|
||||
actBufNum = actBufNum ? -1;
|
||||
|
||||
dstBufNum = if(dstBuf.isNil, -1, {dstBuf.bufnum});
|
||||
dictBufNum = if(dictBuf.isNil, -1, {dictBuf.bufnum});
|
||||
actBufNum = if(actBuf.isNil, -1, {actBuf.bufnum});
|
||||
|
||||
server.sendMsg(\cmd, \BufNMF, srcBuf.bufnum, startAt, nFrames, startChan, nChans, dstBufNum, dictBufNum, dictFlag, actBufNum, actFlag, rank, iterations, windowSize, hopSize,fftSize);
|
||||
server.sendMsg(\cmd, \BufNMF, srcBufNum, startAt, nFrames, startChan, nChans, dstBufNum, dictBufNum, dictFlag, actBufNum, actFlag, rank, iterations, windowSize, hopSize,fftSize);
|
||||
}
|
||||
}
|
||||
@ -1,16 +1,12 @@
|
||||
FDTransients {
|
||||
*process { arg server, srcBuf, startAt = 0, nFrames = -1, startChan = 0, nChans = -1, transBuf, resBuf, order = 200, blockSize = 2048, padding = 1024, skew = 0, threshFwd = 3, threshBack = 1.1, windowSize = 14, debounce = 25;
|
||||
*process { arg server, srcBufNum, startAt = 0, nFrames = -1, startChan = 0, nChans = -1, transBufNum, resBufNum, order = 200, blockSize = 2048, padding = 1024, skew = 0, threshFwd = 3, threshBack = 1.1, windowSize = 14, debounce = 25;
|
||||
|
||||
var transBufNum,resBufNum;
|
||||
|
||||
if(srcBuf.bufnum.isNil) { Error("Invalid buffer").format(thisMethod.name, this.class.name).throw};
|
||||
if(srcBufNum.isNil) { Error("Invalid buffer").format(thisMethod.name, this.class.name).throw};
|
||||
|
||||
server = server ? Server.default;
|
||||
transBufNum = transBufNum ? -1;
|
||||
resBufNum = resBufNum ? -1;
|
||||
|
||||
transBufNum = if(transBuf.isNil, -1, {transBuf.bufnum});
|
||||
resBufNum = if(resBuf.isNil, -1, {resBuf.bufnum});
|
||||
|
||||
server.sendMsg(\cmd, \BufTransient,
|
||||
srcBuf.bufnum, startAt, nFrames, startChan, nChans, transBufNum, resBufNum, order, blockSize, padding, skew, threshBack, windowSize, debounce);
|
||||
server.sendMsg(\cmd, \BufTransients, srcBufNum, startAt, nFrames, startChan, nChans, transBufNum, resBufNum, order, blockSize, padding, skew, threshFwd, threshBack, windowSize, debounce);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue