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



Thanks much in advance


Jan 27, 2012 at 4:01am

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

Jan 27, 2012 at 4:15am

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

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. –
Jan 27, 2012 at 5:38am

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

Jan 27, 2012 at 6:13am

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

Jan 27, 2012 at 6:26am

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

Jan 27, 2012 at 7:24am

@xidance that is some spiffy patching right there!

:hats off:

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!

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

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



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.

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.

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.

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.

Jan 28, 2012 at 12:26am

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

Jan 28, 2012 at 12:46am

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

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.

Jan 28, 2012 at 1:12am


Thanks so much



You must be logged in to reply to this topic.