FluidRobustScale: works with the old interface

nix
Pierre Alexandre Tremblay 5 years ago
parent b003b7a759
commit 7f41959d63

@ -1,14 +1,14 @@
FluidRobustScale : FluidRealTimeModel {
var <>min, <>max, <>invert;
var <>min, <>max, <>low, <>high, <>invert;
*new {|server, min = 0, max = 1, invert = 0|
^super.new(server,[min,max,invert])
.min_(min).max_(max).invert_(invert);
*new {|server, min = 0, max = 1, low = 0, high = 100, invert = 0|
^super.new(server,[min,max,low,high,invert])
.min_(min).max_(max).low_(low).high_(high).invert_(invert);
}
prGetParams{
^[this.min,this.max,this.invert,-1,-1];
^[this.min,this.max,this.low,this.high,this.invert,-1,-1];
}
@ -52,16 +52,18 @@ FluidRobustScale : FluidRealTimeModel {
this.prSendMsg(this.transformPointMsg(sourceBuffer, destBuffer));
}
kr{|trig, inputBuffer,outputBuffer,min,max,invert|
kr{|trig, inputBuffer,outputBuffer,min,max,low,high,invert|
min = min ? this.min;
max = max ? this.max;
invert = invert ? this.invert;
low = low ? this.low;
high = high ? this.high;
invert = invert ? this.invert;
this.min_(min).max_(max).invert_(invert);
this.min_(min).max_(max).low_(low).high_(high).invert_(invert);
^FluidProxyUgen.kr(this.class.name.asString++'/query', K2A.ar(trig),
id, this.min, this.max, this.invert, this.prEncodeBuffer(inputBuffer), this.prEncodeBuffer(outputBuffer));
id, this.min, this.max, this.low, this.high, this.invert, this.prEncodeBuffer(inputBuffer), this.prEncodeBuffer(outputBuffer));
}

@ -20,6 +20,10 @@ ARGUMENT:: min
Minimum output value, default 0
ARGUMENT:: max
Maximum output value, default 1
ARGUMENT:: low
Maximum output value, default 1
ARGUMENT:: high
Maximum output value, default 1
ARGUMENT:: invert
The direction in which the normalization will occur for transform and transformpoint. The default 0 is taking in the range of the input used to fit and transforms it towards the normalised range. A value of 1 will expect an input of the normalized range to transform back to the original range.

Loading…
Cancel
Save