Forums > MaxMSP

light function

April 13, 2012 | 12:26 am

hi,
does anyone have any method or any tool or any idea for remove some points in a function ?

if i have 100 points (like in motion capture), haw can i have less point ?

like a factorization or a simplification, in order to keep almost the same form of the function
even if the form is not exacty the same… like a smoother

i think it’s a known problem in math..
thanks


April 13, 2012 | 10:37 am

Is there any information in this thread that will help? It’s about interpolating between points in a function:

http://www.cycling74.com/forums/topic.php?id=25702

Brendan


April 13, 2012 | 12:03 pm

thanks, i’ve already seen this post,
but it’s about smoothing betwen points, not removing some of them (by the way, safunction is great, i’m waiting the pattr or write-file implementation)
ej.function allows removing same y point with different x, but it’s not enough


April 13, 2012 | 3:26 pm

Can you ‘remove’ points in realtime, with [snapshot~] or [speedlim]?

Chris Muir’s response here has kind of gained legendary status:

http://www.cycling74.com/forums/topic.php?id=15180

Brendan

sorry that my maths is too weak to help directly :(


April 13, 2012 | 3:58 pm

yes, i’ve implemanted a speedlim
smothing could be nice to, but it still record a lot of point..

My goal is to record data and allow a nice way to edit it simply. Like for making a score from an improvisation,
with number boxes wich are mapped to a numerical music or a visual instrument, lights or automates.

in adobe after effect for exmaple, it’s possible to smooth a function by removing keyframes and keep almost the same form of the interpolation.

after you move, change value, copy-paste keys,
it could be greate to do the same with some values in max ! by reducing the number of points and why not quantize thems, in a function curve.

I hope some algorythms already existing.. or i have to find great developers who can help me to do this tool. I’m sure it miss for music writers

cheers


April 13, 2012 | 6:48 pm

One simple way to approach this is to drastically subsample, taking the maxima and minima per sample frame. For example, if you were taking decimating (ten data points to two, in this case) you would take the highest and lowest of the ten points and output those as your two. I’ve used this technique to draw audio waveforms which were drastically compressed from the real audio file.


April 14, 2012 | 6:55 pm

you could work with two [function] objects, one is the original. Grab every X number of points from the original one and put it into the new one, voila, downsample. This doesn’t take the values into account, so you can’t guarantee the same rough overall form, but it might be a start.


April 14, 2012 | 10:44 pm

an idea is to estimate Y-delta between two consecutive points (A and B). If the Y-delta bewteen the B and C points is almsot the same (with a tolerance), i estimate Ydelta between B and C and remove the B point. then estimate Ydelta between B(old) and C, if it’s not almost the same, i keep C and estimate Ydelta between C and D ….

of course it could works only if points have a regular space between them on the X axis.
I’ll maybe try this, if i can’t find a better solution instead the chris muir sample frame one.
Seejayjames, i think your way gives the same result than speedlim during recording

Thanks a lot for your intereset


April 15, 2012 | 12:56 am

it’s a proposition
it don’t keep the max and the min :(
but estimate difference between points and keep some of them wich are really different from the lasts
maybe cumulate chris sampleframe method with this one…

– Pasted Max Patch, click to expand. –

April 16, 2012 | 11:37 am

a bit more effecient

– Pasted Max Patch, click to expand. –

Viewing 10 posts - 1 through 10 (of 10 total)