list operation – last of first to first of last

Jan 27, 2012 at 3:29am

list operation – last of first to first of last

I have a 32-item list that I need to output in sets of 4. The first set should be the first 4 items. The second set should be the first 4 after the first 2, ie the last 2 of the first 4 and the first 2 of the next 4, and so on til the end of the list. In other words

1234
3456
5678

etc

Thanks much in advance

Joe

#61485
Jan 27, 2012 at 4:01am

Check out the zl object. It will be your friend.

#221839
Jan 27, 2012 at 4:15am

I know ZL pretty well, but well enough to see how to do this with efficiency.

#221840
Jan 27, 2012 at 4:58am

like that? then it is a very simple thing just using two [zl slice] objects.

– Pasted Max Patch, click to expand. –
#221841
Jan 27, 2012 at 5:38am

Yes my backrouting is really not what it should be. I must study more.

#221842
Jan 27, 2012 at 6:13am

[zl] is pretty much worth the investment. slice, group, lace, rotate… such lovely playground for collected data manipulation.

#221843
Jan 27, 2012 at 6:26am

Its not so much the zl, like I said, its the backrouting.

#221844
Jan 27, 2012 at 7:24am

@xidance that is some spiffy patching right there!

:hats off:

#221845
Jan 27, 2012 at 7:51am

this is what I cobbled together from this.

It’ll take an x-node breakpoint function on the Lemur, swizzle the x/y pairs together, scale it to the display size and output it in the linesegment format as described.

Now on to what I’d like to do with this approach: draw onto jit.gl.sketch!

– Pasted Max Patch, click to expand. –
#221846
Jan 27, 2012 at 9:08pm

any way to do this without the Giant Output Handler of Death?

Thanks

Joe

#221847
Jan 27, 2012 at 10:13pm

What do you mean? Or, are you being deliberately cryptic?
Do you mean jamoma? if so, plenty of ways, you can do this with plain route almost as easily.
do you mean the Lemur? If so, not so many ways, I guess. touchosc on android outputs similarly long and tedious lists.
do you mean the “t b l clear”? No.

#221848
Jan 27, 2012 at 11:40pm

I mean, the output patcher in the original post. I need to put it into an lcd as linesegment, and I couldn’t get your thing to work properly. The output did not match the input.

#221849
Jan 28, 2012 at 12:00am

Did you ever tell us what you’re building? Which original post are you referring to – I’d like to read up on it.
I’ve seen little bits spread out over multiple threads, so I don’t really know what your output handler… is, exactly.

That little thing I just posted is literally all you would need to turn a list of x’s and a list of y’s into a line like that.

http://dl.dropbox.com/u/12606333/lemur_bp.JPG

#221850
Jan 28, 2012 at 12:16am

I’m doing a kinect input handler. This subsection is for gesture processing. It does 3 things

1)”downsampling” via speedlim
2) creating a list of xy coord pairs via zl group
3) displaying the list on lcd via linesegment

To do 3, you need lists of 4 values as I described.

#221851
Jan 28, 2012 at 12:26am

zl ecil 2
and then both, the ecil output and the original into
zl iter 4

#221852
Jan 28, 2012 at 12:46am

Roman – very sorry, tried a few times, no good – coultd you post pls?

#221853
Jan 28, 2012 at 12:53am

>3) displaying the list on lcd via linesegment

>To do 3, you need lists of 4 values as I described.

yes, and that’s why there’s the zl slice 4 and zl slice 2 in the patch I posted – this makes those segments, which is why the “linesegment” command works.

If you take your lists of x coords and feed them into the leftmost inlet of “zl lace”, your y’s and feed them into the right-most you should, provided your values are scaled right, get the same results that I am getting.

Zl lace is doing the shuffling, and the zl slice is iterating through those groups until there aren’t any left.

#221854
Jan 28, 2012 at 1:12am

Perfect

Thanks so much

Joe

#221855

You must be logged in to reply to this topic.