OpenMusic Tutorials
Prev| Chapter 6. Using Musical Objects II| Next
Tutorial 17: Generation of a melodic sequence from harmonic reservoirs
Topics
Generating a melodic sequence with elements of predetermined chords.
The idea of nesting.
Key Modules Used
The Concept:
We will generate a note sequence using four Chord objects as
harmonic reservoirs. Each Chord contain a traditional
harmonic chord structure. We will use nth-random
to
randomly choose notes from each reservoir, sequentially. We will concatenate
(put together!) the result with x-append
, preserving the
harmonic order of the reservoirs (I-IV-V-I).
The Patch:
Enter the desired harmonic sequence in the Chords (A). In this example we used the tonal sequence I-IV-V-I in C major scale.
Each nth-random
(B) will randomly pick a note in the
Chord reservoirs.
We will ‘iterate’ (repeat) this procedure 4 times using
repeat-n
.
x-append
(D) will concatenate these results in harmonic
order (i.e first we will have 4 randomly choosen notes from the first
reservoir, then 4 from the second one etc…).
In order to have this whole harmonic sequence repeat twice, we will again use
the repeat-n
function (E). Notice that all these iterations
yield different results due to the fact that we are using nth-random
function which is evaluated anew at each iteration (on the C and
D levels) and therefore returns different results each time.
Try this: evaluate the output of the repeat-n
at (E). You
should get something like:
? OM->((6400 6700 6700 6700 7200 6000 6500 6500 5900 5900 6500 6700 6000 6000
7200 6000) (6700 6400 6700 7200 6900 7200 6000 6900 6500 5900 6500 5900 6000
6000 7200 7200))
Notice that this is a list of two lists. Plug this directly into the
_lmidic_
input of the Chord-seq object. You’ll get two
huge chords. This is because the list has multiple levels. When a list has
other lists as its elements, we say it is nested. A
tree is a nested list. When Chord-seq encounters a
nested list, it assumes the sublists are chords. In order to display this as a
string of ordered notes, we must ‘flatten’ the list. This is accomplished with
the LISP function flat
, which removes nesting. Reconnect
the output of flat
to the Chord-seq
and evaluate.
![]() |
A note from Mikhail Malt |
---|---|
The old version of this patch (in a patchwork version) was a gift to Camilo Rueda when he was at Ircam as a Patchwork developper. Just in order not to break the Colombian tradition, this OM version is dedicated to Carlos Augusto Agon, another nice Colombian guy working on Computer aided composition environments.
Prev| Home| Next
—|—|—
Using Musical Objects II| Up| Tutorial 18: Generation of
a note sequence by interpolation between two chords