Page  194 ï~~Deterministic Chaos, Iterative Models, Dynamical Systems and Their Application in Algorithmic Composition Martin Herman Department of Music, California State University at Long Beach 1250 Bellflower Boulevard, Long Beach, California 90808 U.S.A. phone: 310/985-5691 FAX: 310/985-2490 email: 1 Introduction There has been growing interest in and an increasingly wide application of dynamical mathematical models in the domain of electronic music composition and synthesis. Iterative models and mathematical chaos algorithms provide for fertile creative ground among composers and researchers. Iterated functions systems, discrete time maps, and chaotic nonlinear systems and their applications in composition and synthesis have been discussed recently by a number of composers [Pressing, 1988], [Truax, 1990], [Di Scipio, 1990], [Gogins, 1991], [Xenakis, 1991], [Degazio, 1993] demonstrating the continuing fascination that these models hold in a wide variety of musical applications. 2 Dynamical Systems and Attractors Briefly described, a dynamical system is a model for the motion of matter in a field of force. Dynamical systems can take various mathematical forms such as differential equations and iterated functions: nonlinear feedback loops where the output of the function is fed back into itself as new input at each iteration. These iterated functions are above all time dependent since their evolution depends quite sensitively on their earlier state. The solutions of iterated functions trace orbits in phase space and it is the study of these orbits that comprises much of the research in dynamical chaos. They are of great interest to the composer since music afterall unfolds in time and it is possible to "map" these orbits in a variety of ways in the musical output. A fascinating interplay of order and surprise results from simple mathematical iterative models [May, 1976]. The systems which are of particular interest for this discussion are dissipative in nature, having internal friction and by necessity an attractor. It is useful to speak of "basins of attraction" in a dynamical dissipative system [Grebogi et al, 1987]. By example, this can be simply expressed as a discrete time map: xn+l=f(xn) where x is a vector in phase space and the function f is some interesting function with finite constraints imposed by some external force. The basin is defined as the set of initial conditions that cause trajectories which converge towards the attractor. Attractors can take any number of geometrical forms that characterize the long term behavior of the system. The attractor may be a point (steady states independent of time), a set of points or limit cycle (periodic trajectories in time), or quasi-periodic regimes consisting of superimposed oscillations that differ in amplitude and period. There is another category of attractors which consists of non-periodic regimes which appear disordered or chaotic. When these regimes are deterministic, that is, expressible as coupled differential equations and repeatable given the same initial variables yet highly sensitive to those initial conditions, their trajectories in phase space converge onto socalled strange attractors [Hnon, Pomeau, 1975]. Strange attractors are often complicated geometrical forms, depending on the dimension, which result from the trajectories of the iterated function stretching, diverging and folding between limits without ever visiting the same point twice. The strange attractor fills a fraction of its space with points, giving it a fractal dimension. Fractals are naturally produced by chaos; strange attractors exhibit self similarity on multiple scales [Hofstadter, 1985]. An apparent contradiction emerges from the two key concepts connected to strange attractors: attraction implies convergence of trajectories while sensitivity to initial conditions implies divergence of trajectories. What is important in this fact is that imperceptibly different initial conditions at the outset of a dynamical system lead to exponential differences later on in its evolution, a key component of Edward Lorenz's well known paper in which he presents a three dimensional mathematical model describing deterministic nonperiodic flow in thermal convection rolls [Lorenz, 1963]. His work calls into question the possibility of long range prediction of weather patterns. The Lorenz model exhibits strange attractors. 3 MAX and MIDIPascal In this study, dynamical algorithms are employed as a means of generating musical material in a MIDI based electronic music studio consisting of different synthesizers, samplers, and a Macintosh computer workstation. Initially, a two dimensional dynamical model has been implemented in MIDIPascal expressing a nonlinear force acting upon an orbiting particle [King-Smith, Herman, 1988]. See Figure 1, 3B.2 194 ICMC Proceedings 1993

Page  195 ï~~Figure 1: two dimensional nonlinear model implemented in MiDIPascal program Attractors; uses MidiPascalOefs, MidUtiiOets; consl n - 127; vat a. c. x. y. vx. vy. ax. ay: real; modx, mody, stp, result integer; procedure Walt (i: integer); var count Integer; begin for count:- 1 to I d o begin end; end; (procedure Wait...........) begin Showfrawing; MidlUtllnit(1000, 1000); (buffer size) x:= 15; (15) y:- -0.3; vy:- 0.0025; vx;- 0.5; a:- 2.68;(2.68 (chaotic regime)) c:- 158; (10, mass 33 (chaotic regime)) moveto(150 + 5" trunc(x), 150 + 5 "lrunc(y)); framerect(140, 140, 160, 160); repeal if ((x - a) (x - a) + y y) <- 1 then begin ax:= 1 1 (a - x); ay:- -1 / y; end else begin ax:- a-x; ay -y; end; if ((x + a) " (x + a) + y " y) <= 1 then begin ax: ax + 1 / ( -x); ay:- ay - 1i y; end else begin ax;- ax - x - a; ay:- ay -y; end; vX:=v x +ax / c; vy:- vy + ay / c; x;= x + vx; y: Y + vy; ltneto(150 + trunc(5 ' x). 150 + trunc(5 y)); modx:. (abs(trunc(x) " 100) mod n); mody:_ (abs(trunc(y) * 100) mod n); result:= MEvtOut(144, modx. 100, 0); (NoteOn 144-159) result:, MEvtOut(144. mody. 100. 0): (MEvtOut (statusbyte: INTEGER; datal: integer; data2: Integer; timestamp: LONGINT);) Wait(6300); (procedure for variable pauses) result:- MEvtOut(128, modx, 100, 0); '4(NoteOff 128-143) result:- MEvtOut(128. mody, 100. 0); until button; OulitMidi; end. In the model, vx and vy are the horizontal and vertical control velocities of the particle while ax and ay are accelerative forces acting on the particle along the horizontal and vertical axes. The variables x and y represent the present location of the particle. As can be seen, x and y are modified recursively in the model. Furthermore, the variable c, or particle mass, markedly affects the evolution of the system. The model is mapped or folded into MIDI pitch space with a modulus routine. The model's behavior over time is characterized by the emergence of a heterophony in which certain kinds of intervals and chords are "favored" by the system, due in part, no doubt, to the constraints of MIDI and the particular mapping of this model, but owing in greater part, I believe, to the nature of dynamical processes. This has been born out through ample experimentations with the values of variables and output mappings in the model. A consistent feature is the emergence of stable, sometimes quasi-tonal harmonic areas and energetic rapid-fire pulse trains. This two dimensional model sends visual output to the drawing window as the MIDI events are heard so that a correspondence might be drawn between the visual and auditory domains with regard to the emergence of stable or unstable attractors. Figure 2 shows several such orbit trajectories generated by the model. Figure 2: orbit trajectories of a two dimensional nonlinear model in MIDIPascal Among other algorithms that have been used are the simple iterative model: xn+l=f(xn); the 2 dimensional model: xn+1=axn-bYn+(1-a); Yn+1=bxn+ayn-b; and the 3 dimensional Lorenz model: dx/ y-ax; dY/t-xz+bx-y; d/dt=xy-cz. These algorithms have been realized in MAX, [Puckette, 1988, 1991]. With MAX, simple recursive functions and higher dimensional dynamical models are mapped onto pitch, velocity, timbre, dynamics, and duration on synthesizers and samplers and interacted with on the fly. "Expr" objects comprise the engines of the models as shown in Figure 3. As can be seen, octave mapping routines are realized with "mod" and "abs" objects. While all of the pitch material is generated by the computer, decisions of texture, register, and proportion are made by ear. In these models, the musical equivalent of a phase space is established in which there are continually evolving curves and orbits which tend to stabilize around periodic cycles or fly off into more chaotic or unstable regimes. ICMC Proceedings 1993 195 3B.2

Page  196 ï~~Figure 3: MAX patches for two and three dimensional iterative models These models are simple yet they yield quite varied and elaborate results when the slightest changes are made in the initial variables. To show this, the models can be mapped onto two dimensional pitch/time event plots in MIDI sequencer "piano roll" windows. Hence, certain geometrical patterns associated with the musical output became immediately apparent which exhibit stretching, folding, divergence and attraction. In Figure 4, musical flows are shown for the models in Figure 3. Figure 4: pitch/time event plots for musical flows in two and three dimensional iterative models " --:-..,:... -*--, U IM Y S Ue M 3 4 The Computer and The Creative Process While the preceding implementations of the models and their pitch mappings are simple, the compositional issues they highlight are not trivial. As a composer who uses these algorithms for pieces written for traditional acoustic instruments played by human performers, the mapping into pitch spaces and their connective flow in time is of crucial interest. The successful use of the models depends in large part upon the composer's ear. Though the specific output of the dynamical models change quite sensitively according to initial variables, the models exhibit consistent meta-behavior, including absence of large scale closure, emphasis on process, and a highly charged periodic rhythmic surface with deeper levels of slower harmonic rhythmic. While these characteristics point to the wonder and force that these models hold, they also highlight those areas where the composer best incorporates artistic judgement based upon more linear thinking. The willingness to circumvent algorithm as the ear suggests is all important in the rendering of them: an approach decidedly non-purist since the algorithms are approached as procedures which suggest potential paths, not prescribed paths. The use of the computer in the realization of these mappings is analogous to improvising at a musical instrument since MAX allows for real time interaction with the model as it outputs streams of MIDI data. What is different is that what is created with the computer calls into question traditional notions of invention, musical identity, and inspiration. For example, when working with dynamical models such as the logistic map or the Lorenz attractor, I have had the sense that what I was hearing was an object "out there", occupying a preexistent Platonic realm which is impossible to quantify or locate (nor is that so important), but which resonates "in here", at the composer's center, but quite apart from that which is merely personal and subjective. There is more a sense of discovery than of creation in the traditional sense of that word. What I hear is not the result of my projecting my own musical personality into the musical landscape, it is rather more like taking the first steps of a journey into a musical landscape that I could not have imagined before. That landscape seems to me to exist both in time and out of time: I am a visitor to a terrain that yields secrets as I walk through it in time, yet its forms seem to me to have been there all along and will be there again in the future given their deterministic nature. Also contributing to this sense of "otherness" about which I am speaking is that dynamical systems often produce musical output whose 3B.2 196 ICMC Proceedings 1993

Page  197 ï~~richness of design far exceeds what is put into it at the outset. Very simple iterative functions yield trajectories characterized by increasingly complex, self-referential patterns. For example, the subharmonic cascades created by bifurcation, the universal principle behind transition phases towards more turbulent states via period doubling, are viable as source material. Strange attractors yield musical flows that fire the imagination and are applicable across scales in both macro and micro elements of musical design. With MAX, one may experiment live with musical processes set in motion by the algorithm, thereby affecting the evolution of a piece. So the journey through the dynamically modeled musical landscape (rather than the landscape itself) alters according to ones interaction with it. In my work, the initial decision to restrict the musical output to a largely monochromatic palette of timbres is intentional in order not to detract from the geometry of the system, which in my mind has been of primary interest. However, music is not geometry, and it is clear that timbre and synthesis is an area where the application of chaos algorithms warrants deeper exploration and in fact one in which there has been comprehensive research already [eg. Truax, 1990; Lippe, 1993]. In the case of the models presented here in MAX in a MIDI-based system, there have been some interesting results obtained through the mapping of the models onto the control of operator and envelope output levels, wave sequences, and microtuning by using the "sxformat" object. Since "sxformat" can take output of "expr" objects as arguments for system exclusive data bytes, synth modules and samplers can be made to dynamically interact with the models to create a richly varied palette of timbres. 5 Conclusion Throughout these preliminary encounters with dynamical models and mathematical chaos, I have found myself thinking about a conversational exchange between the composers John Cage and Earle Brown in 1961 [Cage, 1961]. Cage and Brown were discussing the statement by Coomaraswamy that the function of the artist is to imitate nature in its manner of operation. This led Cage to the opinion that science and art are intertwined. As science expands its understanding of how nature operates, artists are enriched and change as a result. The mathematical models which express dynamical chaos hold particular fascination and potential because they express profound truth about the manner in which the natural world operates around us and within us. Cage was able to embrace indeterminacy out of regard for the manner in which he understood nature to operate. Since then, much territory has been explored on the subject of chaos where indeterminate elements mix with deterministic ones. The principles embodied by these models speak across disciplines and composers have embraced them as a powerful new paradigm for musical design. References [Cage 1961] John Cage. Silence. Â~ 1939-1961 by John Cage. "Where are we going? and What are we doing?", pp.194-195, 1961. [Degazio, 1993] Bruno Degazio. New Software Composition Tools. Proceedings of the Fourth Biennial Arts and Technology Symposium, The Center for Arts and Technology at Connecticut College, pp.15-26, 1993. [Di Scipio, 1993] Agostino Di Scipio. Composing with Granular Synthesis of Sound in the Interactive Computer Music System. Proceedings of the Fourth Biennial Arts and Technology Symposium, The Center for Arts and Technology at Ct. College, pp.38-52, 1993. [Gogins, 1991] Michael Gogins. Iterated Functions Systems Music. Computer Music Journal, 15 (1), pp.40-48, 1991. [Grebogi et al., 1987] Celso Grebogi, Edward Ott, James A. Yorke. Chaos, Strange Attractors, and Fractal Basin Boundaries in Nonlinear Dynamics. Science,.238: pp.632-638, 1987. [Hnon, Pomeau, 1975] M. Hnon and Y. Pomeau. Two Strange Attractors with a Simple Structure. Lecture Notes in Mathematics, 565, 1975 [King-Smith, Herman, 1988] Oliver King-Smith, Martin Herman. MIDIPascal mathematical design, programming by Oliver King-Smith with MIDI implementation by Martin Herman, 1988. [Lippe, 1993] Cort Lippe. A Musical Application Using the IRCAM Signal Processing Workstation: Real-time Control of Granular Sampling via Turbulence Algorithms and Stochastic Processes. Proceedings of the Fourth Biennial Arts and Technology Symposium, The Center for Arts and Technology at Ct. College, pp.114-117, 1993. [Lorenz, 1963] Edward Lorenz. Deterministic Nonperiodic Flow. Journal of the Atmospheric Sciences, 20 (130): pp.130-141, 1963. [May, 1976] Robert M. May. Simple mathematical models with very complicated dynamics. Nature, 261, pp.459 -467, 1976. [Pressing, 1988] Jeff Pressing. Nonlinear Maps as Generators of Musical Design.Computer Music Journal, 12 (2), pp.35-46, 1988. [Puckette, 1988] Miller Puckette. The Patcher. Proceedings of the 1988 International Computer Music Conference (ICMC). San Francisco: International Computer Music Association (ICMA), 1988. [Puckette, 1991] Miller Puckette. Combining Event and Signal Processing in the MAX Graphical Programming Environment. Computer Music Journal, 15 (3), pp.68-77, 1991. [Truax, 1990] Barry Truax. Chaotic non-linear systems and digital synthesis: An exploratory study. Proceedings of ICMC9O, ICMA, 1990. [Xenakis, 1991] Christoph Muinch & Iannis Xenakis. Musik, Mathematik und chaotische S ysteme (Interview with lannis Xenakis). NMZ, Seite 3, 1991. ICMC Proceedings 1993 197 3B.2