bufthresh and bufscale now with verbose parameter names (and corrected an error in the examples of the latter)

nix
Pierre Alexandre Tremblay 5 years ago
parent b6fdc78d12
commit c663657c72

@ -1,31 +1,31 @@
FluidBufScale : UGen {
*new1 { |rate, source, destination, inlo, inhi, outlo, outhi, trig = 1, blocking|
*new1 { |rate, source, destination, inputLow, inputHigh, outputLow, outputHigh, trig = 1, blocking|
source = source.asUGenInput;
destination = destination.asUGenInput;
source.isNil.if {"FluidBufScale: Invalid source buffer".throw};
destination.isNil.if {"FluidBufScale: Invalid destination buffer".throw};
^super.new1(rate, source, destination, inlo, inhi, outlo, outhi, trig, blocking);
^super.new1(rate, source, destination, inputLow, inputHigh, outputLow, outputHigh, trig, blocking);
}
*kr { |source, destination, inlo = 0 , inhi = 1, outlo = 0, outhi = 1, trig = 1, blocking = 1|
^this.new1('control', source, destination, inlo, inhi, outlo, outhi, trig, blocking);
*kr { |source, destination, inputLow = 0 , inputHigh = 1, outputLow = 0, outputHigh = 1, trig = 1, blocking = 1|
^this.new1('control', source, destination, inputLow, inputHigh, outputLow, outputHigh, trig, blocking);
}
*process { |server, source, destination, inlo = 0 , inhi = 1, outlo = 0, outhi = 1, action|
*process { |server, source, destination, inputLow = 0 , inputHigh = 1, outputLow = 0, outputHigh = 1, action|
^FluidNRTProcess.new(
server, this, action, [destination], blocking:1
).process(
source, destination, inlo, inhi, outlo, outhi
source, destination, inputLow, inputHigh, outputLow, outputHigh
);
}
*processBlocking { |server, source, destination, inlo = 0 , inhi = 1, outlo = 0 , outhi = 1, action|
*processBlocking { |server, source, destination, inputLow = 0 , inputHigh = 1, outputLow = 0 , outputHigh = 1, action|
^process(
source, destination, inlo, inhi, outlo, outhi
source, destination, inputLow, inputHigh, outputLow, outputHigh
);
}
}

@ -1,31 +1,31 @@
FluidBufThresh : UGen {
*new1 { |rate, source, destination, thresh = 0, trig = 1, blocking|
*new1 { |rate, source, destination, threshold = 0, trig = 1, blocking|
source = source.asUGenInput;
destination = destination.asUGenInput;
source.isNil.if {"FluidBufThresh: Invalid source buffer".throw};
destination.isNil.if {"FluidBufThresh: Invalid destination buffer".throw};
^super.new1(rate, source, destination, thresh, trig, blocking);
^super.new1(rate, source, destination, threshold, trig, blocking);
}
*kr { |source, destination, thresh = 0, trig = 1, blocking = 1|
^this.new1('control', source, destination, thresh, trig, blocking);
*kr { |source, destination, threshold = 0, trig = 1, blocking = 1|
^this.new1('control', source, destination, threshold, trig, blocking);
}
*process { |server, source, destination, thresh = 0, action|
*process { |server, source, destination, threshold = 0, action|
^FluidNRTProcess.new(
server, this, action, [destination], blocking:1
).process(
source, destination, thresh
source, destination, threshold
);
}
*processBlocking { |server, source, destination, thresh = 0, action|
*processBlocking { |server, source, destination, threshold = 0, action|
^process(
source, destination, thresh
source, destination, threshold
);
}
}

@ -3,7 +3,7 @@ SUMMARY:: A Scaling Processor for Buffers
CATEGORIES:: Libraries>FluidDecomposition
RELATED:: Guides/FluCoMa, Guides/FluidDecomposition, Guides/FluidBufMultiThreading
This class implements a simple Buffer preprocessor, by scaling its values. It draws a simple translation from inlo to outlo, and from inhi to outhi. It is part of the LINK:: Guides/FluidDecomposition:: of LINK:: Guides/FluCoMa::. For more explanations, learning material, and discussions on its musicianly uses, visit http://www.flucoma.org/
This class implements a simple Buffer preprocessor, by scaling its values. It draws a simple translation from inputLow to outputLow, and from inputHigh to outputHigh. It is part of the LINK:: Guides/FluidDecomposition:: of LINK:: Guides/FluCoMa::. For more explanations, learning material, and discussions on its musicianly uses, visit http://www.flucoma.org/
The process will return a buffer with the same size and shape than the original.
@ -25,17 +25,17 @@ The index of the buffer to use as the source material to be processed.
ARGUMENT:: destination
The index of the buffer to use as the destination for the processed material.
ARGUMENT:: inlo
the low reference point of the input. it will be scaled to yield outlo at the output
ARGUMENT:: inputLow
the low reference point of the input. it will be scaled to yield outputLow at the output
ARGUMENT:: inhi
the high reference point of the input. it will be scaled to yield outhi at the output
ARGUMENT:: inputHigh
the high reference point of the input. it will be scaled to yield outputHigh at the output
ARGUMENT:: outlo
the output value when the input is inlo
ARGUMENT:: outputLow
the output value when the input is inputLow
ARGUMENT:: outhi
the output value whenthe input is inhi
ARGUMENT:: outputHigh
the output value whenthe input is inputHigh
ARGUMENT:: action
A Function to be evaluated once the offline process has finished and indices instance variables have been updated on the client side. The metric will be passed indices as an argument.
@ -51,7 +51,7 @@ code::
b = Buffer.sendCollection(s,0.0.series(0.1,1.0))
// and a destination buffer
c = Buffer(s)
// play with the threshold
// play with the scaling
FluidBufScale.process(s,b,c,0,1,20,10)
// retrieve the buffer and enjoy the results.
c.getn(0,11,{|x|x.postln;})
@ -59,8 +59,8 @@ c.getn(0,11,{|x|x.postln;})
// also works in multichannel - explore the following buffer
b = Buffer.sendCollection(s,-10.0.series(-9,10.0).scramble,2)
b.plot.plotMode_(\points)
//process and keep just the top values
//process
FluidBufScale.process(s,b,c,-20,20,0,1)
//enjoy
//enjoy - same shape, different range
c.plot.plotMode_(\points)
::

@ -26,7 +26,7 @@ The index of the buffer to use as the source material to be processed.
ARGUMENT:: destination
The index of the buffer to use as the destination for the processed material.
ARGUMENT:: thresh
ARGUMENT:: threshold
The threshold under which values will be zeroed
ARGUMENT:: action

Loading…
Cancel
Save