On Fri, 2010-04-23 at 13:36 +0300, João Pais wrote:
is the formula somewhere? I found a parcial one by frank, but didn't
really work. and now I'm too busy to be chasing this.
I don't know "the" formula, but I did it by putting two "Dreisätze" (rules of three?) in a row: The first scales the input to 0-1, the second scales 0-1 to the output range. If written out as a formula, this could probably even made shorter, I don't know.
Check the attached scale_abs.pd (It lacks the log/lin switch feature, though).
Roman
P.S.: [maxlib/scale] seems to apply correct formulas, but the initialization seems to be buggy. After manually setting the ranges, it outputs correct values.
On Fri, 2010-04-23 at 13:12 +0300, João Pais wrote:
Hi,
I think I found a bug in maxlib/scale. Unless the order of the
parameters is aligned - smaller value as smaller input/output and bigger value for input/output -, the external doesn't work properly. Is this normal or desired? I always thought that the parameter order would be interchangeable without problems.Here's a patch to illustrate it:
Indeed, very wrong.
Unfortunately, from what I know maxlib is not maintained anymore by its original author (probably it can be considered 'community-maintained'). And since this can be nicely written as an abstraction, I'd say that the buggy external version should be avoided.
Roman