< Back to IRCAM Forum

Interpolation between lists with different lengths

Hi all,
I would like to know how to apply an interpolation between lists with different lengths – i.e. how to make the lists of the same length before applying the interpolation. Assuming that you don’t know in advance which of the two lists is bigger, I presume that one should calculate the difference between the two lengths, and then one should make the two lists of the same length adding repeated elements to the list with less length. In particular, the repetition would consist in adding again the elements of a list starting from the first, and then stopping when the length of the other lists is reached. Since I’m not familiar at all with the conditionals programming in OM, I ask for your help. I attach here a simple example where the lists with different lengths are represented by chords. Thanks in advance for your kind attention and concern.
All the best,
Francesco Vitale
interpolation on lists with different lengths.omp (25.2 KB)

1 Like

Dear Fransesco,

You will need to use iterate-list like so:

However, you should take care using random twice evaluated (in the second loop).

Here is the patch:
interpolation on lists with different lengths1.omp (46.8 KB)

Best
K

1 Like

Dear Karim,
I didn’t know yet iterate-list, it was introduced recently (on OM 6.19, if I’m not mistaken) and I still didn’t make use of it …until today. Thanks again for all.
Best,
Francesco