Group Admins

  • Profile picture of Karim
  • Profile picture of Jean

OpenMusic

Public Group active 9 hours, 3 minutes ago

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

List segmentation and iteration

Author 2 Subscribed Users |
Profile photo of lollodona
lollodona

Hello,
I’m new in OM,

I’m tring to figure out how to obtain lists from list regoular segmentations, that is, for example, from:
(1 2 3 4 5 6 7)

I want to get 3-elements lists, wich have as first element each element of the original list:
(1 2 3) (2 3 4) (3 4 5) etc.

I’d also like to define steps between elements of the new lists, for example take an element every 2:
(1 3 5) (2 4 6) (3 5 7) etc.

I know i should use omloop or some combination of iteration and circulation, but as I said before I’m new in OM and I’m still going through the tutorials!

Thank you very much,

Lorenzo

March 11, 2017 at 17:33 #21677
Profile photo of Karim
Karim

Hi Lorenzo

All included in the patch. your last probleme can be done more elegantly but in lisp code.
However it works.

BEst
K

March 13, 2017 at 22:01 #21786
Profile photo of lollodona
lollodona

Perfect! The objects in the omloop are the same I was tring to use, without success…
Thank you very much.

Best regards,

Lorenzo

March 14, 2017 at 08:28 #21802

You must be logged in to reply to this topic.

Log in now