## Friday 16 April 2010

### Probabilities in OpenMusic using OMalea

We've introduced OpenMusic the computer-aided composition environment in a couple of previous algorithmic composition posts.

Today we'll have a look at using the OpenMusic library omalea to discuss the concept of probabilities and music. OpenMusic has a number of libraries that give additional functionality. Omalea (OM stands for OpenMusic and alea is Latin for dice. Aleatoric music uses chance as part of the compositional process. Both Pierre Boulez and John Cage have made use of aleatoric processes).

To enable the omalea library, go to preferences:

Check the omalea checkbox to load and enable the library:

In your workspace, create a new patch.
The omalea library offers four categories of functions: distributions, alea-seq, random-walk and tools.

Distributions
The distributions functions offer a range of ways of making aleatoric choices with different probability distributions.
The range of distributions includes linear (each possibility has the same chance of being selected e.g. RAN and RAN01), through choosing between 2 or a set a number of possibilities where you define their probability of being selected (CHOIX and CHOIXMULTIPLE), through to various triangle and various bell curve like distributions.

Choices (choix) - a coin flip' between two choices where you can adjust the probability. Here it's set to 50/50 chance of being note 5900 (B) and 6200 (D) - OpenMusic using MIDIcents to represent pitch so middle C (MIDI note 60) is 6000.

Poisson - a bell curve of normal distribution based around MIDI note 60.

A linear distribution.
When using the distribution functions to create pitches we had to perform a number of other operations to scale the numbers up and get appropriate values. OpenMusic uses MIDIcents to represent pitch so 6000 = MIDI note 60 or middle C.

If we're creating pitches, it's probably easy to use the alea-seq functions:

Not-centr chooses a random pitch, in this example around note 6000 +/- 12 semitones. It chooses only one value, here the repeat-n function has been used to generate a list of 8 randomly chosen notes:
Alea-seq works in a similar way, however as you can see in this example, it can generate lists of notes. Here we generate 8 notes, there's no need for the repeat-n function if using this object:
Linea-seq also produces a sequence of notes with a linear distribution. Using linea-seq you specify the number of notes and the upper and lower boundaries:

Triang-seq works in the same way to linea-seq, however it uses a triangle distribution. Notice how the notes are more centred around middle C:

Randomness, probabilities and chance are very useful tools for algorithmic composers. We'll look at these more in future posts in both OpenMusic and other software. We'll also have a look at some of the remaining omalea functions in future http://www.algorithmiccomposer.com/ posts and start to pull the tools together to create full compositions.