FluidRobustScale: Now with proper interface

nix
Pierre Alexandre Tremblay 5 years ago
parent cdfeca4582
commit e043d406fb

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

@ -16,10 +16,6 @@ METHOD:: new
Create a new instance Create a new instance
ARGUMENT:: server ARGUMENT:: server
The link::Classes/Server:: on which to run The link::Classes/Server:: on which to run
ARGUMENT:: min
Minimum output value, default 0
ARGUMENT:: max
Maximum output value, default 1
ARGUMENT:: low ARGUMENT:: low
Maximum output value, default 1 Maximum output value, default 1
ARGUMENT:: high ARGUMENT:: high

Loading…
Cancel
Save