In previous algorithmic composition tutorials we've looked at using OpenMusic for algorithmic composition, today's algorithmic composition tutorial introduces Rhythm Trees.
Rhythm trees are a way of representing rhythm with nested lists. The notation can get quite unwieldy and a little complicated, however these disadvantages are outweighed by the advantages. using rhythm trees it's possible to represent very complex rhythms with relatively simple notation, it's also possible to create simple and complex rhythms using algorithmic composition techniques.
The simplest way to work with rhythm trees is to enter a list of rhythms and connect this to the tree input of a voice object.
In the above example we listed two 1/8th notes and two quarter notes. If we work with Rhythm Trees in this manner, OpenMusic assumes a time signature of 4/4. We can also represent rests with rhythm trees, this is done by using a minus value in front of the rhythm value.
Using the same notation it's easy to represent more complex and unusual rhythms:
We can combine the two previous ideas by specifying a number of rhythm sequences and using nth-random to choose which rhythm sequences are picked to create the musical rhythm.
Of course we could generate our list of time signatures algorithmically:
using OpenMusic to generate CSound scores. If you wanted to use these rhythm trees to generate CSound scores we need to get a list of onsets and a list of durations. The simplest way to do this is to connect a voice object to a chord-seq object. The third outlet of chord-seq is a nested list of onsets, the 4th outlet is a nested list of durations. To output these lists as a CSound score we need to flatten the list as in the following OpenMusic patch:
Any of the algorithmic composition techniques we've used so far can be used to generate rhythms and rhythm trees. We'll be exploring some more of these in future algorithmic composition tutorials and look at some of the other OpenMusic rhythm tree functions.
Subscribe to the RSS atom feed and check back soon for more Algorithmic Composition tutorials.