filter out repetitions in simple list pairs

stephen schweitzer's icon

Greetings,

Trying to filter out repetitions in simple list pairs:

I have a list coming in that I only need the last two digits. Whether I group them or not zlthin doesn’t recognize them as a pair to be evaluated against another pair. It wants to eliminate the duplicate number WITHIN the pair. I don’t want that. I want to remove the duplicate pairs. In this case 0 0, and 2 2

What should I be doing?

Thanks!

pdelges's icon

I'm not sur to understand what you want, but this patch may help you :

Max Patch
Copy patch and select New From Clipboard in Max.

Peter Ostry's icon

@ Stephen
a) To get the last digits, you connected the wrong output of [zl ecils].
b) [zl thin] removes duplicates in one list, not sequential duplicates (stream).

The patch below shows another version. It stores each valid output and compares it to an incoming new pair. If the two are different, the new pair goes to the output, gets stored, compared to new ... and so on.

Max Patch
Copy patch and select New From Clipboard in Max.


stephen schweitzer's icon

Thank you Peter! Much more complex than I thought, thanks for your help.

Peter Ostry's icon

Yes, comparing with our two hands is much easier than with our brains ;-)

Below the same patch with a more logical object arrangement and cabling.
Maybe better understandable.

Max Patch
Copy patch and select New From Clipboard in Max.

stephen schweitzer's icon

Hmmm... I need to look into this. It seems that it should work, but it can only find 1 duplicate per stream.

Max Patch
Copy patch and select New From Clipboard in Max.

Peter Ostry's icon

First, my patch was far too complicated, sorry about that.

We have an object [zl change] which does the same as the whole patch I posted before:

Max Patch
Copy patch and select New From Clipboard in Max.

——————————

But I think we talk about different functions. I thought you want to filter repetitions from a stream, but now it seems that you rather want to remove duplicates from a "sequence", a whole row of data, like a sentence in speech.

In this case, your [zl thin] was the right idea. You just need to separate/isolate the number pairs, otherwise [zl thin] would compare single numbers. See patch below, it assumes that your sequences do always contain 9 number pairs.

Max Patch
Copy patch and select New From Clipboard in Max.

stephen schweitzer's icon

Ah! That’s it.

Convert the stream into paired symbols and zl group will group the symbol pairs back into a 9 element stream. Then zl thin can remove the duplicates.

Thank you for the lesson.