On the other hand, it seems that much less attention has been paid to what might be called fractal waveform generation, especially outside the area of physical modelling, where the chaotic aspect of natural and instrumental sounds is investigated within the context of complex dynamical models (Keefe,D.). The computational demands of such models are considerable, and the modelling process itself is hardly a trivial task; this paper starts from the premise that computationally undemanding iterative formulae can be constructed which exhibit similarly complex behaviour over time, analogous to, but not analytically derived from, the behaviour of a physical system, and which may form the basis for an arithmetical instrument.
In the creation of a typical fractal image, successive iterations of a recurrence formula (in the case of the Mandelbrot set and many others, in the complex domain) are tested for convergence, limit cycles or divergence. One or more coefficients of the formula are modified in a linear, ordered way to generate, in most cases, a coloured plane image. Beyond this graphical aspect, the exact character of the generated numeric sequence is of little concern.
In the formulae described here, the potential musicality and stability of the generated sequence is of primary importance, and the modification of coefficients and variables chosen for their musical interest. Where necessary, a non-linear constraint formula is applied to keep the sequence within bounds. There is no claim that the formulae are fractal in the strict sense; the concern is solely with musical output.
The examples we have investigated so far can be seen either as wave forms or as envelopes. We present one sample recurrence relation which can be configured to act in either mode. The wave form example is given in substantially more detail, as that is our main concern, but the envelope has some properties which suggest intriguing possibilities.
2 Z = Z + C new oldcan be recast in the real domain as a difference equation, with one necessary change of sign:
2 X = X - C n n-1where, generally, 0 < C << 1.0.
This will generate a simple exponentially decaying sequence, which is however forced into extended and possibly sustained oscillation by the negative C. It is assumed at this stage that the initial conditions (i.e. X0 in this case) are zero; a non-zero value for X0 will have the effect of altering the phase of a periodic output. By itself, this is almost entirely predictable, and of no great significance. It is sufficient to note that the DC offset caused by the constant C, can be simply removed in a practical implementation, and that even in this elementary example, a distinct evolution of the waveshape can be observed.
There are two principal modifications to this basic formula which can be made, each of which leads to worthwhile changes in output. The first is to add a delay to the difference equation:
2 X = X - C n n-Lwhere L is any arbitrary sample offset; we take L = 16. The resulting output has the form of a square wave with slightly sloping sides. The second, related modification is to add a further (linear) delay element, before or after the non-linear term, thus forming a non-linear filter:
2 X = X + d X - C n n-1 n-2
2 X = X + d X - C n n-L n-Mwhere 0 < M < L.
2 X = X + d X - C n n-L n-1The rounding effect of the positive linear term is clear even at d = 0.25; with judicious values for C the waveform can be made to reduce to something approaching a sine wave
The effect of a negative d is more significant --- in
fact it forms the basis for the great majority of the examples
presented here. Whereas a large negative C tends to produce
crude linear-segment oscillations (to say nothing of the large DC
offset) through successive iterations, a large d can in
fact endow impressive rounding to the waveform (i.e. by
extending its period), or add fractal complexity to it, and C
can (indeed must) be kept small. In some cases, large values of
d (i.e. close to -1) introduce ringing to
an extent that the underlying square wave shape can be completed
swamped by more rapid oscillations in forms suggestive of grains or
Note, again, the marked changes in grain profile as the waveform develops. It almost goes without saying that the grain shapes differ according to the length of the delay: the difference between odd and even lengths is especially striking.
An especially fruitful strategy is to give the closer of the two delayed terms an arbitrary offset up to L-1. The resulting waveforms can range from the highly complex to relatively simple pitched sounds. The latter can be truly simple (a single wavecycle repeated), but most exhibit a continually shifting phase between frequency components, surely one of the definitive features of `fractalness'.
Although it is rarely safe to generalise in a subject such as this, it has been observed that relatively prime ratios between L and the offset most often lead to the most elaborate waveform evolutions, whereas simple ratios can lead to very rapid convergence for all but the most extreme parameter values.
The period of the waveform is not necessarily of length L
(although this is true of the more elaborate formulae described
later); the period can be be three to four times L, even for
L=2. For many of these waveforms, C functions as a sort
of modulation index --- indeed the spectrum can look remarkably like
that of an FM-generated signal
However, as C is raised, a chaotic threshold is reached, inducing strange attack patterns
Note also the general changes of period, despite the fact that L is the same in each case. This is an especially clear demonstration of the natural rule that C + d must not exceed a threshold value (in the absence of limiting) of around 0.95, and that a high C induces a long attack phase.
Interesting as these waveforms are, a further level of sophistication in the formulae has proved even more fruitful. There are two basic oscillator types to be considered: the filter type described by formula 1, and the extended delay oscillator of formula 2, which will, for reasons that will become apparent, be called a `seeded' oscillator.
By adding a third linear term to the basic formulae just described, we establish a structure which contains an explicitly linear filter element. It is clear that only the application will decide whether this formula functions as an oscillator or as a non-linear filter:
2 X = a X + b X + c X + C n n-1 n-2 n-Mwhere the delay M <= 3
This exhibits most of the characteristics of its predecessor, such as the rounded square wave typical of the longer delay lengths, with the expected refinement of enhanced rounding to most waveforms, which range from the almost sinusoidal to the semi-chaotic. Calculating the spectra of some of these decaying waveforms indicates that use of this formula as a non-linear filter could well be musically worthwhile. Our experiments with this are continuing.
2 pi n X = A sin(------) N Lwith n in [0, L-1]where A is an amplitude (0< A < 1) and L is a delay in samples. Then for n <= L
2 X = a X + b X + c X + C n n-L (n-L)+1 (n-L)+2
This produces what is the most complete ``arithmetic instrument'' so far presented, and also the most acoustically interesting
A description of this waveform surely constitutes that of an archetypally fractal sound: a chaotic attack which decays to a local minimum as it becomes periodic with a progressive loss of high frequencies, but with more or less subtle continuous phase shifts through the steady part of the sound, which has increased in amplitude from the minimum. In this example it is possible to identify a square wave shape during the transition, but this is not an unavoidable feature, as shown with slight changes to the parameters. In other cases, the waveform will become more complex as it evolves
These examples also illustrate the ever present problem of numerical overflow. We want to retain as many of the `fractal' features of these waveforms as possible, while, ultimately, being able to play these instruments in real time. In this case we can see that overflow can happen during the chaotic attack, and that if it can be constrained, the waveform will be able to continue towards its periodic, stable, state.
This requires a non-linear compression function which will leave low amplitude samples substantially unaffected, while constraining high values to some upper limit. There are some high-powered functions which can be used, such as the hyperbolic tangent without losing the desired fractal behavior, but we still seek a limiting function which can be computed rapidly on a DSP. Simple attempts so far have destroyed the essential nature of these sounds.
Such a function can be philosophically and aesthetically incorporated into the oscillator by analogy with acoustic instruments, whose otherwise chaotic behaviour is constrained by any number of fixed and variable physical systems - some deliberately chosen for musical effect, such as string and brass mutes, or the cloths placed inside a drum. On the other hand, some researchers may well feel that part of the fascination of these formulae lies in the search for interesting and musically useful waveforms without the use of such a safety net.
A Family of EnvelopesThe same recurrence relation, with the constant C always zero, but with non-zero initial conditions can be used to generate a family of envelopes, all of which show characteristic decay shapes, but the detailed structure, and in particular the total length of the sustained time is not a simple smooth function of the parameters. The recurrence formula is2 X = X - d X X = 0.5 X = -a n n-1 n-2 0 1
the two parameters a and d defining the family. The general shape of these envelopes is seen in
where the initial disorganised variations can be seen to give way to a gentle decay. In fact the structure of the decay is more complex that the figure indicates.
As might be expected with the chaotic origin of the recurrence relationship, the length of the decay is not a simple smooth function of the two parameters. In
the surface where the height is the length of the note, and a goes from 0 to 1 across the picture, and d goes from 0.99 at the front to 1 at the back is shown. This illustrates the non-smooth nature well. What this does open up is the possibility of an instrument which has notes which do not sustain as well as others, with resonances and dead points as the parameters vary slightly, and hence has a potential ``natural'' feel to it.
ConclusionWhat is obvious from all the equations we have described is that they are easy to calculate on a simple DSP chip, or on a simple computer. The wave forms do not need much storage for their calculation either. We have not presented here the frequency analysis of the waveforms, but they show pleasing characteristics of strong fundamental pitch, with little or no high frequency noise.
There is insufficient space here to show all the properties of these wave-forms -- natural sound evolution, low-pass filters with resonant frequencies, sustaining notes, rapid decay etc. We had to resist the rich vistas which opened out at every variation. We have hardly begun to explore this simple wave-generator. We have plans to create a unit generator for a system such as Csound (Vercoe,B.) as soon as we can ensure its safety.
We commend these relations as a rich area for future synthesis engines, as although the formulae are simple the results look, and sound, attractive, with seemly infinite subtle variations.
Chaotic systems as simple (but complex) compositional algorithms.
Comp. Music J., 16(3):33--47, 1992.
Datamusic, London, 1992.
Atari ST Software package.
D. Jaffe & J. Smith.
Extensions of the Karplus-Strong plucked-string algorithm.
Comp. Music J., 7(2):56--69, 1983.
R. Karplus & A. Strong.
Digital synthesis of plucked string and drum timbres.
Comp. Music J., 7(2):43--55, 1983.
Douglas H. Keefe.
Physical modeling of wind instruments.
Comp. Music J., 16(4):57--73, Winter 1992.
The Fractal Geometry of Nature.
W. H. Freeman, 1982.
Csound --- A Manual for the Audio Processing System
Media Lab, M.I.T., 1993.
firstname.lastname@example.org Last modified: Thu Sep 5 20:59:23 1996