You are on page 1of 4

THE APPLICATIONS OF SIEVE THEORY IN ALGORITHMIC COMPOSITION USING

MAX/MSP AND BASIC

Duarte, Jose*, Hsiao, Shu-Chin**, Huang, Chih-Fang***, and Winsor, Phil****

Music Institute of
National Chiao Tung University
1001 Ta Hsueh Road, Hsin Chu, Taiwan 300, ROC
* joseduarte777@yahoo.com, **violin52@ms47.hinet.net,
***jeffh@faculty.nctu.edu.tw, ****pgwinsor@aol.com



ABSTRACT

The following paper compares tools used at the
Music Institute of National Chiao Tung University to
generate Sieves based on Xenakis Theory. Also reveals
the importance of continuous research in the area of
algorithmic composition. The comparison between
BASIC language and MAX (cycling 74) will show how
the development of the research and teaching techniques
of the institute. Also at the end remarks the necessity of
the use of new platforms using a different approach like
the case of athenaCL developed at the New York
University.

1. INTRODUCTION

Since 1989 Music Institute of National Chiao Tung
University has been developing applications and
methodology to compose music algorithmically. In this
paper we will discuss the Sieve Theory and two examples
of its application utilizing MAX and BASIC. The
importance of this comparison is part of an effort to define
the direction of the Algorithmic composition education in
the Institute and part of an evaluation of the software
applications available.
The use of Sieve Theory represent a very important
exercise in algorithmic composition at a very basic level,
allowing the user to start dealing with mathematical
concepts like number set theory and Boolean operands.
Music Sculptor application based on BASIC
programming language is a powerful tool to input musical
events based on mathematical operations, results can be
saved in a MIDI file to visualize a score. On the other side,
MAX also can deal with a number of mathematical
expressions to output music as well.



2. BASIC APPLICATIONS IN ALGORITHMIC
COMPOSITION

BASIC is a programming language ideal for first
level Algorithmic composition courses. It provides a
friendly environment to work with, and resources of
information are all spread out in libraries and in the
Internet. As a composition tool, it is also useful in the
generation of Sieves. Xenakis even used BASIC to
compile the first Sieve generator. BASIC is applied to
deal with musical concepts like pitch classes,
transposition, inversions, rhythmic values and so on. For
more information see Winsor’s Automated Music
Composition [1], where many topics can be found like
examples of programs dealing from simple transposition
of pitch classes to the generation of Fibonacci series and
fractal patterns.


3. XENAKIS SIEVE THEORY

Proposed originally in 1964, During Xenakis staying
at Berlin from the fall of 1963 to the spring of 1964.
During this time, he developed Sieve Theory further [2].
Sieves output numerical sequences that can be translated
to musical and sound events such as pitches, time points,
dynamics, densities, degrees of order, local timbres, etc.
[3]. In the search of symmetry in musical figures, Xenakis
used sieves in his early compositions such as Zyia (1952)
and Sacrific [4]. In which the Fibonacci Series were
represented. In music the question of symmetries (spatial
identities) or of periodicities (identifies in time) plays a
fundamental role at all levels: from a sample in sound
synthesis by computers, to the architecture of a piece. It is
thus necessarily to formulate a theory permitting the
construction of symmetries, which are as complex as one
2006 International Workshop on Computer Music and Audio Technology
96
might want, and inversely, to retrieve from a given series
of events or objects in space or time the symmetries that
constitute the series. We shall call these series “Sieves”
[3].


FIGURE 1: Mycenae Alpha(UPIC Graphic/Computer)
composing By Xenakis

Sieve is analogous to scale in music, and Xenakis
makes emphasis that it is not a mode. The idea of this
theory is to generate scales (if we are dealing with pitch),
generate rhythmic patterns (if we are working with
rhythm) and so on.
Sieves are composed by a sequence of integers (in
the case of scales) and the interval between each value.
This interval is called the modulo. A Sieve can be defined
as M
RC
, in which RC stands for the residual class, or the
starting point of the scale and M will be the modulo. To
be more detailed RC is where the pitch class begins, RC=
0 starts from C, then RC=1 will start from C#, etc. The
modulo determines the constant interval between the
elements of the class. For example, RC=0 and M=1 or 1
0
= {…-2, -1, 0, 1, 2, 3, 4, 5…} will output a Chromatic
scale starting from C like this: C, C#, D, D#, E, F, F# and
so on. For modulo 2, Whole-tone scale is generated: 2
0
= C,
D, E, F#, G#, A#… (Or 2
0
= {0, 2, 4, 6, 8, …} Other
combinations are possible. We only need to follow these
restrictions: modulus can be any positive integer greater
than 0 (M>0); RC, for a given modulus M, can be any
integer between 0 and M-1 (0<RC<M-1) [5].
The combinations will get more interesting as soon
as we start to apply the Logic of Classes to these sieves
and be able to create more complex sequences. First logic
is Union (“or” represented by ∨), intersection (“and”
represented by ∧) and complementation (“not”).
In the case of Union we can have the values of two Sieves
added as showing. Let’s observe the union of Sieve 2
0
=
{… -2, -1, 0, 2, 4, 6, 8, 10, 12…}and 5
0
={…-10, -5, 0, 5,
10, 15…}, the result will be: {…-10, -5, -2, -1, 0, 1, 2, 4,
6, 8, 10…}. The next table will show more examples of
the operands:

M
RC1
M
RC2
RESULT
{0, 1, 2, 3} AND {-2,0, 2,4} {-2,0,1,2,3,4 }
{0, 1, 2, 3} OR {-2,0, 2,4} {0,2}
{0, 1, 2, 3} NOT {-2,0, 2,4} {-2, 1, 3}

The operand “Or” will display all the values that both
sets have in common. In the case of
{0, 1, 2, 3}OR {-2,0, 2,4}={0,2}

On the other side, operand “Not” will output the
values that both sets do not have in common:
{0, 1, 2, 3}NOT{-2,0, 2,4}={-2, 1, 3}

The generation of Sieves allows the composer to
create musical pieces based on new rules and also
represents a great tool for developers to program
automated composition software.


4. APPLICATIONS OF SIEVE THEORY

Going back to BASIC, an example to generate music
scales will be shown, as well for MAX examples of
patches for scales and rhythmic patterns.
Different software is available to generate sounds
from BASIC programs one example is Music Sculptor
(Winsor & Kuo-Lung Chang). To accomplish this task
Sculptor will out a MIDI file and provide a music score.
But first let see the code to generate a Sieves for different
known scales:



FIGURE 2: QBASIC Interface

2000REM*************************************
2010 REM Major Scale Logical Sieve Routine
2020REM*************************************
2030 FOR X = LOWP TO LOWP+ELEMENTS-1
2040 IF X MOD 3 <> 2 AND X MOD 4 = 0 OR X
MOD 3 <> 1 AND X MOD 4 = 1
OR X MOD 3 = 2 AND X MOD 4 = 2 OR X MOD 3
<> 0 AND X MOD 4 = 3
2006 International Workshop on Computer Music and Audio Technology
97
THEN PRINT P$(X);" "; ELSE 2050
2045 PRINT #1,
NOTEON;X;VELOCITY;ARTDUR;CHANNEL
2046 NOTEON=NOTEON+DURATION
2050 NEXT X
2060 RETURN

Previous example shows how to calculate the Major
Scale Sieve. Line 2040 can be read as “if x mod 3 is not
equal to 2 and X mod 4 is equal to 0, or if X mod 3 is not
equal to 1 and X mod 4 is equal to 1, or if X mod 3 is
equal to 2 and X mod 4 is equal to 2, or if X mod 3 is not
equal to 0 and X mod 4 is equal to 3 then X passes the
test.”[1]

Then the execution of the program will show the
major scale:
Enter number of background scale elements:
12
Enter scale type: (1=major, 2=harm. Minor,
3=pentatonic)
? 1
C1 D1 E1 F1 G1 A1 B1

Now, after the generation of any Sieve (in this case
the Sieve corresponding to a Major Scale) we can
transport the file to Music Sculptor. See Figure 2 and
then if needed save a MIDI file to display a music Score,
to be imported by Music Sculptor as shown in Figure 3.
Figure 4 shows that the program generated pitch data,
saved as “pitch.dat”, can be loaded from Music Sculptor,
to compose the music piece automatically by the sieve
algorithm. Many other sieves can be generated using the
same procedure; there are many combinations yet to be
discovered.


FIGURE 3: Music Sculptor (Winsor & Kuo-Lung
Chang) Interface.




FIGURE 4: Music Sculptor (Phil Winsor & Kuo-Lung
Chang) Interface.

Regarding Max software (Cycling 74), there are
several ways to implement a Sieve analysis. The Max
predefined objects allow users in different ways to
produce several sequences. In Figure 5 we can visualize
one example to generate sieves using Max Objects. The
real time capabilities of this platform permit the user to
modify the parameters of the modulo and the residual
class



FIGURE 5: Sieve Implementation Using MAXMSP

while playing the sequence. In addition, predefined
presets may change several parameters at the same time.
On the other side, different variables can be added to
form part of the patch, for example: Metro and Random
objects, influencing the sound event by changing the
distance between the “noteon” and “noteoff” or by
modifying the order of the attacks respectively.
Max, apart of being a great tool to design patches, it
is also a good platform to deal with The Sieve Theory.

Figure 6 shows the twelve tone matrix for
composing the “serial music”, with four operations
including prime, inversion, retrograde, and retrograde-
inversion. Based on the twelve tone “12 x 12 Matrix” [6],
the MAX/MSP program can be used for composing the
2006 International Workshop on Computer Music and Audio Technology
98
serial music based on the sieve theory using the MAX
internal objects, as shown in Figure 7.


FIGURE 6: Twelve Tone Matrix for Sieve Theory
Serial Music Composition Using MAX/MSP



FIGURE 7: Sieve Theory for Twelve Tone Serial
Music Composition Using MAX/MSP



5. CONCLUSION


After showing two examples of Sieve Applications a
wider panorama appeared. The ways of experimentation
in the topic vary in time, and others remain because of
their success. This is the example of BASIC language,
which provides ways to implement many musical-based
concepts; in this case the Sieve Theory can be studied and
analyzed.
On the other side, Max software (Cycling 74), shows
a different perspective. The comparison of different set of
sieves is done thanks to its capabilities of real time
parameter settings. In other words, this characteristic
illustrates sieves in a faster way, so users can compare the
results at the moment.
Also, many other software programs have been
develop on the way. Firstly, there is a translation of the
first BASIC to C language made by Gérard Marino [3] a
programmer from CEMAMu Centre d'Etudes de
Mathematiques et Automatiques Musicales/Center for
Studies in Mathematics and Automated Music) to know
more about this implementation see Xenakis, Formalized
Music [3]. Another more recent application is the one
developed by Christopher Ariza (Graduate School of Arts
and Sciences, New York University), which is an object-
oriented model and Python implementation [5]. This
model is executed using a bigger platform called
“athenaCL”, which is an open-source, interactive
command-line environment for algorithmic composition
in Csound and MIDI [5]. The work of Ariza will represent
a great deal of new and easier ways to deal with Sieve
theory and other Algorithmic composition areas. For more
information see athenaCL User’s guide. [7]



6 . REFERENCES

[1] Winsor, Phil, “Automated music composition”,
University of North Texas. 1989.

[2] Barthel-Calvet, A. S., “Chronologie.” In F. B. Mache,
ed. Portrait(s) de Iannis Xenakis. Paris: Bibliotheque
Nationale de France, pp. 133–142, 2001.

[3] Xenakis, Iannis, “Formalized Music Tutorial”,
Pendragon revised revision, 1990.


[4] Solomos, M., “Xenakis’ Early Works: From
‘Bartokian Project' to 'Abstraction'," Contemporary
Music Review 21(2-3): pp. 21-34.’, 2002.

[5] Ariza, Christopher. The Xenakis Sieve as Object: A
New Model and a Complete Implementation. New
York University. Computer Music Journal.

[6] Joseph N. Straus, “Introduction to Post-Tonal
Theory”, Prentice-Hall International UK Limited,
pp. 118-146, 1990.

[7] Ariza, Christopher, “AthenaCL User Guide”, Second
Edition, Version 1.4.3.


2006 International Workshop on Computer Music and Audio Technology
99