now all Buf* class def have a buffer object checking (plus typos and consistent parameter naming
parent
7005a2f299
commit
43fdf6dee3
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue