
This grammar (namely “-gr.koto3″) is an improvisational model running on Bol Processor BP2 connected to a Roland D-50 synthesizer. Selecting a synthesizer was critical for a good rendering of sound imitating a Japanese koto.
The underlying model (SUB grammar) is a unidimensional cellular automaton using substitution rules: at each step of the computation, a set of randomly selected rules is applied to the work string. Conversally, in a RND grammar, a new rule would be selected each time the preceding one has been applied. For more details, read a presentation of “-gr.koto3″ on page Bol Processor ‘BP3’ and its PHP interface.
In subgrammar #2 we see a competition between constructive rules, such as gram#2[8] and gram#2[11] which increase the length of the work string, and destructive rules, such as gram#2[10] and gram#2[15] decreasing its length.
The weight of gram#2[12], initially set to 100, is diminished by 10 each time it is applied, until the rule is invalidated.
SUB gram#1[1] <100> S --> _vel(127) _volume(40) X X X X Y X X X X Y X X X X gram#1[2] <K9> X --> a [Weight is controlled by K9, see Interaction] gram#1[3] X --> b ----- SUB gram#2[1] Y --> Y gram#2[2] #? ?1 --> #? ?1 [Keep leftmost symbol] gram#2[3] ?1 #? --> ?1 #? [Keep rightmost symbol] gram#2[4] } --> } gram#2[5] , --> , gram#2[6] <5> a --> a gram#2[7] <30> a b a --> a a gram#2[8] <100> #({) a b a --> {5,a c b,f f f - f} gram#2[9] <5> b --> b gram#2[10] <30> #({) b a b #(}) --> b b gram#2[11] <100> #({) b a b --> {3,b a b c b a,f a f} gram#2[12] <100-10> #({) #a b #(}) --> #a c b gram#2[13] c c c --> c a c gram#2[14] c a c --> b a b gram#2[15] <50> ?1 ?1 ?2 ?3 ?4 ?4 --> ?2 ?3 gram#2[16] <K9> ?1 ?1 ?1 --> ?1 gram#2[17] <K9> ?1 ?1 --> ?1 ----- SUB gram#3[1] <40> Y --> <<f>> gram#3[2] <50> Y --> <<chik>> gram#3[3] <1-1> ? #? --> ? Silence _script(MIDI send Continue) #? gram#3[4] <50> Silence --> - - - - - gram#3[5] <15> Silence --> - - - - gram#3[6] <8> Silence --> - - - gram#3[7] <8> Silence --> - -
Rules are applied in subgrammar #2 until none of them can be a candidate. Then rules in subgrammar #3 are applied, producing out-time sound-objects «f» (a bass note) and «chick» (a chord).

Sound-objects “a”, “b”, “c”, “f”, “chick” are defined in a sound-object prototype file named “-mi.koto3”. A few of them have specific properties forcing a relocation to satisfy topological constraints. For instance, “a” should maintain a continuity with the preceding object (as shown on picture) which may shift it to the past.
The time-setting algorithm takes care of all constraints to create a piece that may not fit exactly the metronomic beat pattern. The following is an example of final piece created with this grammar (played 3 times):

In this grammar, parameter K9 is set to follow the position of a controller (for instance the pitchbend or a pedal on the D-50) assigning a value 0 to 100. This value is the weight of rules gram#1[2], gram#2[16] and gram#2[17]. The greater the weight, the more “a” and the less “b” in the string; in addition, the final string will get smaller because of the higher weight of destructive rules gram#2[16] and gram#2[17].
During the improvisation, the work string is played at each step of its transformation. The end of the transformation is noticeable because of the «f» and «chick» sound-objects.
The following is an example of improvisation played in real time:
The following video illustrates the grammar at work on BP2.9.8 — unfortunately with a GeneralMIDI “koto” sound:
References
- Two Algorithms for the Instantiation of Musical Structures (1994) on polymetric structures and the time-setting algorithm of sound objects
- Migrating Musical Concepts: An Overview of the Bol Processor (1998)