Group Admins

  • Profile picture of Karim
  • Profile picture of Jean

OpenMusic

Public Group active 3 hours, 42 minutes ago

User group for OpenMusic and computer-aided composition. Visit the Forum for discussions.

Filter sublists by list of items

Author 2 Subscribed Users |
Profile photo of sammesser
sammesser

Hi all,

Sorry to trouble you again so soon after my most recent post. I’m trying to process a large list of pitch sets down to something more manageable, without having to do everything by hand.

I have a list containing multiple sublists, and a separate list of pitches (i.e. a filter) which I don’t want present in my eventual output. I need to filter out any sublists from the first list which contain any pitches from the second list, but can’t work out how to do this without much looping… is there by any chance a more elegant solution? Thanks again for all your help.

Sam

September 19, 2017 at 11:17 #23754
Profile photo of sammesser
sammesser

To clarify:

List 1
((8650 8450 8250 8600 8050) (8650 8150 8250 8600 8050) (8650 7900 8250 8600 8050) (8650 8000 8100 8000 8050))

List 2 (Filters)
(8150 7900)

In the above example, only the first & last sublists would pass, my output being ((8650 8450 8250 8600 8050) (8650 8000 8100 8000 8050)).

September 19, 2017 at 11:21 #23755
Profile photo of Karim
Karim

Hi Sam,

This is one solution (cf. attachment)
Best
K

September 19, 2017 at 12:16 #23757
Profile photo of sammesser
sammesser

Thanks Karim! Much more elegant than another solution I came up with; the combination of x-intersect & ‘not’ function looks very useful indeed.

September 19, 2017 at 12:24 #23760

You must be logged in to reply to this topic.

Log in now