Jump to content

Recommended Posts

Dear Friends,


I have this recurrent problem with lists...

Please, help...


;;; I have this TWO lists

(setf list1 '(v1rp0 v1rp1 v1rp2 v1rp3 v1rp4)
(setf list2 '(melch1-0 melch1-1 melch1-2 melch1-3 melch1-4)


;;; I need a list like this (alternating the list)

(v1rp0 melch1-0 v1rp1 melch1-1 v1rp2 melch1-2 v1rp3 melch1-3 v1rp4 melch1-4)


How can I proceed ?


Thanks a lot


Julio (a desperate quarantine composer)



help in combining THREE lists are also greatly appreciated, as well as 

how to combine parts of the lists.


Thank you... my brain is ruined for now (I´m doing something BIG... )


All the best !


Link to comment
Share on other sites

(setf list1 '(v1rp0 v1rp1 v1rp2 v1rp3 v1rp4))
(setf list2 '(melch1-0 melch1-1 melch1-2 melch1-3 melch1-4))

(matrix-transpose (list list1 list2))
=> ((v1rp0 melch1-0) (v1rp1 melch1-1) (v1rp2 melch1-2) (v1rp3 melch1-3) (v1rp4 melch1-4))



(setf mat1 '((c4 db4) (ab4 f4) (g4 bb4) (a4 eb4) (b4 e4) (d4 gb4)))
(setf mat2 '((db4 ab4) (f4 g4) (bb4 a4) (eb4 b4) (e4 d4) (gb4 c4)))

(gen-mix mat1 mat2)
=> ((c4 db4) (db4 ab4) (ab4 f4) (f4 g4) (g4 bb4) (bb4 a4)
    (a4 eb4) (eb4 b4) (b4 e4) (e4 d4) (d4 gb4) (gb4 c4))


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.

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