OMAlea libraryOMAlea Library  for OpenMusic tutorial 1/2


Download example patches from “distributions” folder of OMAlea library

I recently realized that several OpenMusic libraries have no documentation and no or few example patches. I did not find more on the net.
To fill, a bit, of this lack I decided to put online these few patches built over the years or programmed for the occasion.
I’ll begin this series of articles by the library OMAlea, designed at IRCAM by Michael Malt, which deals, as the name implies with randomness in music, from stochastic distributions to Markov chains.
I will review most of the functions of this library and begin by the simplest: “ran”



librairie omalea

Comments are redundant, the patch speaks by itself.

For music applications it’s all about scaling the desired settings. One could almost only use “ran” for all random draws. However, if such distribution, called “uniform” is equiprobable meaning that no value predominates, other distributions, as we shall see, have colors, individual flavors that might specifically correspond  to particular musical uses.



librairie alea

Function “choice” makes a choice between two alternatives of given probabilities. Just specify the probability P {X = x1} since P {X = x2} = 1-P{X=x1}. In the first instance the probability of 5 is 0.25 (25%). The probability of 10 will be 0.75 (75%). We only specify the first one.


 Multiple Choice

librairie alea

Here it is necessary to specify the probability of each event. To create additional entries type option-right-arrow .

As shown in the last example, any list of numbers can be converted into probability vector. For that, use om-scale/sum with the second argument equaling 1.0.

These two “choice between n alternatives” algorithms are the basis of Markov chains which we will discuss further.


Urn drawing

A typical serial process would successively draw n numbered balls from an urn (a set) containing n different values. This simple patch shows an example.

librairie alea

This urn drawing process said of discrete distribution was used among others by Xenakis in many of his stochastic works like  Achorripsis, Metastasis etc …

It is very useful when you want to make a random sequence of elements without repetitions.

This function is not part of the OMAlea library but it seems so useful in the field of randomness that I have included here.

Like all functions that manage lists it can be used not only to draw values (pitch, duration, velocity, midi channel …) but also sounds, functions, objects, symbols, other lists and also index for the posn-match function …


 Exponential bilateral distribution

librairie OMAlea

Also called sometimes “First Laplace Law” this is a distribution of non-equiprobable values particularly suited for generating time intervals with predominance of the central value. Both homogeneous and sufficiently varied.

Unlike the uniform distribution and others we will see later it has a distinctive look that sets it apart. Especially, as here, with integer values.


Cauchy distribution

librairie OMAlea

A single input parameter and centered on zero, the Cauchy distribution provides positive and negative values with a pretty good pace.


Logistique distribution 

librairie OMAlea

Parameters: alpha(échelle) and beta(offset).


 Hyperbolic cosinus distribution

librairie OMAlea

Parameters: alpha(échelle) et beta(offset).


Arc sinus distribution 

librairie alea

Same as beta distribution(0.5, 0.5) that we shall see later.


Poisson distribution

Discrete probability distribution among the favorites that Xenakis used in Pithoprakta, Metastasis, Achorripsis, Analog A, Analog B, ST10…  governs the appearance of rare events.

librairie alea


Triangular distribution 

librairie OMAlea

Some special cases:

  • for alpha = beta = 1 we obtain the uniform distribution
  • for alpha = beta = 0.5 we obtain the arc sine distribution


Weibull distribution

librairie alea


Gauss distribution

librairie alea

Used by Xenakis, again, to control durations and glissandi textures in Pithoprakta.


Gamma distribution 

librairie alea


Beta distribution 

librairie alea



We must admit, all this may seem a little austere.

These examples and these distributions have no other purpose than to give ideas, stimulate musical imagination.

So do not hesitate to twist, pervert and poach them from their “normal” use. It should particularly be noted that the conversion to integer values ​​often provides distributions, curves that have more pace and character than those expressed as decimal numbers that often seem pretty “gray”.

They can be used for many things such as control of pitch, duration, intensity, timbre in instrumental music but also to wider levels on form, tempo or in the synthesis where they can manage all kinds of macro parameters and micro-composition with CSound among others.

If some patches seem a bit obscure at reading, open them, play and experience them personally.

The next article will give other musical examples of uses of the OMAlea library including Markov chains.

(To be continued…)

Download example patches from “distributions” folder of OMAlea library

Jean-Michel Darrémont



“Cours de probabilités” par Jean-Yves DAUXOIS

“La musique stochastique, théorie des probabilités” Emil Reinert

“Encyclopédie Larousse en ligne: musique stochastique”

“Iannis Xenakis”


“Une Panoplie de Canons Stochastiques” Denis Lorrain Rapport IRCAM 1980

“Musiques Formelles” Iannis Xenakis Stock 1981

“Théorie de l’information et perception esthétique” Abraham Moles Denoël 1972

“New directions in music” 7ème ed David Cope Waveland Press   2001

“Silence” John Cage Denoël 2004

“John Cage” Jean-Yves Bosseur Minerve collection Musique ouverte 1993