filtering out [sort of] repeated lists

Mar 31, 2009 at 6:42pm

filtering out [sort of] repeated lists

so, say I have a stream of the following few lists:

[1 0]
[2 1]
[3 0]
[1 0]
[7 1]
[1 1]
[3 0]

now, the filter should be looking at the first item in each list. I would like the output to be:

[2 1]
[7 1]
[1 1]
[3 0]

so, they’re sort of x/y pairs.

i looked at [funbuff], but still have repetitions with new sets of lists.

see if this makes sense:

– Pasted Max Patch, click to expand. –
#43125
Mar 31, 2009 at 11:53pm

What is the exact condition for whether a list gets passed or not? You said filtering out repeated lists but I can’t see this from your example. Might just be me being a bit slow though!

lh

#154633
Apr 1, 2009 at 2:48pm

hi,

the lists are two integers long, and can be thought of as x/y pairs, or an address and a value.

if you look at the first message box:
[0 1, 0 0, 0 1, 1 0, 2 0, 3 1, 3 0, 3 1, 4 1, 5 0]

this is a bunch of two-value lists, sent out one by one, to simulate what’s actually happening in my patch.

notice the sequence:
[0 1]
[0 0]
[0 1]

this is what I mean by a repeat, list beginning with 0 happens three times. after all that I just want one message sent, with the latest version of that list, so:

[0 1]

does that make sense?

combination of [funbuff] and [dump] works first time round, but not with successive passes. I guess I want [funbuff] with [dump only things that have changes since last dump].

#154634
Apr 1, 2009 at 4:21pm

Hi, change the message [dump] with [dump, clear]

m

#154635
Apr 1, 2009 at 4:33pm

but [clear] erases the contents of funbuff?

#154636
Apr 1, 2009 at 5:23pm

mmhh. I see, you want a pair to be filtered out if it was on the previous dump.
This is not easy because funbuff has no way to know if a pair is in the first message box or in the next one: it only “sees” lists of two elements getting into its left inlet.
Maybe you should use a coll and add a flag to a pair when it is dumped so that it is not dumped again.

m

#154637

You must be logged in to reply to this topic.