Live coding

Live cod­ing is a per­form­ing art form cen­tred on writ­ing code and using inter­ac­tive pro­gram­ming in an impro­vi­sa­tion­al way. From March 2025, this prac­tice is pos­si­ble on all Bol Processor imple­men­ta­tions: MacOS, Windows, Linux and the stand­alone appli­ca­tion on Mac.

Practically speak­ing, live cod­ing on the Bol Processor is pos­si­ble when impro­vis­ing con­tin­u­ous­ly in real time MIDI. The project is a gram­mar, and the fol­low­ing real-time changes are cur­rent­ly possible:

  • Edit and save the gram­mar. The updat­ed ver­sion will be imme­di­ate­ly reloaded and restarted.
  • Edit and save the set­tings. The updat­ed ver­sion will be imme­di­ate­ly reloaded and applied to the next productions.
  • Save anoth­er gram­mar in the same ses­sion. It will be loaded imme­di­ate­ly to replace the cur­rent one and pro­duc­tion will restart. The set­tings (and alpha­bet, if applic­a­ble) will be included.

How to do it

  • Set the gram­mar in Non-stop improvize mode.
  • Check the Follow grammar(s) and (option­al) Follow set­tings options at the bot­tom of the set­tings form. The Track changes option will keep a record of gram­mar and set­tings changes.
  • Do the same for all gram­mars used in the improvisation.
  • Click PRODUCE ITEM(s) on the first grammar.
  • During the per­for­mance, click­ing SAVE on any of the gram­mars will save its changes, load it and run it in place of the cur­rent one. Its set­tings and alpha­bet will also be auto­mat­i­cal­ly included.

All the fea­tures of a real-time MIDI per­for­mance remain avail­able: micro­ton­al adjust­ments, parts, MIDI input cap­ture, wait instruc­tions, etc.

Example

The fol­low­ing is a triv­ial exam­ple with no musi­cal rel­e­vance. It is intend­ed to test the Bol Processor's tech­ni­cal abil­i­ty to quick­ly han­dle changes in a con­ver­sa­tion­al setup.

Two gram­mars, name­ly "-gr.livecode1" and "-gr.livecode2", con­tain a sin­gle infer­ence from S to a poly­met­ric expression:

-se.livecode1
S --> {_vel(64) _chan(1){4,{D6 A4 A4{1/2,G5 Bb5}{1/2,D6 C6 Bb5}, 1{Cb4,Eb4,F4,Ab4}{Bb3,D4,Gb4}-}},_vel(64) _chan(2){4,{D4 F3 E3{1/2,G3 Bb3}{1/2,D4 C4 Bb3}, 1{Db2,Ab2}{C2,G2}-}}}

-se.livecode2
S --> {_tempo(41/30) _vel(64) _chan(3){1319/240,{re4{17/120,fa1 fa2}17/1920{119/1920,la2}{17/80,do3 re3 fa3}103/40, 57/40{17/240,la3}601/240, 359/240 4, 359/240{17/120,do4 re4}17/1920{119/1920,fa4}{17/80,la4 do5 re5}499/240, 461/240{17/240,fa5}reb5{1,la3 sol#3}1/120, 479/120 1/120,{re3,sol3,la3}--{1,- fa3}}},_vel(64) _chan(4){4,{la2 -{1,- la0}reb3,{sib1,fa2}2{sol2,la2}}}}

In "-se.livecode1" and "-se.livecode2", the Non-stop improvize and Follow grammar(s) options have been checked.

First run "-gr.livecode1" which is a plain rep­e­ti­tion of a musi­cal motif bor­rowed from Oscar Peterson. Click SAVE to check that it restarts the per­for­mance. Then mod­i­fy the gram­mar, adding or delet­ing notes, and click SAVE to check that the mod­i­fied ver­sion will be played immediately.

If the Follow set­tings option is checked, you will notice that chang­ing a set­ting, such as tem­po, and click­ing SAVE to “-se.livecode1” will be reflect­ed in the per­for­mance. However, the effect is not imme­di­ate, as the machine must first play the items stored in the out­put buffer. We're work­ing on a way to make changes imme­di­ate while main­tain­ing the con­ti­nu­ity of the performance.

Listen to a pos­si­ble result (!):

Grammars "-gr.livecode1" and "-gr.livecode2" in a 'con­ver­sa­tion­al" mode

It is worth not­ing that the two gram­mars use dif­fer­ent note con­ven­tions, name­ly English in "-gr.livecode1" and Italian/French in "-gr.livecode2".

A more complex example

Let us now mix two com­plex gram­mars: "-gr.Mozart" and "-gr.trial.mohanam", which are in the "ctests" fold­er. Check the Non-stop improvize and Follow grammar(s) options in their set­tings and start impro­vis­ing on one of them. Then click SAVE to change the gram­mar or reload the cur­rent one.

In fact, you can use more than two gram­mars for this exer­cise. You can also include a gram­mar that is not in the Non-stop improvize mode, so it will end the performance.

The "-gr.Mozart" gram­mar uses the French note con­ven­tion where­as the "-gr.trial.mohanam" gram­mar uses the Indian con­ven­tion. The lat­ter also uses an alpha­bet file "-al.trial.mohanam". The merge is tech­ni­cal­ly sat­is­fac­to­ry as you can hear:

Work in progress

We're work­ing on three lim­i­ta­tions that seem evi­dent in the con­text of live coding:

  1. React imme­di­ate­ly to changes in the settings.
  2. Create an option to react to changes (or updates) of a gram­mar only at the moment when an entire ele­ment has been sent to MIDI.
  3. When load­ing a gram­mar, if the gram­mar is not valid, the impro­vi­sa­tion should con­tin­ue with the pre­vi­ous grammar.

More sug­ges­tions are sure to come as feed­back from artists work­ing with live cod­ing. These will give way to chal­leng­ing developments!

Leave a Reply

Your email address will not be published. Required fields are marked *