You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
1.2 KiB
Python
22 lines
1.2 KiB
Python
FluidBufAmpSlice{
|
|
*process { arg server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, indices, absRampUp = 10, absRampDown = 10, absThreshOn = -40, absThreshOff = -40, minSliceLength = 1, minSilenceLength = 1, minLengthAbove = 1, minLengthBelow = 1, lookBack = 0, lookAhead = 0, relRampUp = 1, relRampDown = 1, relThreshOn = -144, relThreshOff = -144, highPassFreq = 250, outputType = 0, action;
|
|
|
|
var maxSize = max(minLengthAbove + lookBack, max(minLengthBelow,lookAhead));
|
|
|
|
source = source.asUGenInput;
|
|
indices = indices.asUGenInput;
|
|
|
|
source.isNil.if {"FluidBufAmpSlice: Invalid source buffer".throw};
|
|
indices.isNil.if {"FluidBufAmpSlice: Invalid features buffer".throw};
|
|
|
|
server = server ? Server.default;
|
|
|
|
forkIfNeeded{
|
|
server.sendMsg(\cmd, \BufAmpSlice, source, startFrame, numFrames, startChan, numChans, indices, absRampUp, absRampDown, absThreshOn, absThreshOff, minSliceLength, minSilenceLength, minLengthAbove, minLengthBelow, lookBack, lookAhead, relRampUp, relRampDown, relThreshOn, relThreshOff, highPassFreq, maxSize, outputType);
|
|
server.sync;
|
|
indices = server.cachedBufferAt(indices); indices.updateInfo; server.sync;
|
|
action.value(indices);
|
|
};
|
|
}
|
|
}
|