Converting Linear Data Stream to Logarithmic
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!
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.
the one thing is scaling. the other thing is interpolation.
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?
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).
There's this part of it too (combined it's too big to copy/paste into forum).
Here are a few S-curves that are used in motion tweening.
Ooh, those are nice. *saved to scaling/remapping/curve patch*
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!
Rodrigo, thanks! I have more than a couple of your patches in my collection.
Something like this?
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
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?
you all know what we would normally use first in place when converting linear to frequency, dont you.
you all know what we would normally use first in place when converting linear to frequency, dont you.
Some sort of table lookup?
mtof of course
Rodrigo, these are fantastic, thanks!