From c663657c72f04a838b02b2a16ff0677890177596 Mon Sep 17 00:00:00 2001 From: Pierre Alexandre Tremblay Date: Wed, 16 Sep 2020 10:14:49 +0100 Subject: [PATCH] bufthresh and bufscale now with verbose parameter names (and corrected an error in the examples of the latter) --- release-packaging/Classes/FluidBufScale.sc | 16 ++++++------- release-packaging/Classes/FluidBufThresh.sc | 16 ++++++------- .../HelpSource/Classes/FluidBufScale.schelp | 24 +++++++++---------- .../HelpSource/Classes/FluidBufThresh.schelp | 2 +- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/release-packaging/Classes/FluidBufScale.sc b/release-packaging/Classes/FluidBufScale.sc index 6431c89..3fd8360 100644 --- a/release-packaging/Classes/FluidBufScale.sc +++ b/release-packaging/Classes/FluidBufScale.sc @@ -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 ); } } diff --git a/release-packaging/Classes/FluidBufThresh.sc b/release-packaging/Classes/FluidBufThresh.sc index b84d034..30ba0fd 100644 --- a/release-packaging/Classes/FluidBufThresh.sc +++ b/release-packaging/Classes/FluidBufThresh.sc @@ -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 ); } } diff --git a/release-packaging/HelpSource/Classes/FluidBufScale.schelp b/release-packaging/HelpSource/Classes/FluidBufScale.schelp index 900762c..935fd5a 100644 --- a/release-packaging/HelpSource/Classes/FluidBufScale.schelp +++ b/release-packaging/HelpSource/Classes/FluidBufScale.schelp @@ -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) :: diff --git a/release-packaging/HelpSource/Classes/FluidBufThresh.schelp b/release-packaging/HelpSource/Classes/FluidBufThresh.schelp index fc994d7..3540851 100644 --- a/release-packaging/HelpSource/Classes/FluidBufThresh.schelp +++ b/release-packaging/HelpSource/Classes/FluidBufThresh.schelp @@ -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