< Back to IRCAM Forum

Various operations/ processing on Rhythm Trees

Dear Karim and OM Hivemind,

I am starting a work where I would like to implement some new (to me) processes which process rhythm trees:

  1. Function that will subdivide all rhythmical durations of a voice into a given number of equal (or very near equal) pulses, even if said durations are tied?
  2. Function that will tie (or combine) durations shorter than a certain quantity to the next onset
  3. Function that will report the smallest/ largest durations in a voice object.
  4. Function that will scramble or rotate (or sort) the elements of a rhythm tree and then reassemble it (regardless of brackets) – without affecting time signatures

I have thus far made modifications to rhythm at the rough durational level (as in the chord-seq) object, but have yet to systematize these modifications/ elaborations.

I am quite new to the tree operation aspect of OM, so any pre-existing starting points/ advice/ patches would be fabulous!

Best Regards and thanks,
Brandon

Dear Brandon,

There are already some tools in om to deal with trees.
First just to give you some news:

  1. I will release shortly a beta version of OM 7.7 which has more tools and particularly implements grace notes. I am planning to do so in a weeks time.
  2. I have also ported all the old documentation on our GitHub site with some extra documentation on trees specially. Its here:
    OpenMusic | Visual Programming Computer-Assisted Composition
    However this is a long term work, since it needs some updating. But still you can go through it. Most of it is still actual.

So now, if you need some “tree” examples, i will be glad to send these to you, if you just give some examples yourself. It doesn’t need to be expansif, just plain straight examples.

Best
K

2 Likes

Thanks very much Karim!
Ok, here are my patches corresponding to the topics above:

Question_1_treesubdivision.omp (50.8 KB)
Question_2_mergeduration.omp (34.1 KB)
question_4_operatetree.omp (30.9 KB)

You can see the comments in the patches, but the general idea is that the modifications are ideally made at the tree level so as not to destroy the rhythmical integrity (rather than “cheating” by changing the voice object to a chord-seq object, processing the onsets, and then “requantizing” to get a result).

I hope this makes sense! I would greatly appreciate any advice.

Dear Brandon,

I will break your questions in three parts following to your patches:

PART ONE
–Dividing beats in n–
Or what you refer to “densifying”

Your solution is rather complicated (ie using onsets to extract durations). You can use instead true-durations method that will return the durations/rests etc. as used here in the left part of the patch:

Now you can also use tree2ratio (center part of the patch). This will give you the symbolic proportions of the durations directly.

But as you can see, the result is also complex

A third option i use (with longer durations of course) is to split each beat into a measure. That way it can be subdivided as you wish (right part of the patch).

The patch:

qst1.omp (106.7 KB)

PART TWO

Here a straight forward answer:
What you are asking for is the delta chords setting which is already available in OM’s preferences (quantification tab):

You just set them as shown in the above screenshot.

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

Hello,

About the nr. 2: there’s also the score function “align-chords” that merge notes into chords according to a specified delta. Now, the conversion from chord-seq to voice would need a bit of patching since it is not working as in the “Question_2_mergeduration.omp” patch. Please see screenshot:

best
rc

Dear rc,

Thanx for the your precision and report.
didn’t know about align-chords :slight_smile:

Can you please just display the arguments of omquantify?
Maybe these are not the same as in the proposed example which should be:
(omquantify durs 30 (48) 8)…)
If not, i will of course delve into this.

Best K

Dear K,

happy to contribute :slight_smile:

The arguments are the same ( i copy pasted the whole thing). It seems that the align-chords just merge the onsets, keeping the orig durs so a rest is created until the next rhythm. Please see:

Ok rc0

Thank you will look into that. It could be that align-chords is faulty.
Will come back to you ASAP.

Thanks again
Best
K

HI Brandon,

Here is the code for apply-on-leaves. Please use only the safe mode, else it can make OM hang.

apply-on-leaves2.lisp (2.1 KB)

Example patch:

apply-fun-leaves.omp (26.3 KB)

BEst
K

Replaying to rc’s align-chords issue:

align-chords is supposed to keep for some situations the durations of the chords. In order to get them to avoid the gap between each space, use the slot object (shift drag from chord-seq) and set the legato slot to 100%:

In that way you will avoid rests.

BEst
K