Saturday, 3 September 2011

Tone Rows - PureData and Max

Today's algorithmic composition tutorial looks at manipulating a tone row in Max and PureData to generate musical material. We'll also have a look at one technique that's useful in generating more fully formed compositions in Pd and Max than some of the musical sketches we've generated so far.

Jump to the end of the post to hear some sample algorithmic music output from this patch.

As with yesterday's OpenMusic tutorial we're using the tone row from Berg's Violin Concerto:

  G, Bb, D, F#, A, C, E, G#, B, C#, Eb, F

You can use any tone row of your choosing. To start with we'll define our tone row in a table in PureData

algorithmic composition puredata tone rows1
and in Max
algorithmic composition maxmsp tone rows1
We'll start simply by playing through the tone row. As Max and PureData read and write to tables in slightly different ways the patches are setup a little differently in each. In Max the table object is used to read the table data:
algorithmic composition maxmsp tone rows2

Friday, 2 September 2011

Open Music - Tone Rows and the Maquette

Today's algorithmic composition tutorial looks at using OpenMusic to manipulate and generate musical material from tone rows.

If you haven't already got OpenMusic 6.5 installed you can download OpenMusic free for Mac and PC here. IRCAM supply a number of tutorials but you can also look through the OpenMusic tutorials available here.

Jump to the end of the post to hear some sample algorithmic music output from this patch.

Serialism developed as a framework for composing and organising atonally and moves away from the sense of a key by giving each pitch equal worth. This patch starts with a tone row from the Berg Violin Concerto:

   G, Bb, D, F#, A, C, E, G#, B, C#, Eb, F

All pitches must be played through in order, in order to provide more melodic material the tone row can be transposed to any pitch, inverted and played backwards.

First we'll create our tone row (to create a new object CMD click and type in to the box created).

Thursday, 18 August 2011

Chaos in Max and PureData

We've looked at a few algorithmic composition ideas using Chaos in OpenMusic here, today's post applies some of these ideas algorithmic composition ideas in Max and PureData.

Chaos theory is a field of mathematics where dynamic systems are very sensitive to initial conditions. The famous 'butterfly effect' states that small differences in initial conditions can lead to large variations later: the small flap of a butterfly's wings may cause effects that later alter the path of a tornado.

As with our OpenMusic chaos patch, for this example of Chaos in PureData and Max we'll use a logistic map. The Logistic Map is a simple example of a discrete dynamical system that actually names a whole family of iterative functions described by the very common Logistic Equation:


That's to say: to get the next value of f, multiply the current values of c, f and (1 - f). This formula involves only 1 subtraction and two multiplies but it leads to chaotic behaviour. In this graph you can see with values of c below 3 the behaviour is very predicatable. However if c > 3.75 then very small changes in f lead to very large changes later on:

Tuesday, 16 August 2011

Tom Johnson's Algorithmic Compositions Part 2

A previous post looked at some of the algorithmic composition ideas used by American Composer Tom Johnson. Today's algorithmic composition tutorial looks at a few more of Johnson's concepts specifically his use of finite automata.

A finite automaton is a sequence using a finite number of symbols generated according to specific rules. In the case of Johnson's Automatic Music, six percussionists each have only two notes, high and low, and the alphabet is limited to 1 (the low note), 2 (the high note), and 3 (a silence) using the following rules:

1 --> 1 1 2
2 --> 3 2
3 --> 3 3

Beginning with 1 generates the following sequence:


Using this automaton it's easy to generate long sequences of numbers that can be then mapped to musical parameters. As ever with algorithmic composition, once you've created your patch or program it's easy to manipulate the formula or remap the musical output to generate new pieces.

Let's have a look at a simple example using PureData and Max. This screenshot shows the generation part of our algorithm in PureData.

The until object will output 500 bangs when the above message is clicked on, the counter outputs a running count of these bangs and this is used as a number to lookup the stored value in the coll object. The output of the coll is connected to a select object and this triggers the new messages that are stored within our coll object.

In Max the patch looks very similar though note the use of Uzi rather than the PureData until object.

Monday, 18 July 2011

OpenMusic 6.5

A new version of OpenMusic has been released today. This algorithmic composition software is developed by IRCAM and the latest version 6.5 has been released for free before it's been released to paying IRCAM forum members. You can download OpenMusic for Mac and PC here.

OpenMusic 6.5 includes the following new features and bug fixes:

OMSheet (beta):
The sheet is a new score container allowing to bring together voices, chord-seqs, sounds, BPFs and other objects is a common view with accurate time alignment, and to program functional relations between these objects.
  • Screamer toolbox updated
  • Groups functions available
  • Keep Listener window on top (Option – see Preferences / General)
  • Libraries "auto-documentation" system
The MIDI pages in the OM User Manual have been updated
  • MIDI Reset command (in Preferences / MIDI)
  • SOUND-REC function (record incoming audio)
  • Record command in Sound editor.
  • Function ADSR (generate ADSR envelopes)
  • Function "true-durations": handles polyphony / overlapping notes
  • Attributes of internal abstractions preserved (pictures, eval-func, etc.)
  • Internal maquette box display
Bug fixes (non-exhaustive list):
  • Undo command in Chord-seq editors
  • Tempo-Map object miniview
  • TextFile evaluation in internal patches
  • Saving/Reload for SINGLE-ITEM-LIST and MULTI-ITEM-LIST
  • Eval-Once mode on Factory boxes
  • Name conflicts in MusicXML import
  • Class-array: indices updating at remove-comp / add-comp etc + set data with NIL slot inputs
  • Floating palettes bugs
  • Item sorting (workspace/folder windows)
  • SDIF→BPF matrix type
If you've never used OpenMusic there are lots of OpenMusic tutorials available here and there will be a new OpenMusic algorithmic composition tutorial covering some of these new OpenMusic 6.5 features soon.

Monday, 27 June 2011

Tom Johnson's Self Similar Melodies

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:

Second Order Markov Chains in PureData

It's been too long since the last algorithmic composition post, but a series of new posts are on the way!

To kick things off we'll revisit one of our previous Markov chain algorithmic compositions. Previously we looked at first order Markov chains in PureData. We also extended this into a second order Markov chain in Max.

Let's have a quick recap first.

First Order Markov Chains
In a previous Algorithmic Composition post we built a first order Markov Chain analysis and generation patch. In 1st order Markov chains the next note is based on the current note and a list of probabilities for following notes. This is stored in a State Transition Matrix (STM), here's an STM that lists the notes of Happy Birthday and the probabilities of each subsequent note.

Second Order Markov Chains
Second order Markov Chains choose the next note based on the two previous notes and the probability of subsequent notes following those two notes: