scaling maths help

    Oct 11 2013 | 2:39 pm
    Help! I'm looking for a way of scaling values to make a better/different feeling volume control. (in this case from lemur values 0. - 1. into [live.gain~], but also potentially between other controllers & objects).
    [scale] doesn't help - I don't want exponential, but something more like log without the sudden drop at the end, however my maths & skills with [expr] are lacking, and [atodb] not quite what I want. Surely there's a way of creating a log-like curve with control over the slope?

    • Oct 11 2013 | 5:38 pm
      You can try with this exp scale :
      change the value of exponent to get the curve you like !
      However these are exponential curves...
    • Oct 11 2013 | 7:05 pm
      your idea is right to use some extra bits on the lower end of a GUI control, and not only a linear to log conversion.
      thats what most commercial audio apps do.
      to do so, i would split the control data somewhere at 5-10% and then apply a different curve onto the lower part. just try out different methodss until you like the result.
      you can also use a slower interpolation time (of say 150 ms, as opposed to the rest of the slider, where you would use 30-40 ms) on the low end part, so that you do not get those "drops" between "slider at -90" and "slider at one pixel above "-90".
    • Oct 11 2013 | 10:34 pm
      try this-- uses quadratic remapping i think (been a while since i patched it) but works well for me when using a midi controller (0-127)
    • Oct 12 2013 | 3:20 am
      In simple descriptive terms, what kind of curve do you want? In other words, in relation to the linear tracking of a given slider input, what kind of output motion do you want? If it's not linear, then it will be slower or faster than the input at different points from 0 to 1. Do you want more of a gradual start with a faster finish? A quicker start with a slower finish? Or a maybe a mixture.. more of a slow start with a faster middle that slows down again at the end? etc. For other applications you can also make more complex motions like bouncing, snapping, stepping, etc.
      Check out Robert Penner's easing algorithms. It's a great sampling of many basic forms of linear interpolation. Examples here:
      If you are interested in any of them, I ported all of his easing equations into Max. They work great and offer many options.
      Roman also has a pretty kick ass collection of abstractions available on this thread: with several options for mapping and scaling the range of the output.
    • Oct 12 2013 | 3:27 am
      This is what I used as the basis for porting his equations into Max..
      It's pretty straightforward using expr & if.
    • Oct 12 2013 | 3:31 am
      floating point, your abstraction contains a non-standard object named QuadMapper... post it so that we may absorb it.
    • Oct 12 2013 | 3:50 am
      whoops, didn't realise I was so organised and actually made an abstraction--
    • Oct 12 2013 | 8:08 am
      Thanks to everyone for your input - there is lots for me to explore but it will be a day or two before I can get back to max and to absorb this. I think I might want something like an 's-curve' - flatter at top and bottom and steeper in the middle, but I'll just have to try options to see what they sound like. I like Roman's idea of splitting the data & applying different interpolation.
    • Oct 12 2013 | 9:49 am
      Hi, i'm having similar problems, so i reckon it's ok if i post here. (please tell me if you think i should open another topic)
      i am observing a live track's output meter and i want to display the level on a meter~ so i can have it on the mira.frame. i tried several thing to match the meter~ and the live.meter~ without success. Any help would be awesome !
    • Oct 12 2013 | 2:54 pm
      I think I might want something like an ‘s-curve’
      Sounds like a job for half-cosine-man.
      Something like the following, assuming input and output in the unit range: [expr 0.5*(1-cos($f1*1.570796))].
      Caveat: off the cuff, untested. If you grok what's going on, you can fix any mistakes I've made. If you don't grok, ask and someone (possibly yours truly) will explain.
      RECTO: the factor inside the cos() should be 3.141596, of course.
    • Oct 12 2013 | 10:28 pm
      I think I might want something like an ‘s-curve’ – flatter at top and bottom and steeper in the middle, but I’ll just have to try options to see what they sound like.
      Here ya go...
    • Oct 13 2013 | 7:54 am
      Thanks metamax - beautiful implementation & very clear to see the results. Looking forward to getting into the studio to listen to all of these solutions.
    • Oct 16 2013 | 12:52 pm
      i'd like to thank you as well, metamax. It seems to be very useful maths expressions !
    • Oct 16 2013 | 1:02 pm
      Cool.. glad it helped.
      You guys should really check out Roman's collection... His explanation is in the thread link I posted above. His kung fu is strong.