BP1 in its real musical context

In a pre­vi­ous arti­cle we explained how to install and run the Bol Processor ‘BP1’ on a vir­tu­al Apple IIe. BP1 is the ear­li­est ver­sion of Bol Processor imple­ment­ed on Apple II com­put­ers in 1981, as a require­ment for Jim Kippen’s field­work in India — see At the heart of Indian rhythms and their evo­lu­tion.… We will now show its oper­a­tion in a real musi­cal con­text: the mod­el­ling of a 'theme-and-variations' piece of drum­ming (called q‘aida) taught by Ustad Afaq Husain Khan, an expert in the Lucknow style of tabla in India.

This work dates back to the 1980s and has been doc­u­ment­ed in sev­er­al pub­li­ca­tions, includ­ing Kippen and Bel's Modelling music with gram­mars: for­mal lan­guage rep­re­sen­ta­tion in the Bol Processor (1992), from which the exam­ple will be tak­en. Extract (page 207):

Pankaj Chowdhury, Jim Kippen, Afaq Husain Khan (c. 1982)

A large part of the tabla reper­toire is impro­vi­sa­tion. Any sequence of strokes can be seen as a finite string of sym­bols whose organ­i­sa­tion is relat­ed to an implic­it for­mal sys­tem. Automatic sequences (i.e. sequences gen­er­at­ed by finite-state automa­ta) have prop­er­ties that place them some­where between peri­od­ic­i­ty and chaos, but clos­er to peri­od­ic­i­ty. Since both strict and approx­i­mate peri­od­ic­i­ty are essen­tial fea­tures of music, it is real­is­tic to think that sequences of musi­cal events can be ade­quate­ly rep­re­sent­ed by automa­ta or for­mal gram­mars. In oth­er words, the most fun­da­men­tal rea­son for us to con­sid­er for­mal lan­guage mod­els as rel­e­vant mod­els of music lies in prop­er­ties that are intrin­sic to music, rather than in ana­log­i­cal links between music and nat­ur­al languages.

The theme of this q‘aida is the fol­low­ing sequence:

dhatid­hagenad­ha­trkt dhatid­hagedheena­ge­na
dhatid­hagenad­ha­trkt dhatid­hageteenake­na
tati­takenata­trkt tati­taketeenake­na
dhatid­hagenad­ha­trkt dhatid­hagedheena­ge­na
Theme of q‘aida asso­ci­at­ed with gram­mar Q2.7

Strokes on the drum — bols like 'dha', 'ti', 'ge', 'na'… — belong to the (ter­mi­nal) alpha­bet of the for­mal gram­mar. This sequence should be read lin­ear­ly from left to right. Each group rep­re­sents a beat of 4 units ('trkt' is a com­pound stroke of 2 units). Thus, the theme and its vari­a­tions are framed on a 16-beat rhyth­mic mod­el called tin­tal in North-Indian music.

The gram­mar and exam­ples of this qa‘ida are stored as "Q2.7" on disc "BP-JULY87.DSK" which can be loaded after start­ing the Bol Processor (BP-PRG.DSK). We rec­om­mend that you set the vir­tu­al Apple II to max­i­mum speed to save time when read­ing (vir­tu­al) discs! After load­ing the Q2.7's gram­mar and data, the theme can be dis­played as data item #2:

Keyboard map­ping for this q'aida

Note that the ter­mi­nal alpha­bet used on BP1 is not exact­ly the same as in the pub­li­ca­tion. For exam­ple, 'dhee' has been replaced by 'dhi', 'tee' by 'ti', sub­stan­tial changes for read­ers who pre­fer a translit­er­a­tion of Hindustani phonemes to the ren­der­ing of syl­la­bles in English.

In addi­tion, syl­la­ble 'ti' can be ren­dered as 'tit'. These sub­tleties are gov­erned by the key­board map­ping, which can be viewed (and mod­i­fied) by select­ing "Alphabet" then "Modify" from the main menu.

The gram­mar imple­ment­ed in BP1 is the same as that shown in Appendix 2 of the pub­li­ca­tion, except for spelling vari­ants of some bols and dif­fer­ent glyphs used to mark pat­terns - "mas­ter" and "slave" mark­ers, see our Pattern gram­mars arti­cle — and the bol den­si­ty instruc­tion, as explained in a pre­vi­ous arti­cle. For exam­ple, the rule

GRAM#2 [20] <100>  S32  <—>  * (= /6+ A16  V8 + /4) + O16

was dis­played as:

The bol den­si­ty mark­er "6" is now writ­ten as "/6" and "4" as "/4". The plus sign '+' is used as a con­text marker.

In lat­er ver­sions of the Bol Processor, we cre­at­ed a "_tempo()" tool which is more flex­i­ble than bol den­si­ty. For exam­ple, "_tempo(8)" would have the same effect as "/8" in a sim­ple sequence. However, in poly­phon­ic struc­tures, "/8" is an absolute val­ue where­as "_tempo(8)" is rel­a­tive to the cur­rent tem­po. This makes it pos­si­ble to cal­i­brate the dura­tions of sev­er­al sequences con­tained in a poly­met­ric expres­sion — see Two Algorithms for the Instantiation of Musical Structures (1994) for details. Furthermore, expres­sions such as "_tempo(7/4)" and even "_tempo(0.476)" are permitted…

Templates

Subrammar #7 con­tains the tem­plates of this grammar:

[1]   TEM
[2]   (=+.….….….…+.….….….…+ * (=+.….….….…+) +.….….….…;)
[3]   (=+.….….….…+.….….….…+ * (=+.….….….…+) +/8+.….….….….….….….…;/4;)
[4]   (=+.….….….…+.….….….…+ * (=/6+.….….…/4.….…+) +.….….….…;)
etc.

These tem­plates are the com­plete list of pat­terns pro­duced by (pre­sum­ably) all vari­a­tions of the q‘aida. They con­tain paren­the­ses sur­round­ing ref­er­ence strings with the "=" mark­er (dis­played as "◆" in BP1), bol den­si­ty num­bers, and arbi­trary "+" and ";" sym­bols used as con­text in the rule, as explained in the pub­li­ca­tion. Technically, pat­terns are sim­i­lar to reg­u­lar expres­sions against which a vari­a­tion is checked before being parsed by the grammar.

Any gram­mar that con­tains pat­terns and/or bol den­si­ty fig­ures must be sup­ple­ment­ed with tem­plates in order to assess the gram­mat­i­cal­i­ty of vari­a­tions. Fortunately, these tem­plates are auto­mat­i­cal­ly gen­er­at­ed by the grammar!

Producing items

To cre­ate vari­a­tions based on this gram­mar, select "Grammars" from the main menu, then go to sub­gram­mar #1, "Edit", and move to rule #2, for example:

<100>  S  <—>  (=+ S64 ;)

This will pro­duce vari­a­tions of 64 bols as sug­gest­ed by the name of the vari­able "S64". Rule #3 would pro­duce vari­a­tions of 128 bols as sug­gest­ed by "D128".

Type ctrl-C ([C]ompute). You will be asked to spec­i­fy the first sub­gram­mar (1) and the last sub­gram­mar (6). For exam­ple, if you are start­ing to com­pute from a rule of sub­gram­mar #3, it makes sense to spec­i­fy #3 as the first sub­gram­mar. If a sub­gram­mar low­er than 6 is spec­i­fied as the last, some vari­ables may not be rewrit­ten as strings of ter­mi­nal sym­bols. This can be use­ful for check­ing sub-processes in the pro­duc­tion of variations.

The options offered are A)nalyse, S)ynthesize, D)estroy struc­ture and Q)uit. Select "Synthesize". Say 'no' to "Create tem­plates" and "Systematic tree-search". You may answer 'yes' to "Step by step?" to see all the deriva­tion steps, so you can famil­iarise your­self with the gram­mar. Example of a result:

Example of pro­duc­ing a vari­a­tion based on gram­mar Q2.7

This is an inter­est­ing exam­ple: in the third line, the bol den­si­ty is dou­bled (8 instead of 4).

You are now offered the option to "Append" the vari­a­tion to the data set, "Repeat" the pro­duc­tion process, "Print" (on the vir­tu­al print­er), cre­ate "More" vari­a­tions or "Verify" this vari­a­tion. It is not obvi­ous that the gram­mar will accept this vari­a­tion if it is poor­ly designed. (This is unlike­ly in this exam­ple.) The "Verify" option should quick­ly end up with "S", the start string, if the vari­a­tion is correct.

If some vari­a­tions have been added to the data set, edit­ing Data will dis­play them at the end of the set.

This process of pro­duc­ing vari­a­tions is called "modus ponens" in expert sys­tems jar­gon. Variations pro­duced in this way were read by the ana­lyst (Jim Kippen) to the expert musi­cian to check their accep­tance as legit­i­mate vari­a­tions of the q‘aida.

Analyzing variations

Now imag­ine the expert musi­cian play­ing a vari­a­tion that is typed into the data set. It is clear that fast and accu­rate typ­ing was cru­cial to this field research… Use key­board map­ping to learn to type at high speed; it is less dif­fi­cult than play­ing the drums!

When a vari­a­tion is dis­played in the data set, type ctrl-C for "[C]ompute". Answer 'yes' to "Revise pro­cess­ing?". Now the first gram­mar is #1 but the last gram­mar should be #7 so that tem­plates are tak­en into account. Select "Analyse", say 'no' to "Display prob­a­bil­i­ty?" and 'yes' or 'no' to "Step by step?".

If you are analysing step by step, use the right arrow to go for­ward or the left arrow to go back. The sub­gram­mar cur­rent­ly used for deriva­tions is shown at the bot­tom of the page, and the index of the lat­est can­di­date rule appears at the top. In this way it is pos­si­ble to visu­alise all the details of the cal­cu­la­tion for the pro­duc­tion or analy­sis of a variation.

You can check the entire data set against the gram­mar by select­ing "Verify gram­mars" from the main menu.

If the vari­a­tion match­es more than one tem­plate, each tem­plate is used to parse it. If the pars­ing is suc­cess­ful with mul­ti­ple tem­plates, the struc­ture of the piece is ambigu­ous. This is anal­o­gous to pars­ing the sen­tence "Mary said John is a liar", which requires the place­ment of either two com­mas or a semi­colon, with each "tem­plate" giv­ing an oppo­site meaning…

Weights

Currently, in the gram­mar, all rule weights are set to 100 except for rule #3 of sub­gram­mar #1. We can use the 12 vari­a­tions in the data set to infer rule weights: each of them is analysed and each rule has its weight increased by 1 unit.

Select "Weights" from the main menu, then "Emulate learn­ing" and "Reset weights to 0". From item #2 to item #13. The last gram­mar is "7" (as tem­plates are required).

The result can be print­ed. Note that all weights in sub­gram­mar #6 are set to 100 because it is an "ORD" gram­mar: no ran­dom selec­tion of the can­di­date rule.

The input of new data sets allowed "learn­ing" from more exam­ples and improv­ing the sto­chas­tic mod­el, which would pro­duce more "aes­thet­i­cal­ly accept­able" variations.

Intermediate alphabet

Accessed from the main menu. This pro­ce­dure is used to chang­ie the names of vari­ables. This pro­ce­dure has proved use­ful in cre­at­ing gram­mars that make sense to humans, not just machines…

Creating templates

To check this, it is rec­om­mend­ed to quit and reload the cur­rent project, as some pro­ce­dures may have been saved in mem­o­ry. Load only the gram­mar, no data, to keep enough free memory.

Select "Grammars" from the main menu, then go to sub­gram­mar #7 (the cur­rent tem­plates) and delete it by select­ing "Remove from series". (This may not be nec­es­sary as the machine nev­er dupli­cates a tem­plate, but it makes things clearer.)

Then cre­ate a new sub­gram­mar #7, select "Compute" and "Create tem­plates". You will be asked for the "last gram­mar defin­ing struc­tures". This choice is very impor­tant for the speed of the com­pu­ta­tion, because the pro­duc­tion of tem­plates implies the pro­duc­tion of "all vari­a­tions". If your answer is "6", the machine can work extreme­ly long. Looking at the gram­mar, we can see that sub­gram­mar 3 is the last to con­tain struc­tur­al mark­ers. So the cor­rect answer is "3".

This process takes a long time, even at the high­est speed. Its progress is indi­cat­ed by '+' signs print­ed on the line below 'WAIT'. Since this gram­mar pro­duces 21 tem­plates, you have to wait for 21 '+' signs. Fortunately, in most gram­mars, the gen­er­a­tion of tem­plates is done once and for all…

Conclusion

This demo is an attempt to illus­trate the use of the Bol Processor BP1 in the ear­ly 1980s as an expert sys­tem for mod­el­ling compositional/improvisational process­es in the q‘aida genre of tabla drum­ming. Of great impor­tance was the devel­op­ment of an edi­tor that facil­i­tat­ed the rapid and accu­rate writ­ing of bols (rep­re­sen­ta­tions of drum strokes) and the cre­ation of pat­tern rules that took into account the implic­it syn­tac­tic struc­tures of these musi­cal pieces.

Later, the Bol proces­sor was imple­ment­ed on Macintosh com­put­ers. Versions of 'BP2' com­pat­i­ble with sys­tem ver­sions up to MacOS 10.14 (Mojave) can be dowloaded from SourceForge.

BP2 repro­duces all the pro­ce­dures of BP1, in par­tic­u­lar those described in Kippen & Bel's paper Modelling music with gram­mars: for­mal lan­guage rep­re­sen­ta­tion in the Bol Processor (1992). However, its edi­tor is not as sophis­ti­cat­ed in terms of pat­tern edit­ing. Also, the "smart key­board" option allows ter­mi­nal sym­bols to be mapped to indi­vid­ual keys, but the cur­sor does not "jump" over ter­mi­nal sym­bols, vari­ables and reserved words.

BP2 intro­duced the pos­si­bil­i­ty of polyphonic/polyrhythmic rep­re­sen­ta­tion. Polymetric struc­tures are an unsur­passed mod­el for rep­re­sent­ing musi­cal time and, by exten­sion, the struc­ture of "time objects": music, speech, noise, video, robot move­ments, etc. This mod­el is able to deal with incom­plete def­i­n­i­tions and per­forms all ter­mi­nal time cal­cu­la­tions accu­rate­ly, using inte­ger ratios. The results are sim­pli­fied to avoid inte­ger over­flow and to match the quan­ti­za­tion required for real performance.

Current work

A new ver­sion of Bol Processor com­pat­i­ble with 64-bit proces­sors on var­i­ous sys­tems (MacOS, Windows, Linux…) is cur­rent­ly under devel­op­ment. It works with a PHP/JavaScript inter­face. We invite soft­ware design­ers to join the team and con­tribute to the devel­op­ment of the core appli­ca­tion and its client appli­ca­tions. Please join the BP open dis­cus­sion forum and/or the BP devel­op­ers list to stay in touch with the progress of the work progress and to dis­cuss relat­ed the­o­ret­i­cal issues.

References


Contributors to this arti­cle: Bernard Bel

Installing and running BP1

‘BP1’ is the ear­li­est ver­sion of Bol Processor imple­ment­ed in 1981 on Apple II com­put­ers… This devel­op­ment was asso­ci­at­ed with Jim Kippen’s field­work in India — read At the heart of Indian rhythms and their evo­lu­tion.

The name ‘Bol proces­sor’ is anal­o­gous to ‘word proces­sor.’ Its devel­op­ment was prompt­ed by the need to type rapid­ly and accu­rate­ly tran­scrip­tions of North Indian tabla drum's sets of vari­a­tions, typ­i­cal­ly expressed in semi-onomatopoeic syl­la­bles: bols. The solu­tion lay in the cus­tomiza­tion of the computer’s key­board, assign­ing a sin­gle key to every bol.

Bols are ono­matopoe­ic rep­re­sen­ta­tions of strokes on the drum, or the ges­tures and move­ments of Kathak dancers. For instance, ‘dha’ would be assigned to the ‘Q’ key instead of typ­ing ‘d’, ‘h’, ‘a’. With this device, it became pos­si­ble to type vari­a­tions of tabla com­po­si­tions near the speed they were played or recit­ed. This also elim­i­nat­ed the mis­spelling of sym­bols and ren­dered a for­mal analy­sis fea­si­ble. The next stage of devel­op­ment was trig­gered by the need for a “search and replace” fea­ture in the Bol Processor. We soon dis­cov­ered that mod­el­ling the theme-and-variations con­struc­tion involved more than replac­ing vari­ables with chunks of bols. This con­struc­tion (qai­da in Urdu) was based on implic­it rules that could be ren­dered explic­it using for­mal gram­mars. Thus, Bol Processor became an expert sys­tem able to mod­el the pro­duc­tion (modus ponens) of strings of sym­bols as well as the analy­sis (modus tol­lens) of vari­a­tions cre­at­ed by musi­cians to assess their com­pli­ance with the for­mal gram­mar. Furthermore, the repet­i­tive nature of musi­cal struc­tures led to the imple­men­ta­tion of pat­tern gram­mars. This approach has been described in Kippen and Bel’s Modelling music with gram­mars: for­mal lan­guage rep­re­sen­ta­tion in the Bol Processor (1992).

It appeared that key­board map­ping was not pos­si­ble in 1981 using the then Apple Writer II word proces­sor. Moreover, in a way it was very for­tu­nate because it prompt­ed us to design a tool which for 40 years has gone way beyond the objec­tive of a cus­tomized key­board. We planned to cre­ate a bicy­cle but in the end it turned out to be a spaceship!

Recently we dis­cov­ered with delight that BP1’s pro­gram, source code, com­pil­er and data flop­py disks used for this project had been safe­ly stored. After more than 37 years these diskettes were eas­i­ly copied and trans­ferred to a hard disk in the DSK for­mat with the kind sup­port of Philippe M., a col­lec­tor of old com­put­ers and soft­ware in Marseille. This means that BP1 can be run on any Apple II emu­la­tor run­ning on MacOS, Linux, and Windows machines.

The source code could even be recom­piled to run under bet­ter con­di­tions, notably exploit­ing mem­o­ry space beyond the orig­i­nal 64 kilo­bytes – indeed, kilo­bytes! Currently, even set­ting the RAM of the vir­tu­al machine at 1Mb does not increase the mem­o­ry space for BP1.

This first arti­cle is about installing an emu­la­tor and edit­ing grammars/data in BP1. The next one explains the full usage of this pro­gram in its orig­i­nal musi­cal context.

For those unfa­mil­iar with the project, Bol Processor (BP2) also exists as a Mac appli­ca­tion for sys­tem ver­sions up to MacOS 10.14 (Mojave) — read the home page of this site. We are cur­rent­ly devel­op­ing a new ver­sion com­pli­ant with MacOS, Linux, and Windows with both 32-bit and 64-bit Intel processors.

Choosing an emulator

So far we have run BP1 on the fol­low­ing emulators:

Given that all these emu­la­tors proved sat­is­fac­to­ry, we assume that any emu­la­tor cre­at­ing an Apple IIe or Apple IIc vir­tu­al machine will do the job. You may there­fore install as well:

The set­up of any Apple II emu­la­tor is rough­ly the same pro­ce­dure. In this arti­cle we describe it for VIRTUALII with a "lim­it­ed license" (cost­ing less than 20 USD). Other emu­la­tors list­ed above are free of charge.

Installing a ROM

In Apple II com­put­ers, the core sys­tem was stored in a sol­id device (Read-Only Memory) which made it almost impos­si­ble to clone these machines. On the vir­tu­al Apple II cre­at­ed by an emu­la­tor, the ROM is a piece of soft­ware which (for com­mer­cial rea­sons) can­not be sup­plied along with the emu­la­tor. You need to down­load it from an autho­rized site. The good news is that this is free of charge.

We down­loaded ROMS from this site:

https://mirrors.apple2.org.za/ftp.apple.asimov.net/emulators/rom_images/

Download and unzip "apple2_roms.zip". In the "apple2_roms" fold­er, "apple_iie_rom.zip" and "apple_iic_rom.zip" need to be unzipped to pro­duce APPLE2E.ROM and APPLE2C.ROM. Both are suit­able to BP1. No need to cre­ate an old­er Apple II because you would miss 80-column dis­play and upper/lower cases!

Starting VIRTUALII on MacOS makes it clear that a ROM file is missing:

The ROM file(s) you down­loaded shall be placed in a spe­cif­ic fold­er. Select "Show ROM fold­er" in the "File" menu to open it, then drag APPLE2E.ROM into this fold­er and restart the emu­la­tor. Include APPLE2C.ROM if you plan to emu­late an Apple IIc.

You may need to select "Create a New Machine" in the "File" menu until you get the true Apple IIe start­up screen:

Starting an Apple IIe on VIRTUALII
CATAKIG's blank screen

The same pro­ce­dure applies to CATAKIG emu­la­tor on MacOS. An amus­ing (or irri­tat­ing) fea­ture, how­ev­er, is the dis­play of a blank TV screen with white noise. Those born in the age of cathod­ic tele­vi­sion will guess that this indi­cates the com­put­er has not yet been switched on… No hope find­ing the switch. 😣 Young geeks will dive into the doc­u­men­ta­tion to find out that it is switched on by hit­ting the space bar! 😀

Again you will be told that a ROM file is miss­ing. The "ROMs" fold­er lies near the appli­ca­tion "Catakig.app". Drag APPLE2E.ROM and restart CATAKIG. You still need to hit the space bar and select "New Apple II" in the "File" menu, Choose "Apple IIe"… and once again hit the space bar!

At last, the old good Apple IIe start­up screen is displayed:

CATAKIG's Apple IIe start­up screen. I pre­fer the ver­sion of VIRTUALII repro­duc­ing the green col­or of mon­i­tors in the 1980s. 😉

Setup pro­ce­dures are prob­a­bly iden­ti­cal when run­ning emu­la­tors on Windows and Linux machines.

All we need now is to "insert a disk"! This is done by select­ing "Insert Diskette Image" in the "Media" menu of VIRTUALII, or "Load Disk Drive 1" in the "Peripherials" menu of CATAKIG .

Available floppy disk images

All BP1 flop­py disks can be down­loaded from this folder:

https://bolprocessor.org/misc/BP1/

  • BP-PRG.DSK is BP1's pro­gram disk that needs to be insert­ed first.
  • BP-BB.DSK, BP-JULY87.DSK, BP-OCT88.DSK and BELFAST.DSK are grammar/data disks used by the program.
  • BPSOURCES.DSK con­tains the assem­bly 6502 source code which may be recom­piled using BIGMAC.DSK.

Running BP1

Insert BP-PRG.DSK. This will imme­di­ate­ly launch BP1. After "Loading DOS in high mem­o­ry" (which old goats will under­stand) you get the reward­ing message:

Press the CAPS LOCK key because most com­mands require upper­case hits.

You are told to "wait"… It real­ly takes time because the emu­la­tor is run­ning at the speed of a real Apple II. On VIRTUALII you even hear sounds of flop­py disks! Fortunately, all emu­la­tors offer the option of run­ning appli­ca­tions at high speed. This is most con­ve­nient for BP1 unless you are nos­tal­gic for the squeaks of diskette drives!

Once the disk has stopped spin­ning you will see:

BP1 ran on a sin­gle disk dri­ve — the in-built dri­ve of the Apple IIc we used in field research. This means that the entire pro­gram stays in mem­o­ry. So, you can remove the start­up disk and insert a data disk. On VIRTUALII you first need to select "Eject Disk" in the "Media" menu to make the first dri­ve avail­able. Once this is done, select "Insert Diskette Image" in the "Media" menu and take for instance "BELFAST.DSK". Then hit <return>… BP1's main menu is displayed:

All com­mands are acti­vat­ed with upper­case keys. The "Slot num­ber" option should remain "1" since we are using a unique disk drive.

We will now vis­it basic edit­ing com­mands in BP1. A detailed expla­na­tion of its oper­a­tion as an "expert sys­tem" will be post­ed shortly.

Since a grammar/data disk has been loaded you can hit the "L" key, yield­ing again Load/Save/Quit options, then dis­play­ing the con­tent of the BELFAST disk:

Content of 'BELFAST.DSK'

Hit up/down arrows then <return> to select, for instance, "Q.2.4" (gram­mars). Unless you opt­ed for high speed, it will take some time to read the files… You will be offered the option of load­ing data. Say "No".

Now the menu is more detailed:

Menu for gram­mar Q.2.4 of 'BELFAST.DSK'

At this stage we will only check how to edit a gram­mar. Hit the "G" key, then the "down" arrow until "SUBGRAMMAR #3" appears at the top of the menu:

Menu for edit­ing sub-grammar #3 of gram­mar Q.2.4

Technical detail: until now we have been run­ning a frame­work of BP1 writ­ten in AppleSoft BASIC lan­guage. We will next enter pure 6502 code after hit­ting the "E" key:

Entering BP1's edi­tor (in pure 6502 code)

The edi­tor dis­plays one rule at a time. At the top we find the "RND" instruc­tion telling the infer­ence engine that the fol­low­ing rules should be picked up ran­dom­ly. Hit the "down" arrow to reach rule #14:

Commands [B]eginning, [E]nd etc. are accessed via the "con­trol" key — left­most down a Mac key­board. When using VIRTUALII, all "Print" com­mands pro­duce a PDF file that can be dis­played and export­ed: click the ImageWriter print­er on the right side of the screen.

Left and right arrows move the cur­sor to insert or delete sym­bols. Note that the cur­sor jumps over reserved words and ter­mi­nal sym­bols such as "dha", "tira", "kita" etc., which was the ini­tial rai­son d'être of a Bol Processor:

Cursor move­ment in BP1's editor

In this exam­ple, "A3" is a vari­able. Variables appear in invert­ed con­trast and are gen­er­al­ly dis­played in upper­case (though this is not com­pul­so­ry) where­as ter­mi­nal sym­bols are dis­played in low­er­case with nor­mal con­trast. To type a vari­able, first hit the <quote> key, then type its name and hit <return> or <quote> once again. There was more flex­i­bil­i­ty in nam­ing vari­ables in BP1 than in BP2 because they were tok­enized… For instance:

Since BP1 was first devel­oped on the Apple II (not Apple IIe), it expects only upper­case key­board input for com­mands. The "caps lock" key will def­i­nite­ly be help­ful to this respect.

Note that typ­ing "Q" in the edi­tor inserts "dha", "Z" inserts "ghi" etc. To see (and mod­i­fy) the key­board map­ping, first quit the gram­mar edi­tor (typ­ing ctrl-Q) then "Q" again to return to the main menu. Select "Alphabet", then "Modify":

Keyboard map­ping in BP1

At the bot­tom of the screen, the "Which key?" mes­sage prompts you to select a key and change its map­ping. Unmapped keys are assigned a peri­od which is a blank sym­bol in BP1 syn­tax. Hitting <return> or the space bar quits the key­board map­ping edi­tor. Mappings can be saved. This makes it pos­si­ble for instance to assign "dha" to "Q" on an English key­board and to "A" on a French key­board. Keyword map­ping has no effect on gram­mars and data. It is only used to facil­i­tate typing.

Now you can try to load "Q.3.2 (data+grammars)" and reply "Y" to "Load data?". Back to the main menu, select "Data", then "Edit/compute". Move down to data #3:

If you are using VIRTUALII, for fun you can check "Speak Text Screen" in the "View" menu. The whole piece will be recit­ed in English pro­nun­ci­a­tion which has lit­tle in com­mon with its ren­der­ing by tabla players!

More seri­ous­ly, note that ter­mi­nal sym­bols are chun­ked and spaced by groups of 6 units reflect­ing the "speed" of this musi­cal piece. How is this set up? The trick is revealed after hit­ting the right arrow:

Now the rhyth­mic and syn­tac­tic struc­ture of this item are explicit:

  • "6" in the begin­ning means that chunks of 6 ter­mi­nal sym­bols should be dis­played. This was called bol den­si­ty.
  • "/4/4/4/4" indi­cates that 4 chunks should be placed on every line, there­by match­ing the rhyth­mic pat­tern called tin­tal in India music.
  • These rhyth­mic con­ven­tions have been revised in BP2. Today we should write "4+4+4+4/6" instead of "6/4/4/4/4". This is the con­ven­tion fol­lowed in our paper.
Printed exam­ple: pat­tern rule
  • Brackets, dia­mond signs (◆) and return (↵) signs denote the syn­tac­tic struc­ture of the piece. A dia­mond sign is the mark­er of a "mas­ter" string and a return sign a mark­er of its "slave" copy. Their asso­ci­a­tion is called a pat­tern. In print­ed ver­sions of gram­mars and in Mac ver­sions of Bol Processor, these signs have been replaced with "=" and ":" respectively.
  • The aster­isk sign (*) tells that the con­tent of the fol­low­ing brack­et is a homo­mor­phic tran­scrip­tion of its mas­ter. For instance, the voiced "dhin--dhagena" is repro­duced as the unvoiced "tin--takena". Tabla drum­mers name this trans­for­ma­tion khuli/band which means "open" and "closed", refer­ring to the res­o­nance that makes a phoneme "voiced". In BP2, sev­er­al homo­mor­phisms can be defined on the same alphabet.
  • Moving the cur­sor over the struc­tured piece high­lights the ref­er­ence ("mas­ter") string rul­ing every "slave" copy as shown on the pic­ture below. Changing a "slave" string is impos­si­ble as it would break the pat­tern. There is actu­al­ly no space in mem­o­ry for "tin--takena ta--…":
When the cur­sor reach­es the mark­er of a "slave" string, its "mas­ter" ref­er­ence is highlighted…

Editing patterns

As shown in the pre­ced­ing image, strings delim­it­ed by brack­ets can be copied or "mir­rored" auto­mat­i­cal­ly using "mas­ter" and "slave" mark­ers. A string start­ing with a dia­mond sign (◆) is a "ref­er­ence". This sign is pro­duced by default when typ­ing an open­ing brack­et. To cre­ate a mir­ror of this expres­sion, open a brack­et and hit the "<" and ">" keys until the desired ref­er­ence is highlighted.

The ref­er­ence can be any­where on the left of the "slave", and it may in turn be a pat­tern con­tain­ing oth­er ref­er­ences. In the fol­low­ing exam­ple, choice is giv­en to copy­ing "dha--", "dha­ge­na", "dhin--" as well as "dha­ge­na dha--":

If the mir­ror is a homo­mor­phic tran­scrip­tion of its ref­er­ence, type "*" before the open­ing bracket.

Once a pat­tern has been defined, any mod­i­fi­ca­tion of a ref­er­ence expres­sion ("mas­ter") is imme­di­ate­ly mir­rored in its copies ("slave").

Patterns are defined in sub­gram­mars gen­er­al­ly at a high lev­el of the struc­ture. For this rea­son, Bol Processor gram­mars are a class of pat­tern gram­mars.

Pattern edit­ing was a great achieve­ment of BP1's inter­face. Entirely designed in 6502 machine lan­guage, its imple­men­ta­tion took more than 3 months full-time, asso­ci­at­ed with instant mem­o­ry defrag­men­ta­tion… Memory was a crit­i­cal lim­i­ta­tion: type ctrl-F in the edi­tor to check the few "bytes left"!

Keyboard shortcuts

Keyboard short­cuts depend on the com­put­er set­tings. The fol­low­ing have been checked on a Mac French (AZERTY) keyboard:

  • ORD is entered as alt+/ or "ORD"
  • RND is entered as ¨RND"
  • LIN is entered as alt+j or "LIN"
  • <-> is entered as alt+,
  • <-- is entered as alt+c
  • --> is entered as alt+b
  • S is entered as alt+i or "S"
  • TEM is entered as alt+h or "TEM"

More fun?

Explaining the intri­ca­cies of rhyth­mic and syn­tac­tic pat­terns of tabla com­po­si­tions is beyond the scope of this arti­cle. Read for instance Kippen and Bel's paper for a detailed pre­sen­ta­tion of Bol Processor refer­ring to the musi­cal con­text of drum play­ers. We hope that this intro­duc­tion will be suf­fi­cient for mas­ter­ing the edit­ing pro­ce­dures of BP1.

DOS 3.3 com­mands are doc­u­ment­ed on this page. After quit­ting BP1 you may for instance restart it with the com­mand "RUN BOL PROCESSOR", or type "CATALOG" to list the con­tent of the disk.

Type "LOAD BOL PROCESSOR" then "LIST" to dis­play the BASIC frame­work of BP1. For instance:

Part of the AppleSoft BASIC code of BP1's frame­work, after typ­ing LIST 100-1000.

Contributors to this arti­cle: Bernard Bel

Bol Processor BP1

Installing and running BP1
Installing an emu­la­tor of the Apple II and run­ning ‘BP1’, the ini­tial ver­sion of Bol Processor …
BP1 in its real musical context
We are show­ing the oper­a­tion of BP1 in its real musi­cal con­text: the mod­el­ling of a 'theme-and-variations' piece of drum­ming (tabla) …
At the heart of Indian rhythms and their evolution
An inter­view with James Kippen by Antoine Bourgeau …
Au cœur des rythmes indiens
Entretien avec James Kippen, par Antoine Bourgeau …