generalized scaling mapper
Hello,
After so many years, it is still a hassle to properly map in/outs in Max/MSP :
- The scale object does not work in log mode, but only in exp mode and with odd values.
- Reversing it produces range bugs (min max are mismatched)
- The linedrive object does not have a curve message to modify it and outputs line format lists and does not have a log curve either.
- Clipping is not included
...
There should be a max standard generalized mapper object, like scale but mutch better :
- scaling values with curve
- log/exp with a single +- arg, inlet and message
- fixed limits, whatever values you choose (reversible; positive, negative or zero and changing the curve dynamically)
- clipable
- managing lists
- signal version, (maybe a jitter version...?)
(Some time ago Tristan Jehan did a good "mapper" external which is a good guideline example, even if it is quite heavy, does not take lists, uses messages uneasy for beginners...)
Thanks
R.C.
Thank you for reminding me. I needed to add this for future documentation. I hope you find it useful.
use expr ((($f1-$f2)/($f3-$f2))*($f5-$f4))+$f4 which at least properly supports negative ranges.
if exponential distortion would really belong into a "general" scaling abstraction or object is questionable IMO. (why include log and exp but not quadratic or hyperbolic tangens?)
j.map does everything you need (and probably more !) (clipping, supports lists, many functions available, ...)
j.map is part of the Jamoma package (available in the Package Manager)
Thank you Mathieu, Roman and Ernest for your links and solutions, which actually show the need of this objet within Max.
Ernest tracker object offers S curve, Roman asks for quadratic , hyperboles and tangents. I suppose these features requests should be added and discussed if Cycling74 feels concerned about this issue.
I am aware of the unlimited range of the mapping question, but Max design allows artists-programmers to produce expressive results without advanced maths.
my main scaling abstraction contains 20 different types of distortion.
but this also means that it contains an additional gate object in the data flow, and further 100 objjects in parallel, which are not needed in 95% of the cases.
so it is wise to have a simple one too, which does nothing but the expr from above.
Note quite correct, Roland. First, my solution also provides linear, or dual-segment linear output with breakpoint, by setting curve to zero, and hyperbolic or inverse hyperbolic curves by positioning the breakpoint on the axis. Second, as the notes state, it does not require any maths, as you can use the function object directly to do what you want without any equations. I recommend having another look at the function object.
and what do you think happens inside the function object? ;)
It is documented what happens inside the function object.
aha. and this documentation says it can scale to log" without any math"?
well, then let´s hope they didnt copy the code from [scale], [meter~] and some other of the object which obviosly do it without math^^ ... which you can see because they dont operate properly.
This discussion shows that such an object or maybe a small set of objects would be great anyway.
(Sorry for my english, I meant musicians should be able to obtain fine mapping without maths.)
Sorry for the English, but from what you have written, the function object already does do what you want. You just have to set up the points in it.
i guess i need some language training, too; you both misunderstood my posts.
Function is a good object to edit functions including curve but is not suitable for general mapping purposes.
Good when you need graphics to ajust and visualize. As you may use the pen tool to redraw a waveform but not to design sounds.
Not good because:
- long to set limits,
- unprecise for math operations, for example when scaling then transform and then want to retreive orginal frame values after transformation
- has to connect with other objects sometimes inadequate
- not dynamic, slow change (graphic scheduling)
...
The Scale object if for me the best candidate, if it was sound and complete.
The specifications listed above could be a start.
Roman, where please can we find your mapping abstraction for the discussion ?
expr ((($f1-$f2)/($f3-$f2))*($f5-$f4))+$f4 is good. I have used it a lot in the past years, as well as other math functions, but I can't remember nor really master them, nor teach them to my sudents. They take me out of my initial artistic purposes.
Best regards
Roland
Many years later, this question still has no standard Max solution...
The scaling curve part might be handled by pipo scale, please check if all your options work, @Roland.
Jamoma had all this functionality and a useful GUI, but is no longer maintained, only starting to be replaced by OSSIA.
However, on the Max side, there is now gen, snapshots, Live functionality that might help to do this properly.