home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 24
/
CD_ASCQ_24_0995.iso
/
vrac
/
wtf30.zip
/
WTF30J.TXT
< prev
next >
Wrap
Text File
|
1995-05-31
|
47KB
|
1,107 lines
The Well-Tempered Fractal v3.0
A Composer's Tool for the Derivation of Musical Motifs, Phrases and
Rhythms From The Beauty and Symmetry of Fractals, Chaotic Attractors and
Other Mathematical Functions
Copyright 1993-1995
By Robert Greenhouse
Abstract
The Well-Tempered Fractal is a program which composes musical melodies by
mapping fractal images to musical scales. Ten different fractal types may
be mapped to twenty-one different musical scales. Twenty symmetry operators
may be applied to the image as it is plotted. The output may be heard on an
ordinary PC speaker or written to a MIDI event file which can be converted
to a standard MIDI file for use with MIDI instruments or sound cards. The
aim of the program is to produce fractally generated melodies to be used by
composers as the starting point for entire musical compositions.
Table of Contents
Abstract 2
Contents 3
Introduction 4
An Important Note on the Philosophy Behind the Program 6
An Overview of the Musical Composition Process 7
How the Program Works 8
Selecting a Fractal 8
Symmetry 8
Music 8
Data Compression 8
Converting the Midi Event File 10
Documenting the Compositional Process 11
The Fractals 13
Mira Fractal 13
KAM Torus Fractal 14
Hopalong Fractal 15
Seahorse or Hippocampus Fractal 16
Chebychev Functions 17
Ikeda Attractor 18
Julia Fractal 19
Ivanov Fractal 20
Stewart-Golubitsky Chaotic Icons 21
Duffing Attractor 22
The Scales 23
Active Keys for WTF30 (Command Summary) 24
Release History 26
What's Next ? 27
Registration Deal 28
Registration Form 29
Introduction
The Well-Tempered Fractal was originally conceived after several years of
experiments in generating fractally derived sounds. Music From the Fringe
was a series of programs which explored the potential of fractals to create
music. Although many fascinating sounds could be produced merely by mapping
calculated values to audio frequencies, the result was never musical in the
way that most people think of music. Hoots and howls and screeches were
intriguing and even exciting to a few, but most regarded them as bizarre
and annoying.
It was clear that if fractals were ever to be used to produce music which
could pass as musical, it would not come about by simple or even complex
mathematical equations alone. What was missing was some degree of artistic
control over the mathematics. The Well- Tempered Fractal was designed to
provide that control over the mathematics.
Several things were clear from the initial experiments with Music From the
Fringe. First of all a mapping scheme which permits a continuum of audio
frequencies over a portion of the human hearing range will produce music
which sounds out of tune. Although the human ear can hear an incredible
number of frequencies, in general we prefer discreet notes in our music. A
range of less than one hundred notes will cover all the traditional music
that has ever been written down. The WTF would therefore be based on
mapping fractals to discreet notes of a scale in a limited range of human
hearing.
The second thing which flows from the first is that music as we normally
think of it is of much lower resolution than a fractal image. That is we
will be mapping a very high resolution image to a very low resolution sound
scale of rather limited range. The human ear hears best over an eight
octave range providing fewer than 100 discrete notes (more if microtonal
music is used). However most musical melodies use a much narrower range
than 100 notes. The WTF would therefore need to produce low resolution from
high resolution data.
The third point which was clear from the early experiments was that few
listeners would be willing to listen to music derived from the tens or
hundreds of thousands of points needed to construct a fractal image. The
amount of data present in a fractal is far more than in a typical musical
composition if we restrict data to pitch and duration. Again this implies
that in order to create music from a fractal image, the WTF will have to
discard a majority of the data.
A fourth point which was obvious before any experiments but which became
painfully obvious from Music From the Fringe, is that listeners like some
degree of order which is at least comprehensible. Music which is devoid of
recognizable pattern quickly becomes uninteresting to most listeners simply
because they fail to understand it. Composing music is very much like
writing literature. If you scatter letters haphazardly over a page no one
is much interested, even if there is some scheme of arrangement to the
letters. Unrelated words make some recognition possible, but still there is
not much interest. Literature requires themes, phrases, ideas all tied
together in a coherent unit before it is interesting. Likewise if the
listener cannot recognize any order in the music, that music is doomed to
be at best a curiosity rather than good music. The WTF would therefore have
to create coherent patterns for listeners to understand.
A fifth point related to the previous is that music which wildly jumps
around is not very interesting for long nor is music which is too
predictably correlated. Even if there are recognizable patterns in the
music, most great music does not constantly jump all over the entire range
of permitted frequencies. It follows some simple grammatical rules which
rely on relatively small intervals mixed with step-wise motion within
musical phrases. On the other hand, if music wanders aimlessly in a
stepwise fashion or is too predictable, the listener soon is bored. What is
needed for interesting music is a careful mix between the orderly and
predictable and the surprising and unpredictable. The WTF would therefore
have to overcome this tendency of fractals toward wild fluctuation over a
wide range and at the same time avoid continuous functions which step by
step would lead the listener into complete boredom.
In summary the WTF would have to do the following:
Produce discrete musical notes rather than precise frequencies.
Create music over a limited musical range of a few octaves.
Create music using only a fraction of the total number of data
points in a fractal.
Produce recognizable patterns in the music.
Produce music which neither jumps around excessively nor is too
predictable and orderly.
At first glance these appear to be rather severe limitations to be imposed
on a branch of mathematics whose beauty is derived from its complexity. The
production of relatively simple music from very complex mathematics is
bound to leave mathematicians and composers alike somewhat dissatisfied.
An Important Note on the Philosophy Behind the Program
WTF is not intended to be an automated composing system which allows one
mindlessly to press a key and produce a piece of music. To be sure, WTF
could be used in this way. It can also be used as a pleasant screen saver
or just as an amusing toy.
My real intention in writing WTF is to use fractals to produce raw data
for musical compositions which skilled composers may then manipulate, add
to, change, cut and paste, add improvisation to or do just about anything
that the imagination will lead them to do.
The point is that the ideas which lead to the musical compositions are
generated from fractals and as such they may have a quality to them that
would be hard for a traditional composer to generate. The constant
bombardment of musical phrases and ideas which are considered acceptable or
pleasing music is hard to escape if one lives in our society today.
Consequently it is difficult for most composers to come up with truly
original music. Avant Guard music tends to be so bizarre that the average
listener is alienated.
Foremost in my mind remains the principle that in the end the composer
must retain artistic control over what he or she puts down on paper.
Without this principle it is hard for me to accept what the program
produces as art. With WTF it is possible to produce a new full length
composition in score notation in about 10 minutes, assuming that the
appropriate sequencing and notation software is available. Possible, that
is, if the user does nothing but convert WTF output into musical scores.
That means a total of about 48 new compositions in an average 8 hour day!
It would not take long to overtake Telemann as the most prolific composer
in history going at that rate. But the quality of the output would be as
good as one could expect with only ten minutes work involved.
I have spent as much as perhaps 10 - 12 hours manipulating the data of a
single fractal into a final composition before I was satisfied with the
result. In the end the music was a composition which I could probably never
have imagined without the aid of a computer, but which the computer could
never have produced in such an elaborated form.
An Overview of the Musical Composition Process
The program is started by typing "WTF30" followed by <CR> (the enter key).
The title screen appears and any other keystroke starts the program. The
mapping scheme is quickly calculated for all the different musical scales
and the first fractal begins.
The user can choose a fractal type with the function keys F1 - F10, but the
coefficients for each function are randomized so that no two fractals are
exactly alike. When an interesting pattern comes up, the user may start the
fractal over again from the beginning by hitting <CR> or generate a new
fractal of the same type with the <Space> bar. Music may be turned on by
pressing <M> at any time (PC speaker) to give an idea of what the fractal
sounds like. It may be toggled off to speed up the fractal display. In
addition the X or Y component of the music may be toggled on or off by
pressing <X> or <Y>. Look in the status box to see which is playing.
Once a potentially interesting musical fractal is found, scale mappings may
be tried by using the left and right arrow keys. The name of the scale
appears in the lower hand corner (status area) of the screen. Other
parameters may be adjusted such as the offset and length of note, but more
will be said about that in the control summary section below.
When the user is ready to capture the music as output, pressing <W> (for
<W>rite) will begin writing a MIDI event file. A maximum limit of 100,032
bytes has been set since the user's hard disk might rapidly fill up without
that limitation. The recording process may be started at any point in the
fractal or right from the beginning by pressing <B> (for <B>eginning)
followed by <W>. Typing <W> again stops the recording process.
When the file is finished (the status box shows the work "Midi" while the
file is being written), the user may exit or continue to look for more
fractals. The output file called "TXT2MIDI.???" (where ??? represents a
sequential numbering) contains information on all the Midi events - pitch
and time only - which have occurred. In addition the header contains
information about the kind of fractal and the parameters used by the
program to generate the music. This file is then processed by a utility
called "T2MF.EXE" (text-to-midi-file). T2MF.EXE and its companion program
MF2T.EXE are part of a wonderful set of Midi utilities written by Piet van
Oostrum of the Netherlands. They allow the interconversion of Midi event
files and standard .MID files, thus making the job of Midi file creation an
exceedingly simple process. The program archive is called MF2T.ZIP and is
available from Piet's ftp site at ftp.cs.ruu.nl, an incredible repository
of Midi information and files.
After the .MID file is created, it is loaded into the user's preferred
sequencing software and now the real work begins. An appropriate voice is
assigned (often one voice will sound much better than another) and then the
composer manipulates the data in any way which seems appropriate. (This is
where the real art begins as well.) When the composer is satisfied with the
result, it may be printed out in score notation or played by whatever Midi
setup is available.
That in brief is how a piece is composed with WTF.
How the Program Works
Selecting a Fractal
After typing "WTF30" the title screen appears. Following any key press,
the notes for the scale mappings are quickly calculated and loaded into
memory. The default fractal (Mira) begins to appear after the coefficients
of the function are randomized. At this point I would suggest that the user
experiment with the F-keys and check out the different fractal types which
are available. F1 gives the Mira fractal, F2 the KAM Torus, F3 the
Hopalong, F4 the Seahorse or Hippocampus fractal, F5 Chebyshchev fractal,
F6 the Ikeda Attractor, F7 the Julia fractal, F8 the Ivanov fractal (Thank
you, Oleg!), F9 the Stewart - Golubitsky icon fractals, and F10 the Duffing
Attractor.
Each time the <Space> bar is pressed, a new fractal of the same type
begins by randomizing the coefficients of the functions. When an unstable
condition results, the fractal terminates itself. A given fractal may be
started from the beginning by pressing <CR>, in which case it starts
immediately, or by pressing <B> in which case it pauses and waits for any
keypress before starting over. At any point the fractal plot may be paused
by pressing <P>.
Symmetry
Symmetry is imposed on any fractal plot by using the number keys or <Shft>
number combination. Symmetry operators multiply the number of points being
plotted by plotting symmetrically placed points which correspond to the
calculated one. This is a very important feature in the composition process
since symmetry in the plot results in a kind of symmetry in the music. It
also takes a continuous plot and breaks it up into several symmetrically
disposed plots thus turning boring music into relatively interesting
melodies. Such plots as the Duffing Attractor may greatly benefit by the
use of symmetry in creating music. A summary of the types of symmetry
available appears in the command summary.
Music
Music may be turned on at any point by hitting the <M>usic key. Often it
is more efficient to leave the music off until an interesting fractal is
found since the calculation and display is greatly slowed down by playing
music. The X or Y component of the music may be selectively toggled on or
off by hitting <X> or <Y> once the music is playing. The length of the
notes may be changed by hitting <L>egato, <N>ormal, or <S>taccato. The
velocity of execution of the music may be changed by using the <home> and
<end> keys (the tempo varies between 40 - 250 bpm and the notes played are
sixteenth notes). The musical offset (i.e. the key of the music) may be
changed with the <up> and <down> arrows or shifted to a different octave
with the <PgUp> or <PgDn> keys.
At present the rhythmic variations available are very limited at this
time. Duple rhythm is the default and that may be changed to triple rhythm
by using the <R>hythm toggle key. An <I>mprovise mode interjects trills and
ornaments at random throughout the music.
Data Compression
As pointed out in the introduction few people would sit through a musical
piece of a million or even ten thousand notes. People tend to have lives to
lead and consequently have a somewhat limited attention span. This is one
of the basic challenges in extracting relatively low resolution music out
of relatively high resolution fractals. My answer to this challenge is
through data compression or perhaps more appropriately expressed,
"selective data extraction".
Simply stated, this means that we can sample every 51st note or every
798th note instead of every note in the entire fractal plot. If we do not
use this selective sampling technique, we must necessarily be content with
mapping only a tiny fraction of the entire fractal to music. This is a very
important parameter of the compositional process which the composer needs
to learn to exploit. It is one of the mathematically creative aspects of
composition which remains under the artist's control. With it one can take
a single fractal and extract thousands of different compositions depending
upon how often data is extracted from the plot.
The default CF or compression factor is 1. This means that every point of
the fractal is mapped to music. As stated above the plotting process is
greatly slowed down if the music is turned on and the default compression
factor is used. If the CF is set to 51, then 51 points will be plotted for
every point which is played. Obviously unless one has super-computing
resources, there will come a point where the CPU cannot calculate fast
enough to play smooth continuous music. On a 33 Mhz 486 machine this
happens at a CF in the hundreds. A machine without a math coprocessor will
be severely limited in this aspect. However it does not matter from the
point of view of the MIDI file produced. I usually turn off the music when
I record a MIDI event file. The data compression factor determines which
notes to write to file.
Data compression is applied to the plotting fractal by using <Ctrl>
<UpArrow> or <Ctrl> <DownArrow> to increment CF by 1. Increments of 10 or
100 are available using <Ctrl> in conjunction with <PgUp> / <PgDn> and with
<Home> / <End> respectively. The status area on screen shows the current CF
value.
In conjunction with the CF function of the program, there is a trace mode
which circles in white each point as it is played or written to file. The
trace mode is toggled by the <Ctrl><5> combination only while the music or
Midi record is on. This trace mode becomes vital in understanding the
patterns of notes which are being played or written to file.
For example, if one is using a CF = 7 on a fractal to which C-7 symmetry
has been applied (by pressing the <7> number key), it becomes obvious in
the trace mode that the symmetry function serves little purpose since the
music being played comes from every seventh point and thus is equivalent to
a CF = 1 and no symmetry operator applies (i.e. C-1, the identity). On the
other hand, if the CF is now changed to 6 or to 8, the music now comes from
regularly rotating segments of the seven fractal components of the
symmetry. Change the CF to 9, 10, 11, 12, or 13 and a completely different
musical piece results! At CF = 14, then a plot with C-7 symmetry yields the
same result as no symmetry operator and a CF = 2.
By carefully studying the behavior of the selected notes using the trace
mode, one may experiment and choose the desired result. The trace mode
circles may be erased by hitting <CR> and starting the fractal over again.
One often observes that in some of the plots that radiate out from the
origin in a polar fashion (e.g. Mira, KAM Torus, Ivanov, etc.) a given CF
will select a clockwise sequence of plotted points while incrementing the
CF by one gives a counterclockwise sequence of points. In such a function
as the Duffing Attractor which is painfully boring in the C-1 symmetry mode
due to the continuous nature of the function, the use of CF allows one to
sample the function at any point interval along the function and thus make
an interesting piece of music in doing so.
Converting the Midi Event File
Once the Midi event file is written it must be converted into a standard
Midi file in order to play it on a sound card, module or synthesizer. Piet
van Oostrum of the Netherlands has written a wonderful utility which makes
the creation of Midi files a trivial matter of writing a simple event file
with the channel, pitch and duration information of the notes and a simple
header. The output file is processed by T2MF.EXE (text-to-midi-file) and a
standard Midi file results. A companion utility to reverse the process is
also included in his archive, called MF2T.ZIP. The package is available by
ftp from ftp.cs.ruu.nl.
The output file created by WTF30 is converted with T2MF.EXE and the
resulting standard Midi file can be loaded into any standard sequencing
software or score notation software which will read Midi files.
Now the real work begins. The raw data is assigned any suitable voice, is
cloned to other tracks, cut, pasted, transposed, notes extracted onto other
tracks, notes lengthened, shortened, accented, or whatever the composer's
imagination dictates. Rhythm patterns may be discovered which are regular
and percussion parts may be composed to accentuate these rhythms. The
default 4/4 meter may (and probably should) be thrown out and new bar lines
drawn according to the patterns found.
Not every file which is written will necessarily be fruitful material for
composition. In fact the user can generate far more data than could ever be
used in an entire lifetime of composition. Most of it will eventually be
discarded. But it is fun to see what comes out and what can be created from
it.
Documenting the Compositional Process
Now for a bit of controversy:
In my discussions with "serious composers", I have often run into virulent
anti-science sentiments when it comes to creating music. Comments such as
"I don't need to see any formulas to know if it's good music" or "Science
has got no place in the artistic process" have been hurled at me in flaming
messages by people who either do not understand the scientific method or
who cannot accept the use of science and art together. Epithets which I
will not repeat here have been used against me for my attempts to create
"bogus art". It is clear that such people do not understand what is going
on here.
I strongly believe that if I am to claim that the music which I produce
using the Well- Tempered Fractal is indeed fractal music, I must
demonstrate that this is so for others to see. This is not traditional
music. The music results from an intimate mixture of art and science. Art
and science have different rules of play which are often in conflict. Art
tends to be emotional, intuitive, and expressive whereas science tends to
be rational, provable and descriptive.
It is not sufficient to show a pretty design, play some pretty music and
then say the music came from the design. If I invoke a mathematical
calculation as the source of that pretty music, my calculations must be
open to scrutiny by other experimentors or else it is not good science. On
the other hand, if the result does not please the ear in some way, then it
is not good music.
What we have here is a new mode of expression which is neither pure art
nor pure science. It is sure to offend purists on both sides for that
reason. To be complete, the finished product should consist of a formula,
an image and sound. Missing any one of these components and one is left
with an incomplete work. Music which is called fractal without offering
mathematical data is simply music. Likewise, a fractal which is claimed to
be musical with no aural data is simply a fractal.
As a means of documenting my work, I do the following:
[Begin the science]
1. A resident screen capture program is loaded before starting WTF.
[Enter a bit of artistic intervention]
2. An interesting fractal is captured as a bit-mapped image by the
screen capture program.
[Continue pure science]
3. A Midi event file is written for that fractal.
4. The coefficients and name of the fractal type, the compression
factor, scale type, and offset are read out of the header of the
Midi event file and noted as the parameters required for the
generation of the raw notes.
5. The standard Midi file is created from the event file.
[End science]
[Begin art, albeit computer-aided art]
6. The Midi file is manipulated in a sequencer and used as the
starting point for a musical composition.
[Pure art]
7. The composer says that it is good!
[Final housekeeping]
8. The final composition is saved under a different name, thus
preserving the original unmodified Midi file as evidence of what
actually came out of the fractal. The new Midi file is evidence of
what the composer did with that raw data.
[End of the process]
In the end, of course, only the final composition is played. But as
evidence of the creative process I have the image, the parameters used to
create the image and the music, the original raw musical data which
resulted from the calculations, as well as the final composition. The
entire body of evidence is in fact a scientific experiment which yields a
beautiful product. It becomes a beautiful product when and if the composer
decides it is so. The composer may work with the data for a while and
discard it if it yields no musically interesting results. Artistic control
is thus firmly maintained. The raw data is computer generated, but the
final product has the stamp of approval of the composer and thus it can be
called art. The composer is left to defend his artistic judgement in the
matter.
The process in some ways is similar to the complex chemical synthesis of a
drug in the laboratory. To appreciate the beauty and art which goes into
the making of the drug, one needs to do more than cure his ill with the
drug. To be sure one may take a drug to cure his ills and never question
where the drug came from.
To fully appreciate the achievement of the synthesis of a drug one must
study the body of evidence to see how the idea was conceived, executed,
tested and brought to its final place in the market as a medicinal agent.
Such things as the concepts behind the drug's mechanism of action or the
laboratory synthesis of the drug add to a fuller understanding of the
achievement of the action of the drug upon the sick person.
Likewise one can listen to "fractal" music and not care where it came
from. But seeing the design, knowing the math by which it was calculated
and seeing and hearing the raw data which led to the final composition adds
to the beauty of the process and provides a greater appreciation of the
achievement.
[End of controversy]
The Fractals
Many of the fractals used in the WTF are well known and documented in
other books and thus little or no theory is discussed here. They are
presented here below in algorithmic form so that the user may see my
implementation of the particular fractal. In some cases I have placed
limitations so that the fractal will stay within certain limits and in
other cases I allow runaway fractals to begin again at a randomly selected
starting point on screen.
The Mira Fractal
The Mira Fractal: This beautiful and varied pattern is described in Hans
Lauwerier's small but fascinating book Fractals: Endlessly Repeated
Geometrical Figures (Princeton Science Library: 1991).
The Mira fractal is produced by the following pseudo-code:
Pick a0, x0, y0
Pick B close to 1.0
a = a0
c = 2 - 2 * a
x = x0
y = y0
w = a * x + c * x * x / (1 + x * x)
do:
skip first 100 iterations
Plot x, y
z = x
x = B * y + w
u = x * x
w = a * x + c * u / (1 + u)
y = w - z
loop
The KAM Torus Fractal
The KAM Torus fractal is a weird and wonderful figure which is described
in the documentation to FRACTINT. It is produced by the following
pseudo-code:
Pick a [1 - 100]
Pick F close to 1.0
Pick OrbitIteration [e.g. 150]
Pick OrbitIncrement [e.g. 0.005]
Pick Orbit [e.g. -1.2]
Pick MaxOrbit [e.g. 8]
orbit = - 1.2
do
orbit = orbit + OrbitIncrement
x = orbit / 3
y = orbit / 3
do
xnew = x * COS(a) + (x * x - y) * SIN(a)
ynew = x * SIN(a) - (x * x - F * y) * COS(a)
x = xnew
y = ynew
Skip first 100 iterations
Plot x, y
loop OrbitIteration Times
loop until orbit = MaxOrbit
Hopalong Fractal
The Hopalong fractal by Barry Martin is also described in the
documentation to FRACTINT and is produced by the following pseudo-code:
Pick a [e.g. -3 to 3]
B = SIN(a)
c = COS(a)
x0 = 0
y0 = 0
x = x0
y = y0
do
skip first 100 iterations
Plot x, y
IF x >= 0 THEN sign = 1
ELSE sign = -1
xx = y - sign * (ABS(B * x - c) ^ .5)
yy = a - x
x = xx
y = yy
loop
The Seahorse Fractal
The Seahorse or Hippocampus fractal is my own creation (I probably derived
it by playing with someone else's formula) and is very unstable but
beautiful when it stays on screen. It is produced by the following
pseudo-code:
FNg (x) = SIN(x + SIN(3 * x))
Pick aa [e.g. 0.9]
Pick bb [e.g. 0.8]
Pick cc [e.g. 0.7]
Pick dd [e.g. 0.6]
Pick ee [e.g. 0.05]
Pick Lambda0 [e.g. 0.2 - 1.2]
ee = RND * .2
FOR ii = -1 TO 1 STEP .5
FOR jj = -1 TO 1 STEP .1
xx = ii
xxadj = xx - 2
yy = jj
yyadj = yy - 2
lambda = Lambda0
FOR i = 1 TO 30 STEP .5
yyadj = yy - 2
xxadj = xx - 2
Plot xxadj, yyadj
xold = xx
yold = yy
xx = ee * i + (aa * xold - lambda * FNg(cc * yold))
yy = ee * i + (bb * yold - lambda * FNg(dd * xold))
NEXT
NEXT
NEXT
Chebychev Functions
The Chebychev Function is described by Pickover in his book Computers,
Pattern, Chaos and Beauty (p. 285). The Chebychev functions are defined as
follows:
Cheby1 (x) = x
Cheby2 (x) = 2 * x * x - 1
Cheby3 (x) = 4 * x * x * x - 3 * x
Cheby4 (x) = 2 * x * Cheby3(x) - Cheby2(x)
Cheby5 (x) = 2 * x * Cheby4(x) - Cheby3(x)
Cheby6 (x) = 2 * x * Cheby5(x) - Cheby4(x)
Cheby7 (x) = 2 * x * Cheby6(x) - Cheby5(x)
Cheby8 (x) = 2 * x * Cheby7(x) - Cheby6(x)
Cheby9 (x) = 2 * x * Cheby8(x) - Cheby7(x)
Cheby10 (x) = 2 * x * Cheby9(x) - Cheby8(x)
Cheby11 (x) = 2 * x * Cheby10(x) - Cheby9(x)
The function is plotted as follows:
choose a function ChebyN
choose x0, y0
choose h
x = x0
y = y0
for i = 1 to max
xold = x
yold = y
x = xold - h * ChebyN(yold)
y = yold + h * ChebyN(xold)
plot (x,y)
next
The Ikeda Attractor
The Ikeda Attractor is also described by Pickover in Computers and the
Imagination (p. 115). It is plotted as follows:
choose c1
choose c2
choose c3
choose rho = 1
choose x0, y0
x = x0
y = y0
for i = 1 TO max
plot (x,y)
temp = c1 - c3 / (1 + x * x + y * y)
sintemp = SIN(temp)
costemp = COS(temp)
xt = rho + c2 * (x * costemp - y * sintemp)
y = c2 * (x * sintemp + y * costemp)
x = xt
NEXT
The Julia Fractal
The Julia Fractal is described in many sources. This particular
implementation is derived from Hans Lauwerier's Fractals: Endlessly
Repeated Geometrical Figures:
choose xc, yc
xn = .25
yn = 0
FOR N = 0 TO 30000
skip first 100 iterations
a = xn - xc
B = yn - yc
SELECT CASE a
CASE IS > 0
xn = SQR((SQR(a * a + B * B) + a) / 2)
yn = B / (2 * xn)
CASE IS < 0
yn = SQR((SQR(a * a + B * B) - a) / 2)
IF B < 0 THEN yn = -yn
xn = B / (2 * yn)
CASE ELSE
xn = SQR(ABS(B) / 2)
IF xn > 0 THEN yn = B / (2 * xn) ELSE yn = 0
END SELECT
IF N = 0 THEN xn = xn + .5
choice = RND
SELECT CASE choice
CASE IS > .5
xn = -xn
yn = -yn
CASE ELSE
END SELECT
NEXT
The Ivanov Fractal
The Ivanov Fractal was sent to me from Moscow by Oleg Ivanov who has
kindly let me incorporate the code into the WTF. Thank you Oleg! The
algorithm is as follows:
us0 = RND * 8 + 4 ' us,vs are initial coordinates of phase plate
vs0 = RND * 4 + 2
rkh = RND
rq = RND * 9 + 4.5
us = us0
vs = vs0
al = (pi / 2) * 4 / rq
sa = SIN(al)
ca = COS(al)
suu = .5 * svv * 1.6
vn = 0
FOR N = 1 TO 30000
kkk = ((N / 3000) MOD 14) + 1
skip first 100 iterations
PlotPoint us, vs
am = us + rkh * ABS(SIN(vn))
un = am * ca + vs * sa
vn = -am * sa + vs * ca
us = un
vs = vn
NEXT
The Stewart-Golubitsky Chaotic Icon
The Stewart-Golubitsky Chaotic Icon is described in the authors' book
Fearful Symmetry: Is God a Geometer? The algorithm is as follows:
x0 = .01
y0 = .003
N = INT(RND * 10)
gamma = .9 + .5 * RND
omega = RND - .5
x = x0
y = y0
iterates = 1
lambda = -1.8
alpha = 2
beta = 0
FOR nn = 1 TO 30000
skip first 100 iterations
PlotPoint x, y
zzbar = x * x + y * y
zreal = x
zimag = y
FOR i = 1 TO N - 2
za = zreal * x - zimag * y
zb = zimag * x + zreal * y
zreal = za
zimag = zb
NEXT
zn = x * zreal - y * zimag
P = lambda + alpha * zzbar + beta * zn
xnew = P * x + gamma * zreal - omega * y
ynew = P * y - gamma * zimag + omega * x
x = xnew
y = ynew
NEXT
The Duffing Attractor
The Duffing Attractor is described by Edward Rietman in Exploring the
Geometry of Nature (Windcrest Publishers: 1989). The algorithm is as
follows:
a = RND
B = RND
x0 = RND * 7 - 3.5
y0 = RND * 7 - 3.5
z0 = RND * 7 - 3.5
c = RND * 2 - 1
CONST F = 10
x = x0
y = y0
z = z0
FOR N = 0 TO 20000
skip first 100 iterations
PlotPoint x, y
FOR t = 1 TO 5
d1 = y
d2 = -(a * x * x * x + x + B * y) + F * COS(z)
d3 = c
x = x + d1 * .25 / 25
y = y + d2 * .25 / 25
z = z + d3 * .25 / 25
NEXT
NEXT
The Scales
The following scales (or in some cases, arpeggios) are used as the basis
for note mapping and may be changed on the fly by using the <LftArrow> and
<RtArrow> keys. The name of the scale which is currently in use appears in
the status box. (In order to be read properly this table needs to be
printer out with a non-proportional font such as courier.)
0 1 2 3 4 5 6 7 8 910111213141516171819202122232425262728293031
C D D E E F G G A A B B C D D E E F G G A A B B C D D E E F G G
b b b b b b b b b b b b b
Major: x x x x x x x x
Aeolean: x x x x x x x x
Dorian: x x x x x x x x
Japanese: x x x x x x x
Harmonic 1:x x x x x x x x
Minor 11: x x x x x x x x
Thirteenth:x x x x x x x x
Mideastern:x x x x x x xx
Indian: x x x x x x x x
Arabian: x x x x x x x x
Whole tone:x x x x x x x x
Diminished:x x x x x x x x
Chinese: x x x x x x x x
Fourths: x x x x x x x x
Harmonic 2:x x x x x x x x
Phrygian: x x x x x x x x
Blues: x x x x x x x x
Mixolydian:x x x x x x x x
Lydian: x x x x x x x x
Locrian: x x x x x x x x
13#11: x x x x x x x x
Active Keys for WTF30
Fractal Types:
F1: Mira
F2: KAM Torus
F3: Hopalong
F4: Seahorse
F5: Chebychev
F6: Ikeda
F7: Julia
F8: Ivanov
F9: Icon
F10: Duffing
Symmetry Operators:
1 Identity
2 C2
3 C3
4 C4
5 C5
6 C6
7 C7
8 C8
9 C9
0 C10
! (<Shift> 1) x -> -x, y -> -y
@ (<Shift> 2) x -> -x, y -> y (mirror about the y axis)
# (<Shift> 3) x -> x, y -> -y (mirror about the x axis)
$ (<Shift> 4) x -> x/k, y -> y/k
% (<Shift> 5) x -> maxx - abs(x), y -> maxy - abs(y)
x -> -maxx + abs(x), y -> -maxy + abs(y)
x -> maxx - abs(y), y -> maxy - abs(x)
x -> -maxx + abs(y), y -> -maxy + abs(x)
^ (<Shift> 6) x -> -x, y -> -y
x -> y, y -> x
x -> -y, y -> -x
& (<Shift> 7) x -> x + rand*k, y -> y + rand*k
* (<Shift> 8) x -> x*k, y -> y*k
( (<Shift> 9) x -> x/k1, y -> y/k1
x -> x*k2, y -> y*k2
) (<Shift> 0) x -> x/k1, y -> y/k1
x -> x/k2, y -> y/k2
x -> x/k3, y -> y/k3
x -> x/k4, y -> y/k4
Other Keys:
<SPACE> Begin a new fractal of the same type
<CR> Begin same fractal over again
<ESC> Quit program
Q <Q>uit program
W <W>rite MIDI event file
R <R>hythm toggle (duple/triple)
T <T>exture toggle
Y <Y> toggle
I <I>mprovise toggle
P <P>ause
S <S>taccato music
L <L>egato music
X <X> toggle
B <B>egin again after pause
N <N>ormal music
M <M>usic toggle
Key Pad Keys:
UpArrow Increase pitch offset by 1 (max = 24)
DnArrow Decrease pitch offset by 1 (min = -12)
PgUp Increase pitch offset by 12 (max = 24)
PgDn Decrease pitch offset by 12 (min = -12)
Home Tempo increase by 10 bpm (max = 250 bpm)
End Tempo decrease by 10 bpm (min = 40 bpm)
LftArrow Map to previous scale (1 < scale < 21)
RtArrow Map to next scale
<CTRL> UpArrow Increase compression factor by 1 (max = 1000)
<CTRL> DnArrow Decrease compression factor by 1 (min = 1)
<CTRL> PgUp Increase compression factor by 10
<CTRL> PgDn Decrease compression factor by 10
<CTRL> Home Increase compression factor by 100
<CTRL> End Decrease compression factor by 100
<CTRL> 5 Toggle trace mode
Release History
10/93
v 1.0 - 1.99: Not publically released. No title. Just testing the concept.
Twenty-one scale types. Improvise mode, legato, normal, staccato music;
offset by half-tone as well as by octave. Four fractal types. Music toggle.
Restart and Next functions.
11/14/93
v 2.0 - Title was given; corrected logic error in the musical algorithm
(oops!); 20 symmetry functions were added; code was tightened up and made
modular for later expansion; tempo control was added. First public release.
12/29/93
v 2.3e - The <sh>1 or ! symmetry operator was originally identical to the
unaltered fractal. This was changed to the inverse of the fractal, i.e.
(x,y) -> (-x,-y). The Chebyschev, Ikeda, Julia, and Ivanov fractals were
added as well as symmetrical icons from the book Symmetry in Chaos by Field
and Golubitsky and the Duffing Attractor. Triplet rhythm was added as well.
The version number now appears on screen. Sincere thanks is due to Oleg
Ivanov of Moscow, Russia, for contributing the code for the Ivanov fractal.
Texture toggle was added.
5/31/95
v. 3.0 - Many new features. Midi event files can be written. Chebychev
fractal was greatly improved by carefully controlling the parameter
choices. Title screen added. Control summary and status boxes on screen
were written with smaller font to include more information. Data
compression was added. X,Y musical component toggle added. <B>egin and
<P>ause functions added. Trace mode added to accompany music in
conjunction with data compression. Documentation greatly expanded.
Known bugs: The <T>exture mode does not always work well with one or two of
the fractal types such as Chebychev. I haven't been able to figure out the
reason, but it really is cosmetic and has nothing to do with the main
purpose of the program. I will work on it for the next version.
What's Next?
1. Expanded tempo range.
2. Selective X/Y offset and octave.
3. Improved user interface (menus).
4. More mapping schemes.
5. Expanded tutorial.
6. More examples of Midi files.
7. Other fractal types.
8. Other symmetry operators.
9. Full screen option for experienced users who don't need the command
summary.
10.Suggestions sent by users?
Registration Deal
The previous versions of the Well-Tempered Fractal were experimental toys
for amusement. I believe that I have shown that version 3 is a useful
creative tool and I would like to encourage users to register, mainly so
that I can know who is using the program and what they are doing with it. I
will therefore offer two options for registration:
Option 1:
$15 registration fee gets you the Postscript version of
the manual on disk and a bonus tutorial complete with
illustrations of the fractals and sample score notation. Your
name will be entered in my database and I will notify you of the
next upgrade and tell where you can get a copy by ftp.
Option 2:
Send no money, but instead send me
1. an image (.GIF, .PCX, .JPG, etc.) of a fractal screen capture
2. the corresponding raw data Midi event file produced from the
fractal
3. a finished Midi arrangement of your composition (.MID file)
4. permission to distribute what you send me as an example of
what can be done with the program.
You will be listed as the composer and copyright holder of the
work. In return you will receive the manual and bonus tutorial
and notification of where to get the next upgrade.
I welcome comments, bug reports and suggestions for future modifications.
Robert Greenhouse
robert.greenhouse@spacebbs.com
Registration Form
Name________________________________________________________________________
Address_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
E-mail______________________________________________________________________
Where did you get the WTF30?________________________________________________
Registration option (circle one):
Option 1:
Enclosed is a check for US $15. In return I will receive the
Postscript version of the manual and bonus tutorial and will be notified
where and how to get the next upgrade of WTF.
Option 2:
I enclose no money, but instead:
1. An image file (.GIF, .PCX, .JPG) of a fractal generated with WTF30
2. The Midi event file generated by WTF30 from the same fractal
3. A Midi file with a composition I have composed and arranged from the
same Midi event file
4. I give you permission to distribute the image, event file and Midi
arrangement as long as you include my name as the copyright holder of the
arrangement.
In return I will receive the Postscript version of the manual and bonus
tutorial and will be notified where and how to get the next upgrade of WTF.
Mail to:
Robert Greenhouse
3401 Hillview Ave
Palo Alto, California
94304 (USA)