now all Buf* class def have a buffer object checking (plus typos and consistent parameter naming

nix
Pierre Alexandre Tremblay 7 years ago
parent 7005a2f299
commit 43fdf6dee3

@ -1,6 +1,9 @@
FluidBufCompose{
*process { arg server, srcBufNum, startAt = 0, nFrames = -1, startChan = 0, nChans = -1, srcGain = 1, dstBufNum, dstStartAt = 0, dstStartChan = 0, dstGain = 0;
srcBufNum = srcBufNum.asUGenInput;
dstBufNum = dstBufNum.asUGenInput;
if(srcBufNum.isNil) {Error("Invalid Buffer").format(thisMethod.name, this.class.name).throw};
if(dstBufNum.isNil) {Error("Invalid Buffer").format(thisMethod.name, this.class.name).throw};

@ -3,6 +3,11 @@ FluidBufHPSS{
var maxFFTSize = if (fftSize == -1) {winSize.nextPowerOfTwo} {fftSize};
srcBufNum = srcBufNum.asUGenInput;
harmBufNum = harmBufNum.asUGenInput;
percBufNum = percBufNum.asUGenInput;
resBufNum = resBufNum.asUGenInput;
if(srcBufNum.isNil) { Error("Invalid buffer").format(thisMethod.name, this.class.name).throw};
server = server ? Server.default;

@ -1,6 +1,12 @@
FluidBufNMF {
*process { arg server, srcBufNum, startAt = 0, nFrames = -1, startChan = 0, nChans = -1, dstBufNum, dictBufNum, dictFlag = 0, actBufNum, actFlag = 0, rank = 1, nIter = 100, sortFlag = 0, winSize = 1024, hopSize = -1, fftSize = -1, winType = 0, randSeed = -1;
srcBufNum = srcBufNum.asUGenInput;
dstBufNum = dstBufNum.asUGenInput;
dictBufNum = dictBufNum.asUGenInput;
actBufNum = actBufNum.asUGenInput;
if(srcBufNum.isNil) { Error("Invalid buffer").format(thisMethod.name, this.class.name).throw};
server = server ? Server.default;

@ -3,6 +3,9 @@ FluidBufNoveltySlice{
//var maxFFTSize = if (fftSize == -1) {winSize.nextPowerOfTwo} {fftSize}; //ready for when we need it from the RT wrapper
srcBufNum = srcBufNum.asUGenInput;
indBufNum = indBufNum.asUGenInput;
if(srcBufNum.isNil) { Error("Invalid buffer").format(thisMethod.name, this.class.name).throw};
if(indBufNum.isNil) { Error("Invalid buffer").format(thisMethod.name, this.class.name).throw};

@ -1,15 +1,19 @@
FluidBufOnsetSlice{
*process { arg server, srcBufNum, startAt = 0, nFrames = -1, startChan = 0, nChans = -1, idxBufNum, function = 0, threshold = 0.1, debounce = 2, filterSize = 5, frameDelta = 0, winSize = 1024, hopSize = 256, fftSize = 1024, maxFFTSize = 16384;
*process { arg server, srcBufNum, startAt = 0, nFrames = -1, startChan = 0, nChans = -1, indBufNum, function = 0, threshold = 0.1, debounce = 2, filterSize = 5, frameDelta = 0, winSize = 1024, hopSize = -1, fftSize = -1;
if(srcBufNum.isNil) {Error("Invalid Buffer % %".format(this.class.name, thisMethod.name)).throw};
var maxFFTSize = if (fftSize == -1) {winSize.nextPowerOfTwo} {fftSize};
server = server ? Server.default;
idxBufNum = idxBufNum ? -1;
srcBufNum = srcBufNum.asUGenInput;
indBufNum = indBufNum.asUGenInput;
if(srcBufNum.isNil) { Error("Invalid buffer").format(thisMethod.name, this.class.name).throw};
if(indBufNum.isNil) { Error("Invalid buffer").format(thisMethod.name, this.class.name).throw};
server = server ? Server.default;
//NB For wrapped versions of NRT classes, we set the params for maxima to
//whatever has been passed in language-side (e.g maxFFTSize still exists as a parameter for the server plugin, but makes less sense here: it just needs to be set to a legal value)
server.sendMsg(\cmd, \BufOnsetSlice, srcBufNum, startAt, nFrames, startChan, nChans, idxBufNum, function, threshold, debounce, filterSize, frameDelta, winSize, hopSize, fftSize, maxFFTSize);
server.sendMsg(\cmd, \BufOnsetSlice, srcBufNum, startAt, nFrames, startChan, nChans, indBufNum, function, threshold, debounce, filterSize, frameDelta, winSize, hopSize, fftSize, maxFFTSize);
}
}

@ -3,6 +3,10 @@ FluidBufSines{
var maxFFTSize = if (fftSize == -1) {winSize.nextPowerOfTwo} {fftSize};
srcBufNum = srcBufNum.asUGenInput;
sineBufNum = sineBufNum.asUGenInput;
resBufNum = resBufNum.asUGenInput;
if(srcBufNum.isNil) {Error("Invalid Buffer").format(thisMethod.name, this.class.name).throw};
server = server ? Server.default;

@ -1,11 +1,14 @@
FluidBufTransientSlice{
*process { arg server, srcBufNum, startAt = 0, nFrames = -1, startChan = 0, nChans = -1, transBufNum, order = 20, blockSize = 256, padSize = 128, skew = 0, threshFwd = 2, threshBack = 1.1, winSize = 14, debounce = 25, minSlice = 1000;
*process { arg server, srcBufNum, startAt = 0, nFrames = -1, startChan = 0, nChans = -1, indBufNum, order = 20, blockSize = 256, padSize = 128, skew = 0, threshFwd = 2, threshBack = 1.1, winSize = 14, debounce = 25, minSlice = 1000;
srcBufNum = srcBufNum.asUGenInput;
indBufNum = indBufNum.asUGenInput;
if(srcBufNum.isNil) { Error("Invalid buffer").format(thisMethod.name, this.class.name).throw};
if(transBufNum.isNil) { Error("Invalid buffer").format(thisMethod.name, this.class.name).throw};
if(indBufNum.isNil) { Error("Invalid buffer").format(thisMethod.name, this.class.name).throw};
server = server ? Server.default;
server.sendMsg(\cmd, \BufTransientSlice, srcBufNum, startAt, nFrames, startChan, nChans, transBufNum, order, blockSize, padSize, skew, threshFwd, threshBack, winSize, debounce, minSlice);
server.sendMsg(\cmd, \BufTransientSlice, srcBufNum, startAt, nFrames, startChan, nChans, indBufNum, order, blockSize, padSize, skew, threshFwd, threshBack, winSize, debounce, minSlice);
}
}

@ -1,6 +1,10 @@
FluidBufTransients {
*process { arg server, srcBufNum, startAt = 0, nFrames = -1, startChan = 0, nChans = -1, transBufNum, resBufNum, order = 20, blockSize = 256, padSize = 128, skew = 0, threshFwd = 2, threshBack = 1.1, winSize = 14, debounce = 25;
srcBufNum = srcBufNum.asUGenInput;
transBufNum = transBufNum.asUGenInput;
resBufNum = resBufNum.asUGenInput;
if(srcBufNum.isNil) { Error("Invalid buffer").format(thisMethod.name, this.class.name).throw};
server = server ? Server.default;

@ -33,7 +33,7 @@ ARGUMENT:: startChan
ARGUMENT:: nChans
For multichannel srcBuf, how many channel should be summed.
ARGUMENT:: transBufNum
ARGUMENT:: indBufNum
The index of the buffer where the indices (in sample) of the estimated starting points of slices will be written. The first and last points are always the boundary points of the analysis.
ARGUMENT:: order

Loading…
Cancel
Save