< Back to IRCAM Forum

LIST / TREE ROTATION PRESERVING STRUCTURE

Hello,

I’m trying to rotate a list preserving its tree structure, as the Ferneyhough process in The OM BOOK vol.2 (page 12)

Examples:

(1 (2 3) 4) => (2 (3 4) 1)

(1 (2 (3 4) (5 6) 7)) => (2 (3 (4 5) (6 7) 1))

I have tried the attached patches, but I can’t get the correct result.

Can anybody help me?

I would like to contact MIKHAIL MALT, the author of the paper in this book, but I can’t find his e-mail.

Thank you so much!

Alberto

rotar-arbol.omp (2.97 KB)

Hi Alberto,

First of all i erounously detached one of your patches I am very sorry. (it’s not your loop ).
However here is a solution. I don’t think you can do that in a patch. I did it in lisp.
The trouble is , first of all , your lists are not really well structured as in the form of a rhythm tree like (D S). That’s why simple recursion won’t do.
However here is a lisp file, that you drop in your patches folder (in your OM folder). It’s a simple function called : rotatetreelist . In order to use it , you just cmd+click in a patch and type it’s name

Best
Karim

rotatetreelist.lisp (361 Bytes)

Hi Alberto,

Seems that you already had your answer…

And in textual form is really more elegant.

You can make a patch, but seriously, is to complicated…

The Karim’s solution is quite elegant

Thanks Karim

All the best

Mikhail