Order new from indicies with an arbitrary order?

Hello, i wanted to use the Order.newFromIndices function for a midi mapping, however i’ve realized that when using the indicies argument, i get a problem when the indicies are not increasing in value.

let me give an example:

~a = Order.newFromIndices(['b','c','a'],[1,2,3]);
//doesnt work
~b = Order.newFromIndices(['b','c','a'],[2,3,1]);

How do i get the second example to work? I hope my question became clear from this example.

Thank you very much!

how about:
[[\b,\c,\a],[2,1,3]].flop.do{|i| g.put(i[1],i[0])}
1 Like

Thank you very much, that did the trick! :smiley: