diff --git a/release-packaging/Classes/FluidBufScale.sc b/release-packaging/Classes/FluidBufScale.sc index 62c47e7..7c9f449 100644 --- a/release-packaging/Classes/FluidBufScale.sc +++ b/release-packaging/Classes/FluidBufScale.sc @@ -1,43 +1,43 @@ FluidBufScale : FluidBufProcessor { - *kr { |source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, destination, inputLow = 0, inputHigh = 1, outputLow = 0, outputHigh = 1, trig = 1, blocking = 1| - + *kr { |source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, destination, inputLow = 0, inputHigh = 1, outputLow = 0, outputHigh = 1, clipping = 0, trig = 1, blocking = 1| + source = source.asUGenInput; destination = destination.asUGenInput; source.isNil.if {"FluidBufScale: Invalid source buffer".throw}; destination.isNil.if {"FluidBufScale: Invalid destination buffer".throw}; - - ^FluidProxyUgen.kr(\FluidBufScaleTrigger, -1, source, startFrame, numFrames, startChan, numChans, destination, inputLow, inputHigh, outputLow, outputHigh, trig, blocking); + + ^FluidProxyUgen.kr(\FluidBufScaleTrigger, -1, source, startFrame, numFrames, startChan, numChans, destination, inputLow, inputHigh, outputLow, outputHigh, clipping, trig, blocking); } - *process { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, destination, inputLow = 0, inputHigh = 1, outputLow = 0, outputHigh = 1, freeWhenDone = true, action| - + *process { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, destination, inputLow = 0, inputHigh = 1, outputLow = 0, outputHigh = 1, clipping = 0, freeWhenDone = true, action| + source = source.asUGenInput; destination = destination.asUGenInput; source.isNil.if {"FluidBufScale: Invalid source buffer".throw}; destination.isNil.if {"FluidBufScale: Invalid destination buffer".throw}; - + ^this.new( server, nil, [destination] ).processList( - [source, startFrame, numFrames, startChan, numChans, destination, inputLow, inputHigh, outputLow, outputHigh, 0], freeWhenDone, action + [source, startFrame, numFrames, startChan, numChans, destination, inputLow, inputHigh, outputLow, outputHigh, clipping, 0], freeWhenDone, action ); } - *processBlocking { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, destination, inputLow = 0, inputHigh = 1, outputLow = 0, outputHigh = 1, freeWhenDone = true, action| - + *processBlocking { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, destination, inputLow = 0, inputHigh = 1, outputLow = 0, outputHigh = 1, clipping = 0, freeWhenDone = true, action| + source = source.asUGenInput; destination = destination.asUGenInput; source.isNil.if {"FluidBufScale: Invalid source buffer".throw}; destination.isNil.if {"FluidBufScale: Invalid destination buffer".throw}; - + ^this.new( server, nil, [destination] ).processList( - [source, startFrame, numFrames, startChan, numChans, destination, inputLow, inputHigh, outputLow, outputHigh, 1], freeWhenDone, action + [source, startFrame, numFrames, startChan, numChans, destination, inputLow, inputHigh, outputLow, outputHigh, clipping, 1], freeWhenDone, action ); } } diff --git a/release-packaging/HelpSource/Classes/FluidBufScale.schelp b/release-packaging/HelpSource/Classes/FluidBufScale.schelp index 7107e5c..cecfc24 100644 --- a/release-packaging/HelpSource/Classes/FluidBufScale.schelp +++ b/release-packaging/HelpSource/Classes/FluidBufScale.schelp @@ -49,6 +49,9 @@ The output value when the input is inputLow ARGUMENT:: outputHigh The output value when the input is inputHigh +ARGUMENT:: clipping +Optional clipping of the input (and therefore of the output). 0 is none. 1 caps the lowest input at inputLow. 2 caps the highest input at inputHigh, 3 caps both input low and high value within the described range. + ARGUMENT:: freeWhenDone Free the server instance when processing complete. Default true