< Back to IRCAM Forum

Sublists starting on successive elements of parent list

Hi all,

I’d like to break a list into sublists of equal length. Each sublist should

  1. have a user-defined length, and
  2. start on successive elements of the parent list.

Example (if sublist length = 3):
(1 2 3 4 5) → ((1 2 3) (2 3 4) (3 4 5))

Any advice on how to achieve this would be greatly appreciated.

(I’m quite new to Open Music, so forgive me if I have used the wrong language!)

Hi socha,

I would do something like this uaing omloop:

Here is the patch:
Patch 5.omp (4.1 KB)



Excellent - thanks Karim!