The "INIT" instruction

In case you wish to play "-gr.koto3" on a Roland D-50 or D-550 synthesizer, you might insert the following line top of the grammar:

INIT: Play _script(MIDI set basic channel to 15) Koto _script(MIDI Omni mode ON channel 15)

What does it mean? 'INIT:' indicates something that is done during the initialisation, that is, every time the grammar is requested to improvise. Here, the initialisation is a script instruction "Play «any item»" in which the item contains two performance controls "_script()" and a variable "Koto" (starting with an uppercase character).

Instruction "MIDI set basic channel to 15" tells BP2 that MIDI program changes should be sent on channel 15. These program changes are performed by the glossary when rewriting variable "Koto". The effect depends on the glossary which contains the proper program number setting a patch named "Koto". Then, "MIDI Omni mode ON..." will set the synthesiser to OMNI OFF, so that messages may be received and played even if they are not sent on channel 15.

Initialisation is performed before playing the first item produced by the grammar. If it contains a "Play" instruction, BP2 first produces the item, performs the initialisation, and then immediately plays the item. Otherwise it performs the initialisation before producing the item.

An example will make it clear. If the initialisation is

INIT: Wait for space

then BP2 will prompt you for hitting the space bar just after compiling the grammar, before producing an item. If it is

INIT: Play _script(Wait for space)

then it will prompt you just before playing the first item the grammar has produced. This is a good way of synchronising the beginning of an improvisation. You may even want to be notified by a beep:

INIT: Play _script(Beep) _script(Wait for space)

The specificity of the "INIT" instruction should be made clear. You could as well insert the preceding instructions as performance controls into the item produced. For instance, the first rule in the "-gr.koto3" grammar could be:

S --> _script(Beep) _script(Wait for space) _vel(127) _volume(40) X X X X Y X X X X Y X X X X

However, in this case, the beep and wait would be performed each time a new item is produced, which is not convenient in the "Non-stop improvize" mode.

You may also use the "INIT" instruction to execute any script stored on the disk, e.g.:

INIT: Run script "MyInitScript"