Forums > MaxMSP

adding and deleting list positions

March 28, 2011 | 6:37 am

Hi Forum,

How do I add and delete a set of positions from two lists at the same time?

Here is the very beginning of the patch:

– Pasted Max Patch, click to expand. –

March 28, 2011 | 6:59 am

For some reason this doesn’t work: ???

– Pasted Max Patch, click to expand. –

March 28, 2011 | 7:05 am

… or see the below code:

Since remove only removes one member at a time, then I could collect the lists that [remove] spits out and only keep the numbers in the list that appear more than once … ? (This is a strange way of getting around the problem with [remove] though …)

– Pasted Max Patch, click to expand. –


Ch
March 28, 2011 | 7:10 am

>> How do I add and delete a set of positions from two lists at the same time?

The easiest way is probably using the right outlet of [zl nth]


March 28, 2011 | 7:17 am

Hi,

yes, zl nth works like remove. The problem is that it both [remove] and [zl nth] only deal with one number at a time. I would have to update the list every time I want to remove another number, and then I have not figured out how to avoid stack overflow …


March 28, 2011 | 7:26 am

Hmm, and in the following code, it almost works, but there is still something wrong …

– Pasted Max Patch, click to expand. –

March 28, 2011 | 7:35 am

This doesn’t work either …

– Pasted Max Patch, click to expand. –

March 28, 2011 | 8:03 am

Another set of zl objects, and without recursion, might make it easier to control.

– Pasted Max Patch, click to expand. –

March 28, 2011 | 8:03 am

Another set of zl objects, and without recursion, might make it easier to control.

– Pasted Max Patch, click to expand. –

March 28, 2011 | 8:07 am

Great! Thanks a lot :-)


March 28, 2011 | 9:11 am

eventually this is easier with [coll] compared to [zl] – but it might be
easier at the cost of CPU.

-110


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