Group Admins

  • Profile picture of Karim
  • Profile picture of Jean


Public Group active 16 hours, 2 minutes ago

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

omloop accumulation of permutation

Author 4 Subscribed Users |
Profile photo of Jonathan JACOBS
Jonathan JACOBS

Hello again,
I’m still struggling with those permutations
So here I am:
I have several list of list for ex: ((a a a a) (b b b b) (c c c c) (d d d d)….)
I would like the first list to permut once, the second twice, the third 3 times etc…

I tried to plug all wire possible in the loop but it’s just doesn’t work, so I might need some help here :-)

Here is a patch to explain what I need

Thanks in advance….

  1. Patch.omp
September 23, 2014 at 09:52 #10522
Profile photo of Jean

I am not sure what you mean as “permut” but the function ROTATE might be useful

(rotate ‘(a b c d) 1) => (b c d a)
(rotate ‘(a b c d) 2) => (c d a b)

you can then just encapsulate this in a loop using listloop + forloop

(loop for sublist in list
      for i from 1 to (length list) 
      collect (rotate sublist i)
October 1, 2014 at 14:40 #10681
Profile photo of nagymusic

Might you be willing to help me construct a patch in which the given series (a b c d e f) yields a series of circular rotations (b c d e f a) (c d e f a b) (d e f a b c) (e f a b c d) (f a b c d e).

I know this must be very simple, using omloop, I imagine. I just haven’t been able to figure it out. Any help or advice would be greatly appreciated!

April 3, 2018 at 02:25 #26111
Profile photo of Karim


explanation inside (patch)


April 3, 2018 at 02:39 #26112
Profile photo of nagymusic

Thank you so very much!

April 3, 2018 at 02:48 #26115

You must be logged in to reply to this topic.

Log in now