< Back to IRCAM Forum

Expanding and contracting rhythms in trees

Hello! I’m working on a compositional system on which I take an existing piece of music (a monophonic melody), and extract its rhythm tree. My goal is to multiply the durations on the original melody by some factor. But I wanted to work with the rhythm trees, because it handles nested tuplets way better than using the actual ratios. Is there a way to augment or diminish the durations of a piece working with the rhythm tree? Thanks in advance!

Hi,

Rhythm trees are symbolic rhythms. You can aug/diminish them symbolically, ie. by changing their figures (dotted, changing tuplets, * proportions etc), These changes takes into consideration the rhythm proportions, not their real duration. You can modify their rhythmic figures as 1/4 → 1/8, etc. If you intend to change the duration meaning in milliseconds, it is better to consider to change either meters and/or tempo. This will be more efficient.
Please try to send an MWE (minimum working example) as a patch for a start, or some written down details so we can understand what you need exactly to achieve here.
You can start also by taking a look in Functions->Score->Trees menu

Best
K
K

Thank you! I’ll show you an example:

I thought about working with changing the time signatures, that would be my go-to way. I wrote a Python program which takes a OM rhythm tree as an input (as a string), convert it into a Python list using a script I found on-line, then I manipulate the time signatures at the beginning of each bar, and then I print out a LISP version of the Python final list, using another script I found online.

For instance, let’s say I have a melody in 7 bars of 4/4. If I wanted to multiply the durations by a factor of 1.25, I’d get 7 bars of 5/4, with the same proportins in the tree. This would satisfy my system.

So, the (Python string) input would be:

(? (((4 4) ((1 ((1 (1 1)) 1)) 3.0)) ((4 4) ((1 ((1 (1.0 3 2)))) 1 2)) ((4 4) (2.0 -1 (1 ((1 (1 1)) 1)))) ((4 4) ((1 (1.0 1)) (1 (2.0 1)) 1 (1 ((1 ((1 (1 1)))) 2)))) ((4 4) (1.0 3 (4 (1.0 1 1)))) ((4 4) ((2 (-1 1 2 2)) 1.0 1)) ((4 4) (1.0 (1 (1.0 -1 -1))))))

And the output would be:

(? (((5 4) ((1 ((1 (1 1)) 1)) 3.0)) ((5 4) ((1 ((1 (1.0 3 2)))) 1 2)) ((5 4) (2.0 -1 (1 ((1 (1 1)) 1)))) ((5 4) ((1 (1.0 1)) (1 (2.0 1)) 1 (1 ((1 ((1 (1 1)))) 2)))) ((5 4) (1.0 3 (4 (1.0 1 1)))) ((5 4) ((2 (-1 1 2 2)) 1.0 1)) ((5 4) (1.0 (1 (1.0 -1 -1))))))

I’d really want to do all of this processing inside of OM, to avoid going into Python.

Great.
Here you are all in CommonLisp VPL:

If you know some python, lisp shouldn’t be so difficult for you. :slight_smile:
Here is the patch:

mult-ts.omp (28.7 KB)

Of course you can also multiply each individual measure.
You can even write this as a method.

Best
K

1 Like

Oh wow, thank you so much! So, this only changes the first measure, not all of them, correct?
Yeah, I’m going to work this out so I can change all of the measures in the same proportion. I need to study my LISP anyways :slight_smile:
Again, thank you so much!

No, This changes ALL measures to the given ratio. All measures are now 5/4.
:slight_smile:
K

1 Like