Converting Linear Data Stream to Logarithmic


    Nov 07 2015 | 1:57 am
    I've started working with a Microsoft Kinect, and for now I've (arbitrarily) scaled the incoming data streams coming into Max to a 0-127 range. Some of the parameters I want to control are filter frequencies, which don't work well being controlled by the linear data I'm currently receiving.
    My question is: how would I go about changing the incoming linear data to a logarithmic scale suitable for use with frequency?
    I've tried a few methods so far, all of which either flat-out don't work, or end up being only vague approximations of the curve I need to generate, but I'd like to make this precise. I'm assuming it involves writing an equation with the [expr] object, but my math skills are pretty weak.
    Any help is appreciated, thank you!

    • Nov 07 2015 | 9:14 am
      Do you have specific equations in mind or just an idea of a curve? You can do all kinds of stuff.
      Here's a good starting point.
    • Nov 07 2015 | 2:57 pm
      the one thing is scaling. the other thing is interpolation.
    • Nov 07 2015 | 5:29 pm
      Just the idea of a curve, I think. I like the patch you posted Metamax, great for visualizing this, thanks.
      I ended up using a [linedrive] object with a 3rd argument of 1.06. This seems to get me the curve I'm looking for, but I don't understand the math behind it.
      Anyone have any answers as to why 1.06 seems to create the correct curve so that the frequency sweep seems to occur evenly across the range?
    • Nov 07 2015 | 7:56 pm
      This is my go-to curve tester patch. Lots of options and ways to go with it. I just go 0. to 1. and then scale it to the actual range (otherwise the scaling goes funny).
    • Nov 07 2015 | 7:58 pm
      There's this part of it too (combined it's too big to copy/paste into forum).
    • Nov 07 2015 | 10:01 pm
      Here are a few S-curves that are used in motion tweening.
    • Nov 07 2015 | 10:25 pm
      Ooh, those are nice. *saved to scaling/remapping/curve patch*
    • Nov 07 2015 | 11:14 pm
      I recently updated all of my interpolation patches to handle both lists and matrices (in Gen) with some interesting results. The most obvious affect in video is gamma but many variables can be associated with the output.
      Here is an example with lists. If someone has a more efficient solution to my use of the pipe object, I would be grateful.
      Enjoy!
    • Nov 07 2015 | 11:16 pm
      Rodrigo, thanks! I have more than a couple of your patches in my collection.
    • Nov 07 2015 | 11:34 pm
      Something like this?
    • Nov 08 2015 | 12:16 am
      Hmm.. I don't think so. Note the behavior of the sliders when manually adjusting the main slider in my last patch. Each list element is independently delayed. After releasing the slider, the effect doesn't just stop, it levels off. The delay time increases 100ms for each element. I was hoping a single object could do that. Some kind of stream/pipe thingy.
      /thread hijack
    • Nov 08 2015 | 12:34 am
      Yeah I see.
      Maybe some kind of [zl iter] -> [pipe 100] -> [zl group 16], so you don't have to manually increment the pipe that way?
    • Nov 08 2015 | 5:44 am
      you all know what we would normally use first in place when converting linear to frequency, dont you.
    • Nov 08 2015 | 7:45 am
      you all know what we would normally use first in place when converting linear to frequency, dont you.
      Some sort of table lookup?
    • Nov 08 2015 | 9:22 am
      mtof of course
    • Nov 08 2015 | 6:06 pm
      Rodrigo, these are fantastic, thanks!