Jump to content

filter-repeat for pairs?


Recommended Posts

is there a possibility to filter some "combinations"?

when i have a seq like that:

 

(a4 gs4 a4 gs4 a4 fs4 gs4 g5 bb5 g5 gs4)

i want to filter all immediate repetitions with pattern-length = 2

the result would be:

 

(a4 gs4 a4 fs4 gs4 g5 bb5 g5 gs4)

because a4-gs4 is the pair that repeats

 

 

Link to comment
Share on other sites

  • 3 weeks later...

Filter with sequence option:

 

(filter-repeat 1 '(a4 gs4 a4 gs4 a4 fs4 gs4 g5 bb5 g5 g5 g5 gs4 a4 gs4) :seq 2)
=> (a4 gs4 a4 fs4 gs4 g5 bb5 g5 g5 g5 gs4 a4 gs4)

(filter-repeat 1 '(a4 gs4 a4 gs4 a4 fs4 gs4 g5 bb5 g5 g5 g5 gs4 a4 gs4))
=> (a4 gs4 a4 gs4 a4 fs4 gs4 g5 bb5 g5 gs4 a4 gs4)

 

Is this what you are looking for ?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

Terms of Use Privacy Policy