< Back to IRCAM Forum

OM simple list processing question

Hello Karim (and OM Hivemind!)

I have a rather simple list processing question which may require recursion (I’m not too familiar with implementing this in OM).

Basically, I need a function which will do the following:

Inputs:
(1 2 3 4 5 6 7 8 9)
(a b c d e f g h i)

Outputs (can be able to adjust size of interlocking, n)
n = 3: (a b c 4 5 6 7 8 9), (a b c d e f 7 8 9), (a b c d e f g h i)
n = 2: (a b 3 4 5 6 7 8 9), (a b c d 5 6 7 8 9), …

It would be also useful to have an option to shuffle the interlocked elements in random order:

n = 3: (1 2 c 4 5 6 g h 9), (a b c 4 e 6 g h 9), … and other randomized alternatives.

Any help with or insight into this would be very much appreciated!

Thanks everyone and looking forward to seeing you at the upcoming Forum festival.

Brandon

1 Like

Hi Brandon,

Maybe this?:
Screenshot_2025-03-08_21-00-29

subst-n.omp (2.7 KB)

Best
K

1 Like

,and here is the iterative version:

subst-n1.omp (6.9 KB)

1 Like

…and here the random version

subst-n2.omp (12.3 KB)

1 Like

Dear Karim,

Thank you so much! This is exactly what I needed.

Best Regards,
Brandon