**OMAlea 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”

**Ran**

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.

**Choice**

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**

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.

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**

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**

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

**Logistique distribution **

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

** Hyperbolic cosinus distribution**

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

**Arc sinus distribution **

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.

**Triangular distribution **

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**

**Gauss distribution**

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

**Gamma distribution **

**Beta distribution **

**Conclusion**

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

### Liens

“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” musicologie.org

### Bibliographie

“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