The American Composer Tom Johnson often uses simple mathematical principles in his compositions. Today's algorithmic composition tutorial looks at a few of Johnson's algorithmic concepts and applies them using Max and PureData. As Max and PureData use slightly different objects to read and write data from tables we'll include screenshots of the algorithmic composition patches from both applications.

**Self Similar Melodies**

This first example taken from Johnson’s now out of print book ‘Self Similar Melodies’ makes use of the following expression:

n n+1 n-1 n

Inputting a zero into our algorithm gives us the following four numbers:

0 1 -1 0

It’s easy to apply this in PureData:

and in Max: