< Back to IRCAM Forum

Posn-match object and looping positions


I have a list of lists ((0 1 2) (3 4) (5)) and I want to get out of it a new list ((0 3 5) (1 4 nil) (2 nil nil)).
I am using the posn-match object and when I use it with individual positions, for example 1, I get my (1 4 nil).
When I use a loop the “possitions” input in order to get the total list, by looping for example the list '(0 1 2) in the “positions” part of the posn-match, I can not get the desired result. I tried different loops and unfortunately I am missing something…

Can anyone help?

Thank you,


Dear Dimitris,

The problem you have here, is that you are not “clarifying” what you want to do.

First of all, what is the transformational relation between
list: ((0 1 2) (3 4) (5))
and list: ((0 3 5) (1 4 nil) (2 nil nil))

Is it just a shuffle? what are the nil doing here?

posn-match works on position of a list. So your first list has 3 positions (0 1 2), where each element are: '(0 1 2), '(3 4) and '(5). So it is not the right method to use if you want to substitute/move sub-elements.

Maybe another “strategy” is required, once you define the first point of the problem.


Thank you Haddad!

the new list has new sublists created, firstly, from the first atoms of each of the sublists, then the second atoms, third etc…That is why the nils are present. The second new sublist for example, (pos-match 1), has 1 from the first sublist, 4 from the second and nil from the third…

Is it clear?

Thank you!


Yes thank you,

it’s clear :wink:

After all, you don’t need posn-match!


Thank you so much…

I thought as well that it must have been something extremely stupid of mine…


No worry, glad that I helped.


A fast question Karim, nothing with the above…

is there any plan to add a conversion to grace notes for all values under a threshold in quantification?

Thank you a lot!


Yes, but this is on a long term basis. The implementation of grace notes was planned long ago, but needs a lot of work. However, soon we will have a quantifier that takes into account the gracenotes, but concatenates them (momentarily) into chords Still experimental…