I am trying to work with a compositional tool called OpenMusic, which is a graphical development environment based on common lisp, and it uses something called "rhythm trees". I am trying to create rhythm trees using a set of rules and in OM this tree must have the following structure:
- A tree is a list with two elements
- Its first element is a node
- Its second element is a list of its children (which can also be trees)
Given a tree depth n
, an initial single node tree (1)
and transformation rules:
- (1) -> (1 2)
- (2) -> (1)
It should give:
n = 1 -> (1 (1 2))