Jump to content

how to make sublists


Recommended Posts

Hi,

This seems to be a rather simple problem but I can't find a solution myself:

I have a list of 16th notes and 16th rests and I want to make sublists every nth 16th (note or rest),

like so:

(setf list '(1/16 1/16 -1/16 1/16 1/16 1/16 -1/16 1/16
             1/16 -1/16 1/16 1/16 1/16 -1/16 1/16 1/16
             1/16 -1/16 1/16 1/16 1/16 1/16 1/16 -1/16))

(make-sublists '4 list)
-> ((1/16 1/16 -1/16 1/16)
    (1/16 1/16 -1/16 1/16)
    (1/16 -1/16 1/16 1/16)
    (1/16 -1/16 1/16 1/16)
    (1/16 -1/16 1/16 1/16)
    (1/16 1/16 1/16 -1/16))

thanks for hints,

best

ole

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