68
Figurative encoding
Another way in which we can encode the real-time musical stream is to simply
use L-system symbols as placeholders for any musical data. By doing this, we assign a
symbol in our L-system alphabet to represent the current musical event (whatever it is),
and then generate a system to create an accompaniment accordingly.
For example, if we take our L-system from the previous chapter:
w: F
p1: F -> +GQ
p2: G -> FY-F
p3: Q -> -FG+
p4: Y -> +GF-
Figure 4.10: an L-system with a six-symbol alphabet, taken from chapter 3
If we bind the symbol ‘F’ to represent the current pitch, we can create an
accompaniment line where every pitch is run through the L-system equally, spawning an
independent melody off of each note. To do this, we’ll use generation 3 of this L-system
(++GQ+GF--+GQ-+GQFY-F+), and apply it to every incoming pitch. We’ll also use the
same L-system musical parser we developed towards the end of last chapter, i.e.:
F Increment the current pitch by 3 semitones then play a note.
G Decrement the current pitch by 4 semitones then play a note.
Q Increment the current pitch by 5 semitones then play a note.
Y Decrement the current pitch by 7 semitones then play a note.
+ Speed up note delta time one metric value.
- Slow down note delta time one metric value.
Figure 4.11: our instruction set for the L-system in Figure 4.10
The way we approached this particular L-system (and parser) for pre-
compositional scenarios is to assign a starting pitch and duration to feed into the L-
system. To use this as a real-time engine, however, we have a decision to make. If we
want the accompaniment to start immediately (so that when the performer plays a note