Using [list] for composition in Pd

logo for article: Using [list] for composition in Pd

In composition list-operations let you encapsulate many common tasks in reusable abstractions. Normally LISP is the mother of all list-based composition software, but you can do lots of stuff in Pd as well thanks to the [list]-object.

Download the patches here: http://footils.org/pkg/list-compose.tgz

As an example attached are abstractions that do four transformations of little musical motives. The motives are stored as lists of numbers, where each number represents a scale step. In the example a major scale is used, but you can do 12-tone serialism as well and also apply the transformations to rhythm lists etc.

The four operations demonstrated are:

  • retrograde: play a motive backwards. That's a simple [list-rev] from the [list]-abs (included)

  • transpose: add a number to each list-element. I used [list-map] here.

  • inversion: That's a bit more complicated. Quoting Wikipedia:

    Inverted melodies

    When applied to melodies, the inversion of a given melody is the melody turned upside-down. For instance, if the original melody has a rising major third (see interval), the inverted melody has a falling major third (or perhaps more likely, in tonal music, a falling minor third, or even some other falling interval). Similarly, in twelve-tone technique, the inversion of the tone row is the so-called prime series turned upside-down.

In inversion.pd this is realised by walking through the list with list-map. The interval to use next is calculated by taking the difference between the current element and the previous element. This interval is substracted (not added, because we are "retro"-grading) from the previous note, the resulting note is stored for the next step and inserted into the result list. The first element in a list is treated specially as it has no previous element: it's just copied and used as the starting note.
screenshot of the inversion.pd abstraction
  • retro-inversion: that's just a retrograde followed by an inversion. As we have abstractions for both now, just bundle them in another one.

list-compose.pd show all four operations in use to transform a little motive.

Update!

After I sent the above to the pd-list, Matt Barber showed an even simpler way how to inverse a motiv or a row. It does inversion by an arbitrary axis, not just by the first note - altough you can set the first not as the axis of course. I quote Matt's mail:

Attached is an inversion.pd which is a bit simpler -- usually when inverting in pitch (rather than pitch-class) it's easier/simpler/better to invert with respect to an axis of symmetry rather than with respect to the first pitch in the series (of course you can assign the first pitch as the axis).

His algorithm substracts each note in the list (including the first one!) from the duplicate of the scale step set as axis. So assuming you chose the pitch 3 as axis, you just substact each element in the melody from 6 (= 2*3).

In the patch archive this is included as inversion-axis.pd and inversion.pd is just a wrapper which uses the first note as axis. Use modulo on the results if you like - and if you do 12-tone music. :)

Here's a screenshot:

screenshot of the inversion-axis.pd abstraction

Some comments

On March 18, 2009, Greg Wilder said:

Fantastic!

What a wonderful example of "practical" PD usage. As always, your work is top-shelf, Frank.

Greg

Post a comment

footils.org