PART THREE
This is the most delicate problem here.
Working on the tree’s proportions.
Now the right way to do this, is to work ONLY on the effective proportions of the tree leaves. The RTs having a structure as RT= (D S) where D is the duration and S the subdivisions of D, this structure should be taken into consideration. Please see:
So when you apply a function on these elements, you can do this keeping the RT’s structure the same, ie applying it ONLY on the S part of the RT using the new get-leaves (method) as so:
Now if you need to change ALL proportions including the D parts of the RT, excluding Time Signatures as you are asking for. It is also possible. Just wrote a function tha does this:
However it can have special behaviors, since we substitute elements in a given tree (RT) structure that may lead to inconsistencies. If you use your tree in a voice, you will see that the VOICE object added extra level of parenthesis and therefore also an extra digit to the list.
More so, this method can lead to catastrophic results, ie. leading to impossible computing hanging Om.
An example, if you use rests. Negative durations are forbiddend and not at all recommended. If you substitute a duration D with a proportion S which is a rest (negative number), this will break OM:
In the above screenshot, i used permut-random as you suggested applying to all elts of the tree (except time signature and the total duration of the tree).
As you may see here this tree will make OM hang. First you have floats (tied notes) in the beginning of the tree, this is not the problem. The real problem is the (-2 (4 1)) group meaning we have a negative Duration (-2) which in theory isn’t possible
(? (((4 4) ((1.0 (1.0 (1 (1 1 1 -1)) (1 (1 1 1)) (-2 (4 1)))))) ((4 4) ((1 (4 (1 (3.0 (1 (1 1 -2)) 1 1)) -1 (2 (1 2 -1 2))))))))
So this method is under construction. I suggest having two options:
- the method removes all rests
- The method keeps in place rests with different proportions.
Will keep you informed about the progress of the method. Keeping it safe for using is the principal matter here.
I hope all my explanations are helpful.
Please feel free to comment, but for practicality, I suggest creating a topic for each problem here.
Best
K