generalized scaling mapper


    May 20 2016 | 11:08 am
    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.

    • May 20 2016 | 12:37 pm
      Thank you for reminding me. I needed to add this for future documentation. I hope you find it useful.
    • May 20 2016 | 3:32 pm
      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?)
    • May 20 2016 | 4:11 pm
      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)
    • May 21 2016 | 7:56 am
      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.
    • May 21 2016 | 8:49 am
      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.
    • May 21 2016 | 11:07 pm
      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.
    • May 21 2016 | 11:44 pm
      and what do you think happens inside the function object? ;)
    • May 22 2016 | 2:21 am
      It is documented what happens inside the function object.
    • May 22 2016 | 6:48 pm
      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.
    • May 22 2016 | 9:06 pm
      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.)
    • May 23 2016 | 12:21 pm
      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.
    • May 23 2016 | 8:15 pm
      i guess i need some language training, too; you both misunderstood my posts.
    • May 24 2016 | 7:38 am
      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