ï~~rests and holds are not affected. Transpositions are
performed a random number of steps (1 to 4) in the
direction of the greater minimum distance between a
note and an upper or lower bound (1 or 14). In other
words transpositions are done in the direction that
"has the most room." If a note is transposed beyond
the allowed note range (1 - 14) it is reflected off that
bound back into the accepted range. For example, 12
transposed up 3 steps will become 13 (12-13, 13-14,
14-13).
The six mutation operators for phrases are
summarized in Table 3, which applies the operators
to our sample phrase from Figure 2. The reverse and
rotate operators are the same as those used on
measures. The genetic repair operator replaces the
index of the measure with the worst fitness (in this
case measure 38) with a random measure index (in
this case 29).
Mutation Operator J Mutated Phrase
None (Original Phrase) 57 57 11 38
Reverse 38 11 57 57
Rotate Right(e.g.,3) 57 11 38 57
Genetic Repair 57 57 11 29
Super Phrase 41 16 57 62
Lick Thinner 31 57 11 38
Orphan Phrase 17 59 43 22
Table 3. Musically Meaningful Phrase Mutations
The super phrase operator generates a completely
new phrase by selecting the indices of the winners of
four independent three-measure tournaments, where
the winners are determined by greatest fitness. This
phrase will bear no relationship to its parents, which
is mutation in the extreme. Notice, by the way, that
measure 57 apparently won a tournament to stay in
this phrase.
The last two operators tend to combat the
convergence problem, the tendency of GA machinery
to converge on slight variations of a "super"
individual. In GAs that search for a single best
individual, convergence is seldom a real problem, but
in GenJam, convergence translates to "the lick that
ate my solo." The lick thinner substitutes a random
measure for the measure in the phrase that occurs
most frequently in the phrase population as a whole.
This tends to thin out overly successful measures.
The orphan phrase operator generates a
completely new phrase by selecting the winners of
four independent three-measure tournaments where
the winners,are the least frequently occurring
measures in the phrase population. This tends to
repopulate "orphan" measures that don't appear in
any phrase and insure that diversity is maintained.
In demo mode, where only selection is applied
and feedback is ignored, phrases are selected with
another tournament selection scheme. Three phrases
are selected at random, and a combined fitness value
is used -- the sum of the phrase's fitness and the
average fitness of its constituent measures. Once a
phrase has been selected, its combined fitness is
halved so that it is less likely to be selected again in
the same solo. The result is GenJam's "greatest hits."
4 Training and Performance
After sufficient training, GenJam's playing can
be characterized as competent -with some nice
moments. About two dozen tunes have been
prepared for GenJam, either as training tunes or "gig"
tunes. The best training tunes have tempos in the
range 120 to 180 or so. Faster tunes are too hard for
the mentor to keep up with, and slower tunes need
sixteenth notes to retain interest. Of the tunes I have
prepared, the most frequently used tunes for training
are summarized in Table 4, with tempo in beats per
minute and the column labeled "C" giving the
number of choruses in the solo.
Tune, Form [TempoLC
Boplicity 32-bar AABA 130 3
Stella by Starlight 32-bar AABA 160 3
Well You Needn't 32-bar AAB A 174 3
ByeByeBlackbird 32-bar AABA 135 3
Gentle Rain 40-bar ABABC 138 3
Lady Bird 16-bar AB 150 4
Bb Blues 12-bar Blues 135 6
Table 4. Tunes Used for Training
The typical training procedure begins by running
GenJam in learning mode for three or four solos, to
sufficiently sample the populations and provide initial
fitness values. Then one can alternate breeding and
learning runs until coherent solos begin to emerge.
The training tunes are cycled in a fairly random
order, with Lady Bird and the Bb Blues being used in
learning mode only, since they contain fewer than 24
phrases. Again, the constraint is that 24 new phrases
will be generated in a breeding run, and all 24 need to
be heard so that they can have some chance of
accumulating non-zero fitnesses.
The first few generations of a training session are
quite numbing for the mentor. Fitnesses are almost
all negative, melodic intervals tend to be large, and
the frequency of "nice moments" is very low. Sooner
or later, though, a few pleasant licks begin to emerge,
and one or two solid phrases tend to appear by the
fourth or fifth generation. If a very pleasing measure
appears too early, it can become overused in a
generation or two and may require the mentor start
punishing a previously rewarded lick to thin it out.
Typically, at around the tenth generation, a "golden"
generation occurs where almost all the new phrases
sound reasonable. At this point, the mentor's
standards can shift from rewarding anything that
sounds musical to rewarding only what really sounds
nice.
A preliminary analysis of population statistics
gathered over several training runs shows that pitch,
interval, and note length distributions shift in
expected directions. The initial pitch distribution is
Genetic Algorithms
136
ICMC Proceedings 1994