< Back to IRCAM Forum

Omloop accumulation of permutation

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 :slight_smile:

Here is a patch to explain what I need

Thanks in advance…

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)  
)  

Hello!
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!
Thanks!

Simple,

explanation inside (patch)

Best
K

rotation_simple.omp (5.71 KB)

Thank you so very much!
:slight_smile:

I’m using this very helpful patch to produce an array of rotated pitches. However, I would like to output them to a poly with each rotation on a new line. What is the best way of doing this?
Thanks,
Peter

hello peterod,

in an omloop you can put a voice with pitches coming from each iteration of the loop connected to the lmidic input. then the self output straight to the collector and this will yield a list of voices. connect the output of omloop to the rightmost input of a poly.
I’m not sure this is a good practice, but it works for me at least.
hope this helps,
perti