[Newbie] reduce a matrix to some specified line ?

Aug 3, 2008 at 10:19pm

[Newbie] reduce a matrix to some specified line ?

#39120
Aug 4, 2008 at 2:25am

Hi Alexandre,

Here’s something I whipped up quickly using jit.submatrix (could also easily use srcdim attribute) –> jit.matrix @usedstdim 1 inside a poly~. poly~ is great for stuff like this:

Below are two patches:

save this as getLines.maxpat

– Pasted Max Patch, click to expand. –

and save this as whatever name (this is the one you open):

– Pasted Max Patch, click to expand. –

best,
Zachary

#137319
Aug 4, 2008 at 12:26pm

Well, thanks for your example. that’s a nice other way to do it but i’m not sure it is more efficient than using jit.matrix object with “Source Dimensions” and “Destination Dimensions”.. With my tests, it’s should be around 5 ms on my MacBookPro to reduce a matrix from 1200*1200 to 138*138 (i have to reduce horizontaly then verticaly)

When i have time, I’ll try to manage [jit.repos], building an adequat “spatial map” for it, to see if it’s more efficient or not.

Any other idea or other third-part jitter external to do this, would be welcome..

Regards,

Alexandre

#137320
Aug 4, 2008 at 1:59pm

Actually, using srcdim rather than jit.submatrix is markedly more efficient. Should’ve offered that version as the example. But really I posted this to show how to use poly~ for this type of stuff – seeing as you posted [Newbie] in the subject of this thread.

jit.repos may be more efficient. Why don’t you take the time to do it and post an example.

Here’s the altered version of my previous patch, but using srcdim instead of jit.submatrix. I’m not doing any horizontal reduction, but it should be easy for you to implement.

save this as getLines2.maxpat:

– Pasted Max Patch, click to expand. –

save this as whatever (this is the parent patch):

– Pasted Max Patch, click to expand. –
#137321
Aug 4, 2008 at 2:26pm

Well, here it is using jit.repos. Not doing horizontal reduction, again, but you can easily implement it:

– Pasted Max Patch, click to expand. –
#137322
Aug 9, 2008 at 1:19am

Sorry for the delay, thanks a lot for your patcher!

Well, i mesure that it might not be really more efficient with jit.repos… (unless that, perhaps, if the “copy operations” take place – only – on the 138 first lines, but looking at jit.repos and your patcher, it’s not looking like it is possible.)

Anyway, i’m gonna finally copy the 138 lines that i need, like in the first method… but in java with mxj using copyVectorToArrayPlanar jitter-java method, i just found that it should be the more efficient way for me to do it (if cycling74 could take time to correct a bug on this method). i didn’t noticed it but half of my programming is in java, inside mxj object. the slowness of the connexions between java and jitter, is the reason for me to “select the 138 lines that i need” before transferring a smaller matrix to a java array. (for more about this, see : http://www.cycling74.com/forums/index.php?t=msg&th=35075&start=0&rid=2682&S=c99c8ef5033c139c28e669eafc8cb65c )

Regards,

Alexandre

#137323

You must be logged in to reply to this topic.