Quick install MacOS

   

This is a sup­ple­ment to the page Bol Processor ‘BP3’ and its PHP inter­face.

A one-click nota­rized installer of Bol Processor BP3 is avail­able. It is called "BolProcessorInstaller.pkg" and it can be down­loaded from here (unique location).

The Bol Processor on MacOS is now a stand­alone appli­ca­tion "BolProcessor.app" (based of PHP Desktop) that no longer requires an addi­tion­al instal­la­tion. The option to use this ver­sion is offered each time you run the installer. You will then be asked to select the Applications fold­er or any oth­er loca­tion on your computer.

The installer (or the script) is used for both ini­tial instal­la­tion and updates. Each time you run it, it will down­load the lat­est ver­sions of the BP3 con­sole source files, the pre­com­piled 'bp' con­sole, the inter­face PHP files and the sam­ple set con­tained in the 'ctests' fold­er. Data, gram­mars and scripts that you've cre­at­ed will not be delet­ed. However, if you have mod­i­fied files in the 'ctests' fold­er, they will be revert­ed to the cur­rent dis­tri­b­u­tion version.

Geeks may pre­fer an equiv­a­lent method using a script includ­ed in this pack­age, see below.

Install MAMP or XAMPP

👉  Using the stand­alone appli­ca­tion "BolProcessor.app" does not require MAMP or XAMPP. So you can jump direct­ly to the Csound instal­la­tion (in case you need it).

If you try to run the installer of Bol Processor, it will first check that a local Apache serv­er (either MAMP or XAMPP) has been installed. Both are suit­able since the Bol Processor inter­face con­tains exclu­sive­ly HTML, PHP and JavaScript code. No data­base is required.

As of January 2025, it appears that the free ver­sion of MAMP has a script exe­cu­tion time of 30 sec­onds that can­not be over­rid­den by the PHP scripts. If this lim­i­ta­tion is con­firmed, we will rec­om­mend the use of XAMPP (free) or MAMP PRO (for a charge).

Your Mac may refuse to run the XAMPP installer because it is from an "unknown devel­op­er". You can over­ride this by allow­ing the appli­ca­tion in the Privacy & Security sec­tion of the Mac's System Settings. Unpacking the files takes sev­er­al min­utes, so be patient and wait for it to finish!

👉 Don't try the vir­tu­al machine ver­sion of XAMPP! It won't work on Macs with M1 chips (and above). Use the native installer.

Free MAMP on MacOS. Note that the top right icon indi­cates that the Apache serv­er is running.

if you choose the (free) MAMP ver­sion, both MAMP and (com­mer­cial) MAMP PRO will be installed. The inter­face will occa­sion­al­ly prompt you to "upgrade" to MAMP PRO (see pic­ture), although you don't need it for the Bol Processor!

Note that after down­load­ing MAMP, you will find MAMP PRO in the Applications fold­er, where­as MAMP (free) is locat­ed in Applications/MAMP. Also note that this ver­sion of MAMP runs on port "8888" by default, as we will see below.

For MAMP, the "htdocs" fold­er is in Applications/MAMP. For XAMPP, it is in Applications/XAMPP/xamppfiles. The installer will find it in both cases.

👉  You will not be able to run both MAMP/MAMP PRO and XAMPP Apache servers at the same time if they use the same ports. This wouldn't be a good idea anyway…

Start Apache at boot time

If you want Apache to start auto­mat­i­cal­ly when you start your com­put­er, this process is easy with MAMP: check Login items in the sys­tem settings.

For XAMPP, things are a bit more complicated.

For geeks: You have the offer to cre­ate a start­up script but is not entire­ly sat­is­fac­to­ry with the cur­rent ver­sion (8.2.4). It allows XAMPP to restart Apache at boot time and PHP pages are dis­played cor­rect­ly. However, when real-time MIDI is used, MIDIClientCreate() returns an error.

Until this prob­lem is fixed, the eas­i­est way is to find the Application Manager manager-osx.app (in XAMPP/xamppfiles) and add it to the Login Items of the General set­tings of your MacOS system:

You can also place an alias of "manager-osx.app" on the desk­top and click on it at start­up if you intend to run the Bol Processor.

MAMP PRO

Below are instruc­tions for (rich) peo­ple run­ning MAMP PRO.

The MAMP PRO main page on MacOS (ver­sion 5.7)
  1. Launch MAMP PRO from the Applications folder.
  2. In the MAMP main win­dow, click the Apache Enable but­ton (see image). No need for MySQL.
  3. The image shows the default set­tings for PHP, which is start­ed with Apache.
  4. In case of trou­ble, check the set­tings for ports (see image) and of hosts (gen­er­al  and  Apache).

XAMPP

Open the XAMPP fold­er in the  Applications  fold­er and launch  manager-osx.app  as shown below.

The XAMPP main page will appear. If you click on the  Manage Servers  tab and select  Apache Web Server, then Configure, you can make sure that the serv­er is run­ning on port "80". This can be changed (e.g. to "81") if it cre­ates a conflict.

Then click the Start but­ton. If there is no con­flict with the ports, Apache will show up as "run­ning":

This image has an empty alt attribute; its file name is XAMPP.jpg
The XAMPP fold­er (in the Applications fold­er on a Mac) and the XAMPP main page

Once Apache is run­ning, you can click on the  Welcome  tag and the  Go to Application  but­ton. This should dis­play a (local) page about XAMPP in the path  http://localhost/dashboard. Both the  dashboard  and (lat­er)  bolprocessor  fold­ers will be locat­ed in the  Applications/XAMPP/xamppfiles/htdocs  folder.

Install the Bol Processor

After installing XAMPP or MAMP, you can run the installer "BolProcessorInstaller.pkg" (or the "install_bolprocessor.sh" script). Both are equivalent.

By default, all Bol Processor pro­gram, doc­u­men­ta­tion and data files will be cre­at­ed in a fold­er called "bolprocessor" and will be con­tained in the "htdocs" fold­er cre­at­ed by XAMPP or MAMP — in oth­er words, on your start­up disk. This is not a prob­lem as the whole set does not take up much space, typ­i­cal­ly less than 60 Mb when installed, and the Bol Processor data is basi­cal­ly pure text.

However, you may wish to install the "bolprocessor" fold­er to a dif­fer­ent loca­tion, includ­ing an exter­nal device. In this case, fol­low the instruc­tions for Relocating "bol­proces­sor" before run­ning the installer or the script.

Using the installer

Download "BolProcessorInstaller.pkg" from here and double-click it.

👉  If you have pre­vi­ous­ly down­loaded an old­er ver­sion of the installer, your brows­er may be deliv­er­ing the old ver­sion instead of the lat­est. The safest thing to do is to check the size of "BolProcessorInstaller.pkg" (reed below the Security sec­tion). If nec­es­sary, use a dif­fer­ent brows­er for the download.

This installer has been nota­rized, which means it con­tains infor­ma­tion that allows Apple to cer­ti­fy its valid­i­ty. The only changes you will have to con­firm are usu­al soft­ware instal­la­tion pro­ce­dures on your Mac.

If you have cho­sen the option of the stand­alone appli­ca­tion called "BolProcessor.app", the instal­la­tion is now com­plete. You can pro­ceed to install Csound if you need it. Otherwise, fol­low the guid­ed tour on page Bol Processor ‘BP3’ and its PHP inter­face.

For geeks using XAMPP or MAMP: The installer sets up user/group para­me­ters in the "bolprocessor" fold­er: "daemon:admin" if XAMPP is the Apache serv­er. If MAMP is used, the "<user_id>:admin" set­ting is retained.

Once that's done, go down to the sec­tion Compile the 'bp' con­sole.

Using the script (geeks only!)

An equiv­a­lent method is to run the "install_bolprocessor.sh" script found in the "macos-scripts" fold­er down­loaded here. This makes it pos­si­ble to under­stand each step of the instal­la­tion and pos­si­bly sug­gest improvements.

After down­load­ing "macos-scripts.zip", open the Terminal and type:

cd Downloads
unzip -qo macos-scripts.zip
cd macos-scripts
sudo ./install_bolprocessor.sh

Installation issues

There are cur­rent­ly no known instal­la­tion issues with the stand­alone "BolProcessor.app" appli­ca­tion. A minor prob­lem that we hope to resolve soon is that on rare occa­sions a page may need to be reloaded to display.

If the installer (or the script) does not find a "htdocs" fold­er cre­at­ed by XAMPP or MAMP, it will sug­gest using the stand­alone "BolProcessor.app" appli­ca­tion.

👉 The installer will cre­ate or feed a "bolprocessor" fold­er in the "htdocs" fold­er used by XAMPP (first choice) or MAMP (sec­ond choice). If you have used XAMPP in the past and want to switch to MAMP, you will need to rename the "XAMPP" or "xamppfiles" fold­er before run­ning the installer.

There is a Go to Application but­ton on XAMPP man­ag­er and a WebStart but­ton on MAMP (free) which will dis­play a page con­firm­ing that the Apache serv­er is running.

MAMP set­ting of the port

Now, assum­ing that the instal­la­tion was suc­cess­ful, and the Apache serv­er is run­ning, start XAMPP or MAMP and point your brows­er to  localhost/bolprocessor/php/ or (if it doesn't work) to localhost:8888/bolprocessor/php/.

One of these will dis­play the home page of the Bol Processor. The default port used by the free MAMP is "8888", but you can change it to "80" in MAMP set­tings (see pic­ture), so that the ":8888" option is no longer required.

Compile the 'bp' console

👉 From 23 February 2025, the com­piled 'bp' con­sole will be installed (or updat­ed) by the install script. So nor­mal­ly this step is no longer need­ed, except for geeks who wish to mod­i­fy the source files in the "bolprocessor/source/BP3" folder.

If you see this frame in the image at the top right of the page, your life will be easy! All you have to do is click on the link to com­pile the con­sole, which will take a minute or two.

👉  It is very unlike­ly that the com­pi­la­tion will fail. If it ever hap­pens, please con­tact us!

Installing Xcode via the Mac App store. No charge!

If you don't see the link to com­pile, and instead a men­tion that 'gcc' is not respond­ing, you may need to install the Xcode toolk­it on your machine (link to App Store).

Install and launch Xcode (free) to enable the com­pi­la­tion. Click "Cancel" when Xcode asks you to "cre­ate a project", go back to the Bol Processor page and reload it.

Now, you should see the com­pi­la­tion link.

👉  There are oth­er meth­ods of installing 'gcc'. Fans of Terminal com­mands can sim­ply try the command:

brew install gcc

Install Csound

Csound is not required to run the Bol Processor, as you can work with MIDI files and real-time MIDI, includ­ing micro­ton­al cor­rec­tions. However, it will give you access to a dif­fer­ent approach to sound synthesis.

Just down­load a pre-built instal­la­tion of Csound (MacOS 6.18) from its down­load page.

A frame ask­ing for a cor­rec­tion of the path to Csound

The BP3 inter­face should be able to fig­ure out the loca­tion of "csound" and fix its path accord­ing­ly. If it does not respond, you will be asked to change the path and per­haps the name of the Csound con­sole (see image).

😀  Now, the Bol Processor is ful­ly oper­a­tional! You can try exam­ples con­tained in the 'ctests' fold­er, or fol­low the guid­ed tour on page Bol Processor ‘BP3’ and its PHP inter­face.

Updating to new versions

To update the Bol Processor con­sole, its PHP inter­face and exam­ples (the con­tents of the "ctests" fold­er), sim­ply rerun "BolProcessorInstaller.pkg". Using the lat­est ver­sion is safe!

The installer will down­load and install cur­rent ver­sions of the soft­ware and data.

Updating will not mod­i­fy or delete any data you have cre­at­ed in the "ctests" fold­er or out­side it. However, if you have mod­i­fied a sam­ple file with­out chang­ing its name, it will be revert­ed to its dis­tri­b­u­tion version.

The installer will also pre­serve the "_settings.php" file (if it exists), which con­tains your project settings.

Security

You are right to be con­cerned about secu­ri­ty. Can you be sure that you have down­loaded the cor­rect (and lat­est) ver­sion of "BolProcessorInstaller.pkg"? Normally yes, this installer is safe because it has been nota­rized.

The size of the "BolProcessorInstaller.pkg" file is exact­ly 21651 bytes and its MD5 is
bcff82a7501a861690a04e2e91007a29. You can calculate the MD5 checksum on this page. These numbers will indeed be subject to change with the release of new versions of the installer. Current version: 3 March 2025.

Please DO NOT SHARE THE INSTALLER, only its link: https://bolprocessor.org/misc/BolProcessorInstaller.pkg

Geeks may want to cus­tomise it for their own use. Just down­load this fold­er which con­tains the script files (install_bolprocessor.sh and postinstall) along with instruc­tions on how the installer has been built.

For read­ers not con­ver­sant with Unix shell scripts, the fol­low­ing is a descrip­tion of the process in human language:

Check that an Apache serv­er MAMP or XAMPP is installed by find­ing either MAMP/htdocs or xampp/htdocs on the com­put­er (not case-sensitive). If it is not found, exit with the warn­ing that either MAMP or XAMPP should be installed.

Download the lat­est dis­tri­b­u­tion files from GitHub:
https://github.com/bolprocessor/bolprocessor/archive/graphics-for-BP3.zip
https://github.com/bolprocessor/php-frontend/archive/master.zip
https://github.com/bolprocessor/bp3-ctests/archive/main.zip

Unzip these three files. They cre­ate fold­ers with names:
bolprocessor-graphics-for-BP3
php-frontend-master
bp3-ctests-main

Create a fold­er named "bol­proces­sor" (if it does not yet exist) inside the "htdocs" fold­er of the Apache server

Copy bolprocessor-graphics-for-BP3/source to bolprocessor/
If there is already a "source" fold­er, delete it

Copy bolprocessor-graphics-for-BP3/Makefile to bolprocessor/
Copy bolprocessor-graphics-for-BP3/BP3_help.txt to bolprocessor/
Copy bolprocessor-graphics-for-BP3/Credits.txt to bolprocessor/
Copy bolprocessor-graphics-for-BP3/BP3-To-Do.txt to bolprocessor/
Copy bolprocessor-graphics-for-BP3/License.txt to bolprocessor/
Copy bolprocessor-graphics-for-BP3/ReadMe.txt to bolprocessor/

Copy bolprocessor/php/_settings.php to bolprocessor/ (if it exists)

Copy php-frontend-master/php to bolprocessor/
If there is already a "php" fold­er, delete it

Copy bolprocessor/_settings.php to bolprocessor/php/ (if it exists)

Create a fold­er bolprocessor/csound_resources if it does not yet exist

Copy the con­tent of php-frontend-master/csound_resources to bolprocessor/csound_resources
Files that already exist should be replaced with their updat­ed versions

Create a fold­er htdocs/bolprocessor/ctests if it does not yet exist

Copy the con­tent of bp3-ctests-main to bolprocessor/ctests
Files that already exist should be replaced with their updat­ed versions

Delete the tem­po­rary down­load directory

Set per­mis­sions of the bol­proces­sor fold­er recur­sive­ly to "775", and owner/group to <your_id>:admin if MAMP is used, or daemon:admin if XAMPP is used.

There is no secu­ri­ty risk in set­ting "775" per­mis­sions, as the MAMP or XAMPP Apache serv­er will be run­ning on your pri­vate com­put­er. The Bol Processor nev­er creates/modifies files out­side of its  "bolprocessor"  folder.

Delete bolprocessor/bp if it exists and replace it with the cur­rent 'bp' con­sole.

Relocating "bolprocessor"

👉  Apparently, relo­cat­ed instal­la­tions do not work with XAMPP after a reboot, unless the "BolProcessorInstaller.pkg" installer is run again. We're try­ing to fix this prob­lem. In the mean­time, you can at least relo­cate your data using sym­bol­ic links.

The Bol Processor can be installed out­side the "htdocs" fold­er cre­at­ed by MAMP or XAMPP (on your boot dri­ve). You might want it near relat­ed projects, or use extra space from an exter­nal hard dri­ve. There may also be sit­u­a­tions where cre­at­ing files on the boot dri­ve is restrict­ed to the super admin.

Fortunately, the process of relo­cat­ing is very simple.

If you have already cre­at­ed a "bolprocessor" fold­er by run­ning the installer, drag it to the desired loca­tion and delete it from the "htdocs" fold­er. If not, cre­ate an emp­ty "bolprocessor" fold­er in the desired location.

Then, open the Terminal (in the Applications fold­er) and point it to the "htdocs" direc­to­ry. For those unfa­mil­iar with Unix com­mands, you will need to type "cd " (fol­lowed by a space) and drag "htdocs" to the end of this com­mand, then press "return". You can type the instruc­tion "ls -al" to see the con­tents of "htdocs", which is nor­mal­ly empty.

Let's say you've cre­at­ed an emp­ty fold­er "bolprocessor" inside a fold­er called "MUSIC" on an exter­nal dri­ve called "EXT". The instruc­tion cre­at­ing the sym­bol­ic link is:

ln -s /Volumes/EXT/MUSIC/bolprocessor bolprocessor

Make sure that the sym­bol­ic link you cre­at­ed points to the cor­rect loca­tion: you will now see a "bolprocessor" icon with a small arrow in the bot­tom left cor­ner. Double-click it, it should open the des­ti­na­tion folder.

👉 You may won­der why sym­bol­ic links are used instead of MacOS alias­es, which do not require the use of the Terminal. The rea­son is that the Apache servers don't accept alias redirections.

You can now safe­ly run the installer (or install script) and pro­ceed to com­pile the 'bp' con­sole. Make sure you use the lat­est ver­sion of the installer (from 3 January 2025), as it is designed to work with sym­bol­ic links.

👉 Never change the names of the "bolprocessor" fold­er and sym­bol­ic link, oth­er­wise the instal­la­tion will fail.

The first time you run the Bol Processor, MAMP or XAMPP may ask your per­mis­sion to dis­play files out­side its "htdocs" fold­er. Please con­tact us if you're expe­ri­enc­ing issues with this relocation!

If you're not afraid of sym­bol­ic links, you can use the same tech­nique to relo­cate some data files out­side the "bolprocessor" fold­er, for exam­ple to a loca­tion in your Dropbox (includ­ing shared fold­ers), as explained here.

Uninstall the Bol Processor

Uninstalling the Bol Processor, and all the data down­loaded or cre­at­ed for its use, is very sim­ple: delete the "bolprocessor" fold­er, and the "bolprocessor" sym­bol­ic link if you have cre­at­ed it.

Bernard Bel
Creation: August 2024

Quick install Windows

   

This is a sup­ple­ment to the page Bol Processor ‘BP3’ and its PHP inter­face.

A one-click installer of Bol Processor BP3 is avail­able. It is called "BolProcessorInstaller.exe" and it can be down­loaded here (unique location).

This installer is used for both ini­tial instal­la­tion and updates. Each time you run it, it will down­load the lat­est ver­sions of the BP3 con­sole, includ­ing its source files, the inter­face PHP files, and the sam­ple set con­tained in the 'ctests' fold­er. Data, gram­mars and scripts that you've cre­at­ed will not be delet­ed. However, if you have mod­i­fied files in the 'ctests' fold­er, they will be revert­ed to the dis­tri­b­u­tion version.

This instal­la­tion is checked with Windows 10 run­ning on an HP Intel Core i5-6200U (64-bit, 8 Gb RAM) and MAMP (free) run­ning PHP 8.3.1. It should work fine with Windows 11, please check it and report!

👉   26 January 2025: The installer "BolProcessorInstaller.exe" is now cer­ti­fied. It should not dis­play a "mali­cious soft­ware" warn­ing. Once opened, before start­ing the instal­la­tion, it should men­tion the name of its cre­ator: "Bernard Bel".
Contact us if it doesn't work on your computer!

First install MAMP or XAMPP

The (free) MAMP device run­ning on Windows 10 (July 2024). Note that Apache Server is active. You can click "Open WebStart Page" to check that it is effective.

If you try to run the installer (see below), it will first check that a local Apache serv­er (MAMP or XAMPP) has been installed. Both are suit­able since the Bol Processor inter­face con­tains exclu­sive­ly HTML, PHP and JavaScript code. No data­base is required.

if you choose the (free) MAMP ver­sion, both MAMP and MAMP PRO will be installed, and the inter­face will occa­sion­al­ly invite you to "upgrade" to MAMP PRO. But you don't need it for the Bol Processor!

For MAMP on Windows, the "htdocs" fold­er is in "C:\MAMP".
For XAMPP on Windows, the "htdocs" fold­er is in "C:\xampp". (To be verified)

If you want Apache to start auto­mat­i­cal­ly when you start your com­put­er, this process is easy with MAMP, but a bit more com­plex with XAMPP: try this method.

Create the 'bp.exe' console

After installing MAMP or XAMPP, run the installer "BolProcessorInstaller.exe" down­loaded here.

👉 The installer cre­ates a "bolprocessor" fold­er in the "htdocs" fold­er used by MAMP or XAMPP. Make sure that there is only one such fold­er on your machine, notably if you tried both MAMP and XAMPP in the past. It is safe to rename any unused "htdocs" fold­er before run­ning the installer.

If you plan to install the "bolprocessor" fold­er out­side the "htdocs" fold­er, fol­low the instruc­tions in Relocating "bol­proces­sor" before run­ning the installer.

As "BolProcessorInstaller.exe" is not yet cer­ti­fied, you may receive a warn­ing that it is from an "unknown source". Click on the option to ignore the warn­ing. If you don't feel con­fi­dent about doing this, please read the sec­tion on Security below.

All steps of the instal­la­tion are dis­played to ensure that they are suc­cess­ful. At the end you'll be asked to press a key.

Now start MAMP or XAMPP. There is an Open WebStart Page but­ton on MAMP (free) which will dis­play a page con­firm­ing that the Apache serv­er is run­ning. Probably you will find a Go to Application but­ton on XAMPP man­ag­er.

Point your brows­er at localhost/bolprocessor/php/. This will dis­play the home page of Bol Processor BP3. Otherwise, check that MAMP or XAMPP is set to use port #80.

If you see this image at the top right of the page, the con­sole is ready. Click on the lamp if you pre­fer to use the light mode for the interface.

You can ignore the next sec­tion. 😀

Compile the 'bp.exe' console (if necessary)

The Windows instal­la­tion of Bol Processor includes the pre-compiled con­sole (named 'bp.exe' ). If, some some rea­son, the con­sole is not respond­ing, or if you mod­i­fied its source code (in the source/BP3 directory), you may need to recom­pile it.

If you see this image at the top right of the page, your life will be easy!

All you have to do is click on the link to com­pile the con­sole, which will take a minute or two.

If the frame says that 'gcc' is not respond­ing (see pic­ture) you need to install MinGW. This is the main draw­back of Windows: its default instal­la­tion does not han­dle 'gcc' (the stan­dard C com­pil­er). You need 'gcc' to com­pile the Bol Processor con­sole, and per­haps oth­er appli­ca­tions to come. So, install MinGW, care­ful­ly fol­low­ing instruc­tions on this page. It is sim­ple, but you shouldn't miss a step!

Once 'gcc' is respond­ing, reload the Bol Processor home page and click on the link to com­pile the console.

Install Csound

Csound is not required to run the Bol Processor, as you can work with MIDI files and real-time MIDI. However, it will give you access to a dif­fer­ent approach to sound synthesis.

Just down­load a pre-built instal­la­tion of Csound from its down­load page. Select "64bit Full Installer 6.18.1".

A frame ask­ing you to cor­rect the path to Csound. This is the default path for Windows 10, by the way. We tricked the inter­face into say­ing it was wrong!

The BP3 inter­face will be able to fig­ure out the loca­tion of "csound.exe" and fix its path accord­ing­ly. If it does not respond, you will be asked to change the path and per­haps the name of the Csound con­sole (see image). Once it works after a mod­i­fi­ca­tion, please con­tact us so that we can update the default paths and names of Csound in your instal­la­tion of Windows.

😀  Now, the Bol Processor is ful­ly operational!

You can try exam­ples con­tained in the "ctests" fold­er, or fol­low the guid­ed tour on the page Bol Processor ‘BP3’ and its PHP inter­face.

Updating to new versions

To update the Bol Processor con­sole, its PHP inter­face and exam­ples (the con­tents of the "ctests" fold­er), sim­ply rerun the installer. It will down­load and install the lat­est ver­sions of the soft­ware and data. It will also delete and replace the pre­com­piled "bp.exe" con­sole.

The installer will not mod­i­fy or delete any data you have cre­at­ed in the "ctests" fold­er or out­side it. However, if you have mod­i­fied a sam­ple file with­out chang­ing its name, it will be revert­ed to its dis­tri­b­u­tion version.

The installer will also pre­serve the "_settings.php" file (if it exists), which con­tains your project settings.

Security

You are right to be con­cerned about secu­ri­ty. Can you be sure that you have down­loaded the cor­rect ver­sion of "BolProcessorInstaller.exe"? As this exe­cutable is cer­ti­fied, there is no known risk of mali­cious modification.

The size of this file is exact­ly 1811159 bytes and its MD5 is
34e937fe36ce022f961a22560d5f82e4. You can calculate the MD5 on this page. These numbers will indeed be subject to change with the release of new versions of the installer. The current version is dated 14 July 2025.

👉  Please DO NOT SHARE THE INSTALLER, only its link: https://bolprocessor.org/misc/BolProcessorInstaller.exe

You may also want to know all the details of how it works. Geeks may want to cus­tomise it for their own use. Just down­load this fold­er which con­tains the source files (installer.ps1 and setup.iss) along with a sum­ma­ry of how to build the installer.

For read­ers not con­ver­sant with Windows PowerShell, the fol­low­ing is a descrip­tion of the process in human language:

Check that an Apache serv­er MAMP or XAMPP is installed by find­ing either MAMP\htdocs or xampp\htdocs on the com­put­er (not case-sensitive). If it is not found, exit with the warn­ing that either MAMP or XAMPP should be installed.

Download the lat­est dis­tri­b­u­tion files from GitHub:
https://github.com/bolprocessor/bolprocessor/archive/graphics-for-BP3.zip
https://github.com/bolprocessor/php-frontend/archive/master.zip
https://github.com/bolprocessor/bp3-ctests/archive/main.zip

Unzip these three files. They cre­ate fold­ers with names:
bolprocessor-graphics-for-BP3
php-frontend-master
bp3-ctests-main

Create a fold­er named "bol­proces­sor" (if it does not yet exist) inside the "htdocs" fold­er of the Apache server

Copy bolprocessor-graphics-for-BP3/source to htdocs/bolprocessor/
If there is already a "source" fold­er, delete it

Copy bolprocessor-graphics-for-BP3/Makefile to htdocs/bolprocessor/
Copy bolprocessor-graphics-for-BP3/BP2_help.txt to htdocs/bolprocessor/
Copy bolprocessor-graphics-for-BP3/Credits.txt to htdocs/bolprocessor/
Copy bolprocessor-graphics-for-BP3/BP3-To-Do.txt to htdocs/bolprocessor/
Copy bolprocessor-graphics-for-BP3/License.txt to htdocs/bolprocessor/
Copy bolprocessor-graphics-for-BP3/ReadMe.txt to htdocs/bolprocessor/

Copy bolprocessor/php/_settings.php to bolprocessor/ (if it exists)

Copy php-frontend-master/php to htdocs/bolprocessor/
If there is already a "php" fold­er, delete it

Copy bolprocessor/_settings.php to bolprocessor/php/ (if it exists)

Create a fold­er htdocs/bolprocessor/csound_resources if it does not yet exist

Copy the con­tent of php-frontend-master/csound_resources to htdocs/bolprocessor/csound_resources
Files that already exist should be replaced with their updat­ed versions

Create a fold­er htdocs/bolprocessor/ctests if it does not yet exist

Copy the con­tent of bp3-ctests-main to htdocs/bolprocessor/ctests
Files that already exist should be replaced with their updat­ed versions

Delete the tem­po­rary down­load directory

Replace htdocs/bolprocessor/bp.exe with the updat­ed version.

Relocating "bolprocessor"

The Bol Processor can be installed out­side the "htdocs" fold­er cre­at­ed by MAMP or XAMPP (on your boot dri­ve). You might want it near relat­ed projects, or use extra space from an exter­nal hard dri­ve. There may also be sit­u­a­tions where cre­at­ing files on the boot dri­ve is restricted.

Fortunately, the process of relo­cat­ing is very simple.

If you have already cre­at­ed a "bolprocessor" fold­er by run­ning the installer, copy it to the desired loca­tion and delete it from the "htdocs" fold­er. If not, cre­ate an emp­ty "bolprocessor" fold­er in the desired location.

Let's say you've cre­at­ed an emp­ty fold­er called "bolprocessor" inside a fold­er called "MUSIC" on an exter­nal dri­ve labelled "D", and MAMP is installed on dri­ve "C". Right-click the start icon at the bot­tom left of the screen, and select Windows PowerShell (admin). Then type the fol­low­ing com­mand to cre­ate a sym­bol­ic link — in fact a junc­tion (/J instead of /D):

cmd /c mklink /J "C:\MAMP\htdocs\bolprocessor" "D:\MUSIC\bolprocessor"

If you are using XAMPP, replace "\MAMP\" with "\xampp\".

Make sure that the sym­bol­ic link you cre­at­ed points to the cor­rect loca­tion: you will now see a "bolprocessor" icon in the "htdocs" fold­er. Double-click it, it should open the des­ti­na­tion folder.

You can now safe­ly run the installer. Updates to new ver­sions will be the same way.

Make sure you use the lat­est ver­sion of the installer, as it is designed to work with sym­bol­ic links.

👉 Never change the names of the "bolprocessor" fold­er and sym­bol­ic link, oth­er­wise the instal­la­tion will fail.

The first time you run the Bol Processor, MAMP or XAMPP may ask your per­mis­sion to dis­play files out­side its "htdocs" fold­er. Please con­tact us if you're expe­ri­enc­ing issues with this relocation!

You can use the same tech­nique to relo­cate some data files out­side the "bolprocessor" fold­er, for exam­ple to a loca­tion shared by Dropbox.

You can also use sym­bol­ic links to relo­cate fold­ers out­side the "bolprocessor" fold­er, as explained here.

Uninstall the Bol Processor

Uninstalling the Bol Processor and all the data down­loaded or cre­at­ed for its use, is very sim­ple: delete the "bolprocessor" fold­er and the "htdocs\bolprocessor" sym­bol­ic link, if you have cre­at­ed one.

Bernard Bel
Created: August 2024

XAMPP startup

👉  For the users of Linux

If you need to start XAMPP auto­mat­i­cal­ly after a reboot, here's a basic way to do it using sys­temd, which is the init sys­tem for most Linux distributions:

1) Create a systemd service file

Open a text edi­tor to cre­ate a new file, for example:

sudo nano /etc/systemd/system/xampp.service

Add the fol­low­ing con­tent to the file:

[Unit]
Description=XAMPP Control Panel
After=network.target

[Service]
Type=forking
ExecStart=/opt/lampp/lampp start
ExecStop=/opt/lampp/lampp stop
ExecReload=/opt/lampp/lampp reload
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

Save and close the file (Ctrl+X, then Y to con­firm, and Enter to save).

2) Enable the new service

Reload the sys­temd man­ag­er configuration:

sudo sys­tem­ctl daemon-reload

Enable the XAMPP ser­vice to start at boot:

sudo sys­tem­ctl enable xampp

3) You can now start XAMPP using:

sudo sys­tem­ctl start xampp

Real-time MIDI

    

In May 2024, the Bol Processor BP3 acquired the abil­i­ty to man­age the input and out­put of MIDI events. This allows it to "com­mu­ni­cate" in real time with exter­nal MIDI devices (key­boards, syn­the­siz­ers) and even with oth­er instances of BP3 run­ning on the same machine.

For geeks and programmers: This fea­ture had already been imple­ment­ed in the ear­li­er (MacOS only) ver­sion called 'BP2'. However, the imple­men­ta­tion in a C lan­guage 'con­sole' to work in MacOS, Linux and Windows envi­ron­ments was more tech­ni­cal. In addi­tion, the con­cept of "real time" in the cur­rent MIDI set­up is dif­fer­ent from the pre­vi­ous one using Opcode Music System.

The fol­low­ing exam­ples will work the same in MacOS, Windows and Linux. They have been test­ed on a recent PowerBook run­ning MacOS (Sonoma) with 16 Gb RAM, and an HP Intel Core com­put­er with 8 Gb RAM run­ning Windows 10 (64-bit) and LinuxLite 7.0 (in Ubuntu). Memory size can become crit­i­cal if many MIDI devices or vir­tu­al ports are connected. 

Using micro­ton­al scales is now pos­si­ble in real-time MIDI. Read the Check MIDI micro­tonal­i­ty page for details.

Setting up the MIDI environment

Let us assume that you have suc­cess­ful­ly down­loaded, installed and com­piled the Bol proces­sor BP3, as described on the page Bol Processor ‘BP3’ and its PHP inter­face.

In Bol Processor jar­gon, a 'project' is either a gram­mar (with a '-gr' pre­fix) or a set of data (with a '-da' pre­fix). So, cre­ate or load a sim­ple project, e.g. "-da.acceleration" which can be found in the "ctests" fold­er (down­load it here).

An output

By default, a project is set up to cre­ate MIDI files, as shown on the selec­tor (see pic­ture). Make sure your project is work­ing! Then select Real-time MIDI and click SAVE for­mat.

The selec­tor will now dis­play a dif­fer­ent image, as shown below:

By default, the MIDI out­put used for send­ing events is num­bered '0' — and the MIDI input used for receiv­ing events will be num­bered '1'. This is a com­mon sit­u­a­tion. In MacOS and Windows, these num­bers are tak­en as 'ports'. In Linux they are con­sid­ered as 'clients', each 'client' hav­ing its own 'ports', so cer­tain­ly num­bers '0' and '1' won't work… Never mind this issue, BP3 will take care of it when scan­ning real or vir­tu­al devices and try­ing to con­nect. Read more below.

We can­not rely on "port num­bers" alone because they change when we turn on and off MIDI devices con­nect­ed to the com­put­er. In Linux, the client num­ber is more spe­cif­ic to a MIDI device. In fact, the only reli­able iden­ti­fi­ca­tion is its name, which is emp­ty by default: the next field at the right of the input/output number.

Let us check the MIDI out­put. Windows does this auto­mat­i­cal­ly. The good news is that Windows 10 (and pre­sum­ably lat­er ver­sions) comes with a built-in MIDI device called Microsoft GS Wavetable Synth. The Bol Processor will auto­mat­i­cal­ly detect it and con­nect to it if no oth­er device is con­nect­ed to the system.

Linux also con­nects, by default, the out­put to a vir­tu­al device whose client num­ber is '0', but it won't pro­duce any sound in the basic instal­la­tion of Ubuntu. So, to try real-time MIDI on Linux, you need to con­nect an exter­nal MIDI device via its USB/MIDI inter­face, or to install a soft­ware syn­the­siz­er. Read more below.

Clicking Add an input will cre­ate fields for you to select an input device. We'll use this later.

To con­nect exter­nal MIDI input/output devices to Windows, you may need to install an envi­ron­ment sim­i­lar to IAC on MacOS. Read details below. However, most tests shown on this page can be per­formed on Windows with­out any addi­tion­al installation.

The fol­low­ing para­graphs are for MacOS users. Windows and Linux users can hap­pi­ly jump to the next section.

Turn on a MIDI device (syn­the­siz­er, piano, etc.) con­nect­ed to the com­put­er. On my per­son­al Mac, I usu­al­ly use the Pianoteq syn­the­sis­er, which pro­duces a phys­i­cal mod­el syn­the­sis of var­i­ous key­board instru­ments. It com­mu­ni­cates with BP3 via a device called the Inter-Application Communication (IAC) archi­tec­tureread this if you need details.

The IAC dri­ver is installed by default on recent MacOS sys­tems. (It is a part of the CoreMIDI frame­work pro­vid­ed by Apple.) It allows you to cre­ate vir­tu­al MIDI ports that enable MIDI appli­ca­tions to com­mu­ni­cate inter­nal­ly with­in the same machine. Equivalent devices exist in the Linux and Windows envi­ron­ments, see below.

The IAC also com­mu­ni­cates with exter­nal MIDI devices via the USB ports, BlueTooth and pos­si­bly more net­work pro­to­cols. We'll try it later.

To set up the IAC, run the Audio MIDI Setup appli­ca­tion (in the Utilities fold­er). Ask it to show "MIDI Studio". On my per­son­al com­put­er, it looks like this: the IAC dri­ver, the Pianoteq syn­the­sis­er, a Pocket Key 15 key­board con­nect­ed to a USB port, and a Yamaha piano con­nect­ed by stan­dard MIDI cables and a USB MIDI inter­face. The Yamaha piano appears grey because it is switched off.

On active MIDI devices you will see tri­an­gles indi­cat­ing input/output ports. These are used to con­nect devices direct­ly by draw­ing a 'cable' to con­nect them. We don't need to use these 'con­nec­tors' as BP3 com­mu­ni­cates via the IAC MIDI ports.

Check output options

(MacOS, Linux and Windows)

The eas­i­est way to pro­ceed now is to run any project in the Real-time MIDI mode, and see if sounds are pro­duced… Whatever the result, at the end of the (poten­tial­ly silent) per­for­mance, you will see a Show all … mes­sages but­ton along with a blink­ing red sig­nal "=> 1 warning". Click on the but­ton to read detailed expla­na­tions of the fail­ure (or success):

🎹 Setting up MIDI sys­tem
MIDI out­put = 0: “Bus 1” 👉 the num­ber of your choice

MIDI set­tings saved to ../temp_bolprocessor/trace_974dd9ab22_-gr.tryTimePatterns_midiport
🎹 Name(s) of MIDI input or/and output changed and will be updated when saving the page of your project

(For MacOS users)

This all makes sense giv­en the Audio MIDI Setup shown above. The Bol Processor scanned all out­put (and input) MIDI ports. Given port '0' as an out­put by default, it assigned it to "Bus 1" which the 'port' set up in IAC.

If your syn­the­sis­er hap­pens to be con­nect­ed to "Bus 1", you will hear sounds and the prob­lem is solved. Let us sup­pose that you are run­ning Pianoteq and hear noth­ing. Open the set­tings of Pianoteq and select "Devices". All you have to do is check "IAC Driver Bus 1". You might also check oth­er inputs, includ­ing Pocket Key 25 if you want to con­nect your small key­board direct­ly to Pianoteq, but these are extra procedures.

Opening Pianoteq set­tings informed us that it is com­mu­ni­cat­ing with IAC, and it sug­gest­ed to use a IAC 'Bus' for this com­mu­ni­ca­tion. The 'Bus 1' port is tech­ni­cal­ly called a vir­tu­al port.

Screenshot

All you need to do to ensure that the con­nec­tion remains cor­rect when more devices are switched on/off and MIDI port num­bers change. The only reli­able way is to write the name "Bus 1" as the MIDI out­put. You can also write "Pocket Key 25" (or what­ev­er is detect­ed as your input MIDI device) to the MIDI input, as we will use it lat­er. Note that MIDI port num­bers are now irrel­e­vant, as names take prece­dence. BP3 will cor­rect them automatically.

Click the SAVE MIDI ports but­ton to store this set­ting. Clicking on the SAVE for­mat does the same thing, so don't wor­ry about con­fus­ing buttons!

To the right of the MIDI port name is an emp­ty field where you can enter a com­ment. For exam­ple, write "Pianoteq synth" to the right of "Bus 1".

Let us now switch on a Yamaha piano which is con­nect­ed via a USB MIDI inter­face. The inter­face I use has a green light that indi­cates it has pow­er. If the piano is actu­al­ly com­mu­ni­cat­ing with it, we should see a flash­ing red light. In MacOS, some­times it is nec­es­sary to restart the com­put­er after switch­ing on the piano… But in Windows and Linux the red light flash­es immediately.

As soon as the red light flash­es, open the Pianoteq set­tings. Great! We can now see that the Yamaha piano is recog­nised and con­nect­ed to the IAC.

The eas­i­est way to con­nect the Yamaha piano to BP3 is to click PLAY. Whatever hap­pens, we'll get a warn­ing and see the fol­low­ing diagnosis:

🎹 Your real-time MIDI set­tings:
MIDI out­put = 0: “Bus 1” -
MIDI input = 1: “new input” -

🎹 Setting up MacOS MIDI sys­tem
MIDI out­put = 0: “Bus 1” 👉 the name of your choice
Trying to assign ports to 1 input(s) with­out names but pos­si­bly with num­bers
MIDI input = 1: “Bus 2” 👉 the num­ber of your choice
MIDI input 1 makes BP3 inter­ac­tive

🎶 More MIDI out­put options are avail­able:
MIDI out­put = 1: “Bus 2”
MIDI out­put = 2: “Pocket Key 25”
MIDI out­put = 3: “USB MIDI Interface”

🎶 More MIDI input options are avail­able:
MIDI input = 0: “Bus 1”
MIDI input = 2: “Pocket Key 25”
MIDI input = 3: “USB MIDI Interface”

MIDI set­tings saved to ../temp_bolprocessor/trace_974dd9ab22_-gr.tryTimePatterns_midiport
🎹 Name(s) of MIDI input or/and output changed and will be updated when saving the page of your project

The MIDI input iden­ti­fied as "Pocket Key 25" is cor­rect­ly con­nect­ing to port '2'. But the Yamaha piano is iden­ti­fied as "USB MIDI Interface". This is the name we need to copy to the MIDI out­put, then SAVE MIDI ports and PLAY. Another option is to leave the name emp­ty and enter the MIDI out­put num­ber '3'.

We hear the out­put on the Yamaha piano, although port num­bers were incor­rect on the inter­face. The incon­sis­ten­cy is resolved by the MIDI dri­ver select­ing ports by name in order of pri­or­i­ty. Port num­bers (and names) are updat­ed as soon as you save or reload the project (data or gram­mar). Then you get:

Why does the name "Yamaha piano" appear in Pianoteq set­tings, but not in the MIDI ports scanned by BP3? This is a mys­tery that expert users of a MIDI stu­dio could prob­a­bly solve… For the time being, just write "Yamaha piano" in the com­ment field at the right of "USB MIDI interface". 

The Pause and Continue buttons

During real-time play­back, Pause and Continue but­tons are dis­played. These are self-explanatory. Clicking the Continue but­ton will resume the per­for­mance with the exact timing.

These but­tons affect all instances of BP3 that are play­ing togeth­er, if any (see below).

The _part() command

It is pos­si­ble to send parts of a Bol Processor score to sep­a­rate out­puts. Parts are iden­ti­fied by the "_part(x)" com­mand in which 'x' is an inte­ger in range 1..30. We will be able to han­dle more than 30 parts if it turns out to be necessary.

The "_part(x)" com­mand directs MIDI mes­sages to a spe­cif­ic MIDI out­put, which in most cas­es will be an instru­ment. The image on the side shows the map­ping of port #3 (USB MIDI inter­face) to part #2, as set up in its filter.

By default, MIDI out­puts "hear" all 30 parts, but here we've restrict­ed this one to part #2.

For MIDI port #0 (Bus 1) we've restrict­ed the out­put to part #5.

Let us play the fol­low­ing score:

C3 D3

This sequence of notes is heard on both instru­ments. As there is no "_part()" com­mand in the score, all out­puts send the MIDI messages.

Now let us try:

G2 _part(5) C3 _part(2) D3

Note G2 is heard on both instru­ments. But, as expect­ed, the note C3 is heard on Bus 1 and D3 is heard on the USB MIDI inter­face.

The "_part()" com­mand has exact­ly the same syn­tac­tic behav­iour as "_chan()" and "_ins()". For exam­ple, it "fol­lows" the score along the fields of poly­met­ric struc­tures:

G2 _part(5) C3 {D3 E3, _part(2) B2 _part(5) A2} F3 _part(2) G3

In this exam­ple, G2 is heard on both instru­ments. Then C3 is sent to Bus 1, as well as D3 and E3, since they are the first field of the poly­met­ric struc­ture. In the same time, B2 is sent to the USB MIDI inter­face, then A2 to Bus1. At the out­put of the poly­met­ric struc­ture, F3 is sent to Bus 1 which was the map­ping before the struc­ture. At last, G3 is sent to the USB MIDI inter­face.

The sound-object graph shows that D3 and B2 are played togeth­er, although on dif­fer­ent instru­ments, and E3 and A2 are played togeth­er on the instru­ment con­nect­ed to Bus 1.

Parts are most­ly rel­e­vant when import­ing digi­tised scores. They are used to declare instru­ments in MusicXML files. When import­ing a score, the Bol Processor will option­al­ly place "_part()" or "_chan()" com­mands in the import­ed score, so that it can be played on the same set of dig­i­tal instruments.

Using "_part()" is a bet­ter option than "_chan()" to name an instru­ment, because MIDI chan­nels can be mod­i­fied to han­dle micro­ton­al adjust­ments. On the Data page, there is a MANAGE _chan(), _ins(), _part() but­ton that opens a dia­log for con­vert­ing parts to/from chan­nels, parts to/from instru­ments, etc.

An input

Setting up an input fol­lows exact­ly the same pro­to­col as set­ting up the out­put. For exam­ple, we can set up the input on "Pocket Key 25” as shown above. “USB MIDI Interface” (the Yamaha piano) is anoth­er pos­si­ble choice. Let us con­tin­ue with Pocket Key 25.

Windows users can sim­ply plug their exter­nal MIDI key­board (e.g. "Pocket Key 25”) to a USB port of their com­put­er, as it will be auto­mat­i­cal­ly recog­nised and set up by the system.

Connecting an input to BP3 is of lit­tle inter­est if BP3 does noth­ing with input events. The instruc­tions it can han­dle are list­ed in the sec­tion List of scripts for deal­ing with real-time MIDI below. "Wait for note…" means that BP3 will stop play­ing until it receives a NoteOn of the note in ques­tion — even with veloc­i­ty zero.

Let us pro­gram this on a Data page for example:

_script(Iwait for C3 channel 1) _transpose(12) _vel(60) E2 • D2 E2 • _vel(65) B2 D2 E2 • G2 B2 D2 E2 • _vel(70) F#2 G2 B2 D2 E2 • Bb2 F#2 G2 B2 D2 E2 • _vel(75) C2 Bb2 F#2 G2 B2 D2 E2 • _vel(77) G#2 C2 Bb2 F#2 G2 B2 D2 E2 • _vel(80) A2 G#2 C2 Bb2 F#2 G2 B2 D2 E2 • _vel(85) Eb2 A2 G#2 C2 Bb2 F#2 G2 B2 D2 E2 • _vel(87) C#2 Eb2 A2 G#2 C2 Bb2 F#2 G2 B2 D2 E2 • _vel(90) F2 C#2 Eb2 A2 G#2 C2 Bb2 F#2 G2 B2 D2 E2

The script com­mand tells that the per­for­mance should start when note C3 is received on MIDI chan­nel 1. To avoid any con­fu­sion about octave num­bers, I have writ­ten the name on the low­est key of my Pocket Key 25 (see pho­to). This con­fu­sion is made worse by the fact that the Italian/Spanish/French con­ven­tion uses low­er octave numbers!

So, the labelled key is the one we need to press to start this show. Let's try it…

When the PLAY but­ton is clicked on the Data page, a flash­ing STOP but­ton is dis­played. The machine would wait for­ev­er unless the cor­rect MIDI event has been received. The STOP but­ton — or the PANIC but­ton at the top right — can be used to abort the process clean­ly. If all goes well, press­ing the C3 key should pro­duce this sound:

Harm Visser's '-da.acceleration' example
Notice that the _transpose(12) instruc­tion plays notes one octave higher!

(This lit­tle "accel­er­a­tion" piece was com­posed by Harm Visser to illus­trate the peri­od nota­tion. Read his tuto­r­i­al.)

Multiple inter­rup­tions are of course pos­si­ble. Try this:

_script(wait for C3 channel 1) _transpose(12) _vel(60) E2 • D2 E2 • _vel(65) B2 D2 E2 • G2 B2 D2 E2 _script(wait for C4 channel 1) • _vel(70) F#2 G2 B2 D2 E2 • Bb2 F#2 G2 B2 D2 E2 • _vel(75) C2 Bb2 F#2 G2 B2 D2 E2 • _vel(77) G#2 C2 Bb2 F#2 G2 B2 D2 E2 • _vel(80) A2 G#2 C2 Bb2 F#2 G2 B2 D2 E2 • _vel(85) Eb2 A2 G#2 C2 Bb2 F#2 G2 B2 D2 E2 • _vel(87) C#2 Eb2 A2 G#2 C2 Bb2 F#2 G2 B2 D2 E2 • _vel(90) F2 C#2 Eb2 A2 G#2 C2 Bb2 F#2 G2 B2 D2 E2

Now the machine will start its per­for­mance after receiv­ing a NoteOn of C3. It will then stop after three beats and wait for a NoteOn of C4. A note­wor­thy detail is that one sec­ond after an inter­rup­tion, AllNotesOff is sent to all MIDI chan­nels and the ped­als are set to off. This pre­vents notes wait­ing for their NoteOff from being heard. This "All Notes Off" fea­ture can be turned off in the pref­er­ences file.

MIDI input filters

Let us play with the con­tin­u­ous impro­vi­sa­tion "Mozart’s musi­cal dice game" (called "-gr.Mozart" in the "ctests" fold­er). If this project is set for real-time MIDI, the impro­vi­sa­tion will not stop until we click on the STOP or PANIC but­ton. Inserting a "wait for note…" at the begin­ning would of course stop the per­for­mance at the begin­ning of every vari­a­tion. Beware that you will have to write "do2" instead of "C3" due to the note convention!

But let's try some­thing else, using the exter­nal key­board (the Pocket Key 25 or Yamaha piano) to play notes on top of the per­for­mance. How strange! We don't hear any notes played on the exter­nal key­board unless it's con­nect­ed direct­ly to the out­put device.

The rea­son for this becomes clear after click­ing on the FILTER but­ton for MIDI input 2:

All types of MIDI events are list­ed along with how they are processed by BP3. Here we are only inter­est­ed in NoteOn/NoteOff events. The default set­ting is '1', which means that they can trig­ger script com­mands, but are not for­ward­ed to the MIDI out­put. This is why 'C3/do2' was able to start the per­for­mance, although we could not hear it.

To play notes over the per­for­mance, we need to set the sta­tus of NoteOn and NoteOff to '2'. Note: If we only set the NoteOn sta­tus, BP3 will auto­mat­i­cal­ly set the NoteOff sta­tus to avoid con­fu­sion. Once you have changed the set­tings, click SAVE MIDI ports, then PRODUCE ITEM(S).

Since the Pocket Key 25 key­board sends only NoteOn/Noteoff mes­sages, we could as well set oth­er event fil­ters (KeyPressure, etc.) to '0'.

These fil­ter set­tings are stored, togeth­er with the MIDI port names or num­bers, in a tem­po­rary file whose name depends on both the ses­sion num­ber (cre­at­ed by your brows­er) and the project name. A copy of these set­tings is stored in the (per­ma­nent) fold­er "midi_resources". This stor­age makes it pos­si­ble to launch sev­er­al instances of BP3 on the same brows­er or on dif­fer­ent browsers, as we will now see.

Several BP3s performing and communicating

From the pre­vi­ous descrip­tion of inter­ac­tions via MIDI events — lim­it­ed for the time being to wait­ing for a par­tic­u­lar note — you may have guessed that a great fea­ture of the Bol Processor BP3 envi­ron­ment is the pos­si­bil­i­ty of run­ning sev­er­al BP3s, on dif­fer­ent machines, or even on a sin­gle machine and the same brows­er… in coop­er­a­tion with real humans play­ing MIDI instruments!

Each instance of BP3 can be thought of as a 'musi­cian' with their own com­po­si­tion­al skills embed­ded in a gram­mar or data (a set of pre-composed musi­cal frag­ments). We are work­ing on inter­ac­tions that will allow each musi­cian to mod­i­fy the behav­iour of anoth­er musician's gram­mar, for exam­ple by chang­ing rule weights — which may result in some rules being sup­pressed while oth­ers are acti­vat­ed — or chang­ing metronome set­tings if they need to per­form faster/slower, etc. All these fea­tures were part of ear­li­er ver­sions (BP2) sev­er­al decades ago!

Let us start with an extreme­ly sim­ple exam­ple using the "wait for note…" script.

Create two projects that con­tain only data, for exam­ple "-da.Beatrix" and "-da.Alan":

-se.Beatrix
{2, C#4 Eb4 A4 G#4 C4 Bb4 F#4 G4 B4 D4 E4}

-se.Alan
_script(wait for E4 channel 1) {2, - F3 C#3 Eb3 A3 G#3 C3 Bb3 F#3 G3 B3 D3 E3}

Note that these melodies do not con­tain the same num­ber of notes, but they will have the same dura­tion (2 beats) because of their poly­met­ric struc­tures.

We want Alan's per­for­mance to start pre­cise­ly after the last note of Beatrix's per­for­mance. As we don't want E4 to over­lap with F3, we have put a silence '-' before F3. In the fol­low­ing, we'll have a solu­tion to over­come this limitation.

To man­age the inter­ac­tion in MacOS, we need an addi­tion­al IAC port which is (auto­mat­i­cal­ly) named "Bus2". To do this, open Audi MIDI Setup and click on the IAC dri­ver. Then add a port (see pic­ture). You can cre­ate as many ports as you wish.

Set both Beatrix's MIDI out­put and Alan's MIDI input to "Bus2".

Now we want to hear both per­for­mances. Alan's MIDI out­put is sent to "Bus1" and will there­fore be audi­ble on the Pianoteq synthesiser.

Windows and Linux users can con­nect the two per­form­ers more eas­i­ly: send both Beatrix's and Alan's mes­sages to the exter­nal MIDI device, and con­nect Alan's input to the same MIDI device. But… the input fil­ter should receive events and not for­ward them to the out­put, which is the same device, oth­er­wise the loop will pro­duce a dis­as­trous bounc­ing effect!

Back to MacOS, there are two ways to send Beatrix's per­for­mance to the Pianoteq synthesiser:

  • Pianoteq set­tings make it pos­si­ble to lis­ten to both "Bus1" and "Bus2" vir­tu­al ports.
  • You can set up the MIDI event fil­ter on Alan's project to route input NoteOn/NoteOff events to the cur­rent MIDI out­put. See above for filters.

To play the per­for­mance, click PLAY on Alan's project so that it is ready to per­form. Then click PLAY on Beatrix's project. This is the result:

Two phras­es played in sequence by two instances of the BP3 (Beatrix & Alan).

No doubt this sounds rather unmu­si­cal! In fact, we pub­lish taste­less tech­ni­cal exam­ples to encour­age musi­cians to com­pose inter­est­ing pieces! 😀

Using out-time inaudible notes as signals

The idea of begin­ning Alan's per­for­mance with a silence that is filled by Beatrix's final note E4 is unel­e­gant. Below is a bet­ter solution:

-se.Beatrix
{2, C#4 Eb4 A4 G#4 C4 Bb4 F#4 G4 B4 D4 E4} _vel(0) <<C0>>

-se.Alan
_script(wait for C0 channel 1) {2, - F3 C#3 Eb3 A3 G#3 C3 Bb3 F#3 G3 B3 D3 E3}

The secret is the expres­sion "_vel(0) <<C0>>" which is an out-time expres­sion of note C0 with veloc­i­ty zero. The veloc­i­ty ensures that the note won't be heard, and the out-time prop­er­ty gives it a null dura­tion. Any note can be used here pro­vid­ed that it is men­tio­nend in the "_script(wait…)" instruc­tion.

If "_vel(0) <<C0>>" is fol­lowed by more notes, it is nec­es­sary to reset the veloc­i­ty to its default val­ue. The solu­tion is to write it between curly brack­ets, so that _vel(0) only applies to the con­tent of the expres­sion: "{_vel(0) <<C0>>}"

Checking the time accuracy

Let us check that the real-time syn­chro­ni­sa­tion is not affect­ed by delays. We'll now ask Alan and Beatrix to play the same piece of music (one octave apart) in the same time.

This time, Alan will start:

_transpose(12) _vel(60) E2 • D2 E2 • _vel(65) B2 D2 E2 • G2 B2 D2 E2 • _vel(70) F#2 G2 B2 D2 E2 • Bb2 F#2 G2 B2 D2 E2 • _vel(75) C2 Bb2 F#2 G2 B2 D2 E2 • _vel(77) G#2 C2 Bb2 F#2 G2 B2 D2 E2 • _vel(80) A2 G#2 C2 Bb2 F#2 G2 B2 D2 E2 • _vel(85) Eb2 A2 G#2 C2 Bb2 F#2 G2 B2 D2 E2 • _vel(87) C#2 Eb2 A2 G#2 C2 Bb2 F#2 G2 B2 D2 E2 • _vel(90) F2 C#2 Eb2 A2 G#2 C2 Bb2 F#2 G2 B2 D2 E2

In MacOS, Alan will send MIDI events to "Bus2". Beatrix will lis­ten to "Bus2" and send MIDI events to "Bus1" (Pianoteq). Beatrix will set her input fil­ter to the pass option, rout­ing the incom­ing events to the out­put. The Pianoteq syn­the­sis­er will be set to lis­ten to "Bus1" only.

This is the score of Beatrix:

_script(wait for E3 channel 1) _transpose(24) _vel(60) E2 • D2 E2 • _vel(65) B2 D2 E2 • G2 B2 D2 E2 • _vel(70) F#2 G2 B2 D2 E2 • Bb2 F#2 G2 B2 D2 E2 • _vel(75) C2 Bb2 F#2 G2 B2 D2 E2 • _vel(77) G#2 C2 Bb2 F#2 G2 B2 D2 E2 • _vel(80) A2 G#2 C2 Bb2 F#2 G2 B2 D2 E2 • _vel(85) Eb2 A2 G#2 C2 Bb2 F#2 G2 B2 D2 E2 • _vel(87) C#2 Eb2 A2 G#2 C2 Bb2 F#2 G2 B2 D2 E2 • _vel(90) F2 C#2 Eb2 A2 G#2 C2 Bb2 F#2 G2 B2 D2 E2

To start the per­for­mance, first click on the PLAY but­ton of Beatrix's project, then on the PLAY but­ton of Alan's project.

Have you noticed that Beatrix is wait­ing for E3, which does not appear in Alan's score? Oh yes, it does! There is a _transpose(12) com­mand that changes E2 (the first note) to E3. So, it works. This is the performance:

Two super­im­posed per­for­mances (one octave apart), played by two instances of the BP3 (Beatrix & Alan).

Not too bad? Despite the lack of musi­cal inter­est, we must admit that the super­im­po­si­tion is tech­ni­cal­ly accept­able, even if it is not per­fect: there is a delay of about 60 mil­lisec­onds on the first note, the time it takes Beatrix's machine to detect that it has received a NoteOn for C3. The sub­se­quent notes are pro­grammed to com­pen­sate for this delay, but there are still dis­crep­an­cies (which can be quan­ti­fied on the Pianoteq MIDI input). They seem to be caused by delays out­side BP3.

You can adjust the delay in Beatrix's project set­tings "-se.Beatrix". There is a para­me­ter called "Sync delay", which is the num­ber of mil­lisec­onds Beatrix's out­put events should be post­poned after the syn­chro­ni­sa­tion. We cur­rent­ly find that 380 ms is a good value.

In fact, the super­im­po­si­tion would sound even bet­ter if both per­for­mances were trig­gered by the same event, such as the con­duc­tor press­ing a key on the exter­nal key­board. This exer­cise was only intend­ed to show that syn­chro­ni­sa­tion between "vir­tu­al musi­cians" works well.

Working with multiple MIDI inputs

In the pre­vi­ous exam­ple, we could decide that Alan's per­for­mance will start when he receives a par­tic­u­lar note from the Pocket Key 25 key­board. In this case, we need to click on both START but­tons, putting both 'musi­cians' in wait mode, and the per­for­mance will not start until the cor­rect key is pressed on the keyboard.

This case is man­age­able with sin­gle inputs on each instance of BP3. More com­pli­cat­ed cas­es, how­ev­er, require exter­nal 'actors', such as a Pocket Key 25 key­board send­ing to all the 'musi­cians' syn­chro­ni­sa­tion mes­sages, or mes­sages mod­i­fy­ing para­me­ters in gram­mars, chang­ing the metronome val­ue, etc.

To achieve this, the Bol Processor is a able to man­age mul­ti­ple MIDI inputs.

The new game is as fol­lows: both Beatrix and Alan will take turns play­ing vari­a­tions of Mozart's musi­cal dice game (see '-gr.Mozart'), one octave apart. They will use the Improvise mode to con­tin­ue throw­ing the dice and cre­at­ing unheard vari­a­tions. But they will wait for a sig­nal from the oth­er to start play­ing a new variation.

In short, both musi­cians will use the same gram­mar, with only a small change for mutu­al syn­chro­ni­sa­tion. Their set­tings must be care­ful­ly adjusted:

  • Select Italian/Spanish/French as a note convention
  • Check Non-stop improvise
  • Adjust Pclock = 3 and Qclock = 11 to get the same metronome speed of 220 bpm
  • Set Sync delay to 380 ms
  • We don't want both musi­cians to repeat the same vari­a­tions. So, set the Seed for randomization to dif­fer­ent val­ues, for instance '1' and '2'. Or set it to zero to instruct the machine to seed the ran­dom sequence with an arbi­trary num­ber of its choice.

In the cur­rent ver­sion of BP3, the eas­i­est way to send a sig­nal is to send a note with a veloc­i­ty of zero, which will there­fore go unheard. So we need to change the gram­mar to add these par­tic­u­lar notes.

In fact, the same notes should nev­er be part of the score, so that the sig­nal is real­ly sent at the end. This is easy with Mozart's game, for exam­ple we can use C# (do#) for the syn­chro­ni­sa­tion. Below are the tops of the gram­mars used by Beatrix and Alan.

Beatrix '-gr.Beatrix':

-se.Beatrix
ORD
gram#1[1] S --> _script(wait for do#3 chan­nel 1) _vel(80) A B _vel(0) do#2
gram#1[2] A --> A1 A2 A3 A4 A5 A6 A7 A8 A1 A2 A3 A4 A5 A6 A7 A'8
gram#1[3] B --> B1 B2 B3 B4 B5 B6 B7 B8 B1 B2 B3 B4 B5 B6 B7 B8
-------------------
LIN [Select rules ran­dom­ly and apply from left to right]
etc.

Alan's '-gr.Alan':

-se.Alan
ORD
gram#1[1] S --> _script(wait for do#2 chan­nel 1) _vel(80) _transpose(-12) A B _vel(0) do#4
gram#1[2] A --> A1 A2 A3 A4 A5 A6 A7 A8 A1 A2 A3 A4 A5 A6 A7 A'8
gram#1[3] B --> B1 B2 B3 B4 B5 B6 B7 B8 B1 B2 B3 B4 B5 B6 B7 B8
-------------------
LIN [Select rules ran­dom­ly and apply from left to right]
etc.

Again, we put do#4 at the end of Alan's per­for­mance because it is played as do#3 (one octave low­er) due to the _transpose(-12) instruc­tion.

Now we need to set up the MIDI inputs and out­puts. Beatrix will send events to "Bus 1" which is the Pianoteq syn­the­siz­er. She will receive events from "Bus 2", use them for syn­chro­ni­sa­tion, and for­ward them to the output.

Alan will send events to "Bus 2" and lis­ten to "Bus 1" for the synchronisation.

This is all per­fect on paper, but who is going to start? We have cre­at­ed a chick­en and egg sit­u­a­tion, so we need a super­pow­er to start the process! Actually, a real human press­ing the do#2 key on a Pocket Key 25 key­board will do.

The inter­face has a Add an input but­ton. We click it on Alan's project and paste the name Pocket Key 25. We also use the com­ment fields to remem­ber the use of each port:

MIDI inputs and out­puts are iden­ti­fied by their names. The num­bers in the left­most box­es are auto­mat­i­cal­ly set by the con­sole dur­ing performance.

To start the con­cert, we'll click START on both projects. The order is irrel­e­vant. Then we'll press a key on the Pocket Key 25. Which key?

If we press the do#2 key, we will cer­tain­ly trig­ger Alan's impro­vi­sa­tion and the cycle will start. But if we press the do#3 key, noth­ing will hap­pen because, by default, the fil­ter of the Pocket Key 25's input in "-gr.Alan" does not trans­mit NoteOns to the out­put. So Beatrix won't hear it… By set­ting NoteOn to sta­tus '2' (treat and pass) on this fil­ter, it is pos­si­ble to decide who will start the per­for­mance: do#2 for Alan and do#3 for Beatrix.

Here we go (start­ing with Alan):

Alan and Beatrix (two instances of BP3) play­ing vari­a­tions of Mozart's musi­cal dice game

You can inter­rupt this dual per­for­mance at any time by click­ing the Pause but­ton (of either project) and resume it by click­ing the Continue but­ton. You can also insert musi­cal frag­ments by run­ning a project such as "-da.tryStopContinue" (see below), if Stop and Continue MIDI events are sent to both "Bus 1" and "Bus 2" ports. In both cas­es the syn­chro­ni­sa­tion is maintained.

👉  This sim­ple show should con­vince musi­cians to cre­ate "vir­tu­al bands" of BP3s play­ing dif­fer­ent gram­mars and send­ing spe­cif­ic syn­chro­ni­sa­tion sig­nals accord­ing to which vari­a­tion has just been pro­duced. Along with human per­form­ers who join in the fun!

The "vir­tu­al musi­cians" can be on the same com­put­er or remote­ly con­nect­ed via net­work (BlueTooth) or MIDI cables and USB inter­faces. If they are on the same com­put­er, they can be run on dif­fer­ent browsers and/or the same brows­er. In the lat­ter case, BP3 will not allow the same project (gram­mar or data) to be run in the same ses­sion. In gen­er­al, just like human musi­cians in an orches­tra have indi­vid­ual scores, it makes sense that vir­tu­al musi­cians don't share the same project…

The num­ber of MIDI inputs and out­puts in a project is cur­rent­ly lim­it­ed to 32. It is unlike­ly that a (human) musi­cian will need more!

Synchronise to a sequence (or list) of notes

The fol­low­ing expression

gram#1[1] S --> _script(wait for C3 chan­nel 1) - _script(wait for E3 chan­nel 1) etc.

syn­chro­nis­es the pro­duc­tion to the sequence of notes C3 E3 (what­ev­er the dura­tion and veloc­i­ty). This cre­ates inter­est­ing sit­u­a­tions where a "vir­tu­al musi­cian" is expect­ed to start play­ing after receiv­ing a sig­nal (C3) from one part­ner, then a sig­nal (E3) from anoth­er partner.

Note that there is a silence '-' between the two script instruc­tions. If there is no silence, then BP3 will resume play­ing if either C3 or E3 has been received.

Remember that because of the MIDI chan­nel spec­i­fi­ca­tion (range 1 to 16), the detec­tion of sig­nals can be selec­tive. They are also inaudi­ble when trans­mit­ted by NoteOns with veloc­i­ty zero.

Crashing the band!

In the exam­ple of Alan & Beatrix play­ing Mozart, the con­nec­tion seems to cre­ate a loop: Beatrix sends events to Pianoteq and Alan ("Bus 1"), who in turn sends events to Beatrix ("Bus 2"). Isn't that dangerous?

The rea­son it doesn't crash is that Alan's input "fromBeatrix" ("Bus 1") is fil­tered: NoteOns are received and processed (for syn­chro­ni­sa­tion), but not passed to the out­put ("Bus 2"), i.e. to Beatrix. You can try to change the fil­ter of input "Bus 1" on Alan's project, set­ting NoteOns to sta­tus '2' (treat + pass): you will get a superb crash after a flood of notes!
➡  This prob­a­bly will not hap­pen because BP3's MIDI dri­vers have been equipped with an anti-bouncing mechanism.

Working with multiple MIDI outputs

The Bol Processor cur­rent­ly accepts up to 32 MIDI inputs and outputs.

Example of a project using two inputs and two outputs:

A set­up with two MIDI out­puts and two MIDI inputs

The pro­ce­dure for adding out­puts is the same as the one for adding inputs: click on the Add an out­put but­ton, then enter the name of the MIDI device if you know it exact­ly, oth­er­wise leave it blank and let the machine con­nect it by default to the next avail­able out­put, while sug­gest­ing oth­er options:

🎹 Your real-time MIDI set­tings:
MIDI out­put = 0: “Bus 1” - Pianoteq
MIDI out­put = 3: “USB MIDI Interface” - Yamaha piano
MIDI input = 1: “Bus 2” - from Alex
MIDI input = 2: “Pocket Key 25” - a small key­board

🎹 Setting up MacOS MIDI sys­tem
MIDI out­put = 0: “Bus 1” 👉 the name of your choice
MIDI out­put = 3: “USB MIDI Interface” 👉 the name of your choice
MIDI input = 1: “Bus 2” 👉 the name of your choice
MIDI input 1 makes BP3 inter­ac­tive
MIDI input = 2: “Pocket Key 25” 👉 the name of your choice
MIDI input 2 makes BP3 inter­ac­tive

🎶 More MIDI out­put options were avail­able:
MIDI out­put = 1: “Bus 2”
MIDI out­put = 2: “Pocket Key 25”

🎶 More MIDI input options were avail­able:
MIDI input = 0: “Bus 1”
MIDI input = 3: “USB MIDI Interface”

The fact that a MIDI input or out­put is "avail­able" does not guar­an­tee that it will do what we want it to do. For exam­ple, send­ing MIDI mes­sages to the Pocket Key 25 key­board will actu­al­ly do nothing.

Filtering MIDI outputs

In the exam­ple above, MIDI out­put 3 (the Yamaha piano con­nect­ed to the USB MIDI Interface) has the fil­ter shown on this picture.

The chan­nel fil­ter spec­i­fies that the Yamaha piano will get all MIDI chan­nels except those emit­ted on MIDI chan­nel 2. Filtering MIDI chan­nels makes it pos­si­ble to send events exclu­sive­ly to dif­fer­ent instruments.

MIDI events can also be fil­tered by type. The idea is the same as for MIDI input fil­ters, see above.

Filtering on parts has been explained above.

👉  If you do not hear any sound in real-time MIDI, you may con­sid­er check­ing the out­put MIDI fil­ters before you kick the piano or screw up its cables!  😀

Using standard MIDI control

MIDI has stan­dard con­trol mes­sages, name­ly Start, Continue and Stop, which can be used to coor­di­nate mul­ti­ple "vir­tu­al musi­cians" (instances of BP3). The advan­tage is the clar­i­ty of the data and the gram­mars pro­grammed for inter­ac­tions. The dis­ad­van­tage is that these mes­sages are not assigned to spe­cif­ic MIDI chan­nels. This can be a prob­lem with a large num­ber of "vir­tu­al musi­cians". They also intro­duce a delay of about 250 mil­lisec­onds due to the time it takes for the MIDI device to process them.

Control mes­sages can be used in two ways. The first, which we will now exam­ine, is to "lis­ten" to these mes­sages via a script com­mand. The sec­ond (see next sec­tion) is to respond to them as inter­rup­tions in the performance.

Let us look at a triv­ial exam­ple (of no musi­cal inter­est), again with Beatrix and Alan play­ing togeth­er. This time, they take turns play­ing their items (sim­ple sequences of notes).

It is impor­tant that the "Respond to Stop/Continue" option is unchecked in both the Alan and Beatrix project settings.

Alan will start first. Below is the data:

E3 D3 C3 _script(MIDI send Start) _script(wait for Continue) A2 B2 C3

In short, he will play three notes (E3 D3 C3), then send a START to Beatrix and wait for a CONTINUE from Beatrix, then on receipt play the final three notes A2 B2 C3.

This is Beatrix's data:

_script(wait for Start) E4 D4 C4 _script(MIDI send Continue)

Start and Continue should be "heard" by Beatrix. Automatically, Stop will have the same status.

Beatrix's project sends its out­put to "Bus 1", the Pianoteq syn­the­siz­er. Its input is con­nect­ed to the vir­tu­al port "Bus 2".

Alan's project sends its out­put to the vir­tu­al port "Bus 2", and its input is con­nect­ed to "Bus 1".

We'll start the per­for­mance with Beatrix. Her machine will stay wait­ing for START. Then we'll start Alan's part, which will play three notes, then send a START mes­sage to Beatrix, who will play her part, and return to Alan, via a CONTINUE mes­sage, for the final part…

This all sounds log­i­cal, but it doesn't work! We do hear Alan's E3 D3 C3, but then noth­ing… The first rea­son is that Beatrix should be able to hear Alan's START com­mand, which is no longer a NoteOn as in the pre­vi­ous exam­ples. This means that the fil­ter of her input "Bus 2", from which she receives Alan's MIDI mes­sages, must be set cor­rect­ly. The Start event should be received, see pic­ture on the side. Also remem­ber that NoteOn and NoteOff should be received and trans­mit­ted to the out­put (the Pianoteq synth).

Well, now we hear Alan's E3 D3 C3 fol­lowed with Beatrix's E4 D4 C4, but then… nothing! 😢

Careful analy­sis is need­ed to solve the prob­lem. However, this is sim­ple log­ic. Remember that Alan is play­ing on "Bus 2", which is not con­nect­ed to any MIDI device. If we hear Alan's pro­duc­tion, it is because it is received by Beatrix on "Bus 2" and then for­ward­ed to "Bus 1" (the Pianoteq synth). The prob­lem is that the final part A2 B2 C3 is sent to Beatrix, but she has already stopped lis­ten­ing because her own data is finished!

You can imag­ine a band in which one musi­cian plays an impro­vi­sa­tion and then gives a sig­nal to anoth­er musi­cian to start their own impro­vi­sa­tion, but the care­less musi­cian has already vacat­ed the place believ­ing that the pro­gramme was fin­ished. The solu­tion is to tell the musi­cians not to go away until they receive a STOP sig­nal. Maybe a sig­nal from a con­duc­tor (here using the Pocket Key 25 key­board), maybe a sig­nal from the musi­cian who is in charge of end­ing the per­for­mance. So we'll tell Alan to send a STOP sig­nal at the end of his per­for­mance, and Beatrix to wait for Alan's STOP sig­nal. Below are the revised scores.

// Alan
E3 D3 C3 _script(MIDI send Start) _script(wait for Continue) A2 B2 C3 _script(MIDI send Stop)

// Beatrix
_script(wait for Start) E4 D4 C4 _script(MIDI send Continue) _script(wait for Stop)

The MIDI mes­sages Start, Continue, Stop have been used here to facil­i­tate the read­ing of scores (or gram­mars), but these can be replaced by NoteOns with dura­tions and veloc­i­ties zero on dif­fer­ent MIDI chan­nels when work­ing with a larg­er num­ber of actors.

By the way, using MIDI mes­sages Start, Continue and Stop can be prob­lem­at­ic with phys­i­cal or vir­tu­al MIDI devices. My Yamaha piano, for exam­ple, does not trans­mit these mes­sages. So, when con­nect­ed to an input, it will only send 3-byte mes­sages such as NoteOn/NoteOffs. In the Windows envi­ron­ment, the Microsoft GS Wavetable Synth also does not trans­mit any mes­sage at all. The best way to exchange mes­sages is via vir­tu­al MIDI ports cre­at­ed by "loopMIDI" (see below). In Linux, vir­tu­al ports such as 'VirMIDI 0-0' (see below) do not seem to trans­mit these Start, Continue and Stop messages.

For geeks: In the Bol proces­sor, scripts are append­ed to the next fol­low­ing sound object. For exam­ple, _script(wait for Start) is append­ed to note E4 in Beatrix's score. But what about scripts at the end of a score? The secret is that BP3 cre­ates an invis­i­ble MIDI event (ActiveSensing) at the end of each ele­ment to which it can append the final scripts.

Using control messages to interrupt a performance

This is the sec­ond way of using con­trol mes­sages. Let's try to stop a per­for­mance with a stan­dard Stop MIDI mes­sage, play a few notes and then con­tin­ue the per­for­mance with a stan­dard Continue MIDI message.

We cre­ate a project "-da.tryStopContinue" as follows:

-se.tryStopContinue
_script(MIDI send Stop) _tempo(2) A2 G#2 C2 Bb2 F#2 G2 B2 _script(MIDI send Continue)

Running this project will inter­rupt a per­for­mance, for exam­ple "-da.Watch_What_Happens_by_Oscar_Peterson". For this to work, the "Respond to Stop/Continue" option must be checked in the Oscar Peterson data project.

Let us decide that the per­for­mance will be played on the Pianoteq syn­the­sis­er con­nect­ed to "Bus 1" on a Mac.

The "-da.tryStopContinue" will send its data to a vir­tu­al port, for instance "Bus 2". To this effect, the "-da.Watch_What_Happens_by_Oscar_Peterson" project will have an input port lis­ten­ing to "Bus 2", accept­ing all mes­sages and trans­mit­ting at least NoteOn/Noteoff.

Another solu­tion is to set up anoth­er out­put port on the "-da.tryStopContinue" project, that sends all data to "Bus 1". The out­put to "Bus 2" will only send the Stop and Continue mes­sages. The input port lis­ten­ing to "Bus 2" on the Oscar Peterson project will only accept Stop and Continue, and not trans­mit anything.

👉  It is a good prac­tice to use the fil­ters for restric­tion of mes­sage man­age­ment to the nec­es­sary tasks.

Now, play the Oscar Peterson per­for­mance, and at any point start "-da.tryStopContinue". The per­for­mance will pause and you will hear the exter­nal musi­cal phrase. The per­for­mance will then resume. You can, of course, do this sev­er­al times and insert any vari­ety of musi­cal frag­ments. For example:

Beginning of Oscar Peterson's "Watch What Happens" with two interruptions

List of scripts for dealing with real-time MIDI

The list below will be kept up to date as there are many scripts on the agen­da. These instruc­tions are not case-sensitive.

Input scripts

When a note is spec­i­fied, be sure to use the same note con­ven­tion as in the project, e.g. C3 or do2 or sa3, etc.

Wait for note chan­nel cWait for a NoteOn of the spec­i­fied note on chan­nel c (1…16)
Wait for StartWait for a Start MIDI mes­sage (250)
Wait for ContinueWait for a Continue MIDI mes­sage (251)
Wait for StopWait for a Stop MIDI mes­sage (252)
Wait for­ev­erWait until STOP or PANIC but­ton is clicked
Velocity param Kx = note chan­nel cSet para­me­ter Kx (0 < x < 128) to the veloc­i­ty (range 0…127) of the spe­cif­ic note on chan­nel c (1…16)
Control param Kx = #y chan­nel cSet para­me­ter Kx (0 < x < 128) to the val­ue (range 0…127) of MIDI con­troller #y (0 < y < 128) on chan­nel c (1…16)

Output scripts

Hold for x millisecondsDelay all sub­se­quent events by the spec­i­fied dura­tion x (inte­ger).
Send StartSend Start MIDI mes­sage (250)
Send ContinueSend Continue MIDI mes­sage (251)
Send StopSend Stop MIDI mes­sage (252)

Scripts on top of a grammar

(To be continued)

Capture incoming events

The _capture() com­mand allows incom­ing MIDI events to be record­ed to a 'cap­ture' text file. See the Capture MIDI input page for explanations.

Alternatives to IAC

Here are the equiv­a­lents of Apple's IAC (Inter-Application Communication) for each system:

Windows environment

On Windows, you can use soft­ware like loopMIDI or virtualMIDISynth to cre­ate vir­tu­al MIDI ports. These tools work sim­i­lar­ly to the IAC Driver on macOS:

  • loopMIDI: Created by Tobias Erichsen, loopMIDI is a pop­u­lar choice for cre­at­ing vir­tu­al MIDI ports on Windows. It allows you to cre­ate and man­age sev­er­al vir­tu­al ports which can be used by appli­ca­tions to com­mu­ni­cate with each other. 
  • virtualMIDISynth: This is anoth­er tool that can be used to cre­ate a MIDI syn­the­siz­er device which can be accessed via a vir­tu­al MIDI cable. 

These tools inte­grate with soft­ware appli­ca­tions that sup­port MIDI, pro­vid­ing a seam­less way to con­nect var­i­ous MIDI appli­ca­tions with­out need­ing exter­nal MIDI hardware.

Linux environment

On Linux, ALSA (Advanced Linux Sound Architecture) pro­vides capa­bil­i­ties to cre­ate vir­tu­al MIDI devices through its sequenc­ing API.

  • snd-virmidi: This ALSA MIDI dri­ver pro­vides vir­tu­al MIDI ports for send­ing and receiv­ing MIDI between appli­ca­tions run­ning on the same sys­tem. It's part of the stan­dard ALSA mod­ule set and can be con­fig­ured to pro­vide mul­ti­ple ports.

To set up vir­tu­al MIDI ports on Linux using ALSA, you typ­i­cal­ly need to load the snd-virmidi mod­ule. You can do this by running:

sudo modprobe snd-virmidi midi_devs=2

This com­mand loads the snd-virmidi mod­ule and sets it up to pro­vide two vir­tu­al MIDI devices (you can increase the num­ber of devices by chang­ing the midi_devs para­me­ter). The vir­tu­al ports, name­ly 'VirMIDI 0-0' and 'VirMIDI 0-1' , can then be accessed by MIDI appli­ca­tions on the Linux sys­tem. Please note that they do not appear to trans­mit the Start, Stop and Continue messages.

👉 This is done auto­mat­i­cal­ly by the "install_bp3.sh" shell script installing BP3 on Linux/Ubuntu (down­load here).

Bernard Bel
June-December 2024

Install MinGW

👉   An ear­li­er ver­sion of this page rec­om­mend­ed w64devkit. This was a wrong choice, as its down­load­able files are sig­nalled with virus­es or mali­cious code.

Look at the warn­ing dis­played at the top right of any page of the Bol Processor. In the Windows envi­ron­ment you can read:

Top right warn­ing in Windows envi­ron­ment indi­cat­ing that a 'gcc' instal­la­tion is required.

The instal­la­tion of MinGW will allow "gcc" to run on a Windows machine. This may not be nec­es­sary if it has already been installed by anoth­er appli­ca­tion. In this case, there will be no such warn­ing at the top right of Bol Processor pages:

Clicking on the "run the com­pil­er" link will cre­ate the "bp.exe" con­sole. After reload­ing the page you are ready to use BP3:

👉  The PANIC but­ton is used to get silence when you are run­ning more than one instance of BP3.

Download MinGW-w64:

Install MinGW-w64:

  • Open the MinGW file with 7-Zip, telling it to extract files and store them to a fold­er, by default "x86_64-13.2.0-release-win32-seh-ucrt-rt_v11-rev0" in your Downloads folder.
  • Save the path to this fold­er in a text file, for instance (if the user is named "berna"):
    C:\Users\berna\Downloads\x86_64-13.2.0-release-win32-seh-ucrt-rt_v11-rev0\mingw64
  • 👉  For geeks and expert Windows users: It is not good prac­tice to keep exe­cutable files in the Downloads fold­er, as they may be delet­ed when opti­mis­ing disk space. You should move them to a suit­able loca­tion like oth­er appli­ca­tions. I keep the Downloads loca­tion for the demo.

Set up the Environment Path:

  • Right-click on 'This PC' or 'Computer' on the desk­top or in File Explorer, and select 'Properties'.
  • Click on 'Advanced system settings' and then 'Environment Variables'.
  • In the System Variables sec­tion, find and select the vari­able 'Path', then click on 'Edit'.
  • Click on 'New' and add the path to the direc­to­ry 'bin' of your MinGW-w64 instal­la­tion, such as "C:\Users\berna\Downloads\x86_64-13.2.0-release-win32-seh-ucrt-rt_v11-rev0\mingw64\bin" if you haven't changed the location.
  • Click 'OK' to close all dialogues.

Verify Installation:

  • 👉   The BP3 inter­face does this ver­i­fi­ca­tion auto­mat­i­cal­ly. If ‘gcc’ responds you will be offered to (re)compile the con­sole. The fol­low­ing instruc­tions are for an addi­tion­al check.
  • Open Command Prompt (cmd.exe) and type:
    cd C:\MinGW\bin
    gcc --version
  • The first com­mand opens a Unix "shell". The sec­ond com­mand should out­put the GCC ver­sion installed and include 'x86_64', indi­cat­ing it's set up for 64-bit.
    Ignore the win32 seg­ments you see in file and fold­er names. They are there to con­fuse you!

Additional Tips

  • Choosing a Shell: MinGW-w64 works with stan­dard Windows com­mand prompt and also with more Unix-like ter­mi­nals like Git Bash or Cygwin if those are already installed.
  • Using Make: To use 'make' with MinGW-w64, make sure that pack­age 'mingw32-make' is select­ed dur­ing instal­la­tion. It might be named dif­fer­ent­ly like 'mingw-w64-make' based on the ver­sion. You might need to rename 'mingw32-make.exe' to 'make.exe' in the bin direc­to­ry to make it rec­og­niz­able as 'make'.

By fol­low­ing these steps, you should be well-equipped to com­pile 64-bit appli­ca­tions — not only BP3 — using GCC on Windows via MinGW-w64. This set­up is use­ful for devel­op­ers who need a light­weight GCC envi­ron­ment with­out need­ing a full Linux set­up or the bulk of Visual Studio.

Publications

These pub­li­ca­tions explain the the­o­ret­i­cal basis and research behind the Bol Processor project through­out its long life­time. They also high­light the algo­rith­mic foun­da­tions of the soft­ware design, par­tic­u­lar­ly with regard to the poly­met­ric mod­el and the time-setting of sound objects.

👉 Follow the links to access pages con­tain­ing abstracts and infor­ma­tive AI reviews.

Bol Processor

Kippen, James & Bernard Bel (1989)
https://hal.science/hal-00275429v1
Can a com­put­er help resolve the prob­lem of ethno­graph­ic descrip­tion?
Anthropological Quarterly, 62 (3): 131-144.

Bel, Bernard (1990)
https://doi.org/10.1080/09298219008570560
Time and musi­cal struc­tures
Interface, 19 (2-3): 107-135.

Bel, Bernard (1990)
https://theses.hal.science/tel-00009692
Acquisition et représen­ta­tion de con­nais­sances en musique
(Knowledge acqui­si­tion and rep­re­sen­ta­tion in music)
Thèse de doc­tor­at en sci­ences. Université de droit, d'économie et des sci­ences - Aix-Marseille III.

Kippen, James & Bernard Bel (1992)
https://hal.science/halshs-00004506v1
Modelling music with gram­mars: for­mal lan­guage rep­re­sen­ta­tion in the Bol Processor.
In A. Marsden & A. Pople (eds.) Computer Representations and Models in Music, London, Academic Press, 1992: 207-238.

Kippen, James & Bernard Bel (1992)
https://hal.science/hal-00256386v1
Bol Processor Grammars
In Mira Balaban, Otto Laske et Kemal Ebcioglu (eds.) Understanding Music with AI, American Association for Artificial Intelligence Press, Menlo Park CA: 366-400.

Kippen, James & Bernard Bel (1992)
https://dl.acm.org/doi/10.5555/133905.133909
Symbolic and son­ic rep­re­sen­ta­tions of sound-object struc­tures
In Mira Balaban, Otto Laske et Kemal Ebcioglu (eds.) Understanding Music with AI, American Association for Artificial Intelligence Press, Menlo Park CA: 64-110.
Extended ver­sion: Two algo­rithms for the instan­ti­a­tion of struc­tures of musi­cal objects

Kippen, James & Bernard Bel (1992)
https://hal.science/hal-00256385v1
Modelling impro­visato­ry and com­po­si­tion­al process­es
In Denise Penrose & Ray Lauzanna (eds.) Languages of Design, 1. Elsevier Science Publishers, Amsterdam: 11-26.

Bel, Bernard (1992)
Time-setting of sound-objects: a constraint-satisfaction approach
International Workshop on Sonic Representation and Transform, Trieste (Italy), 26-30 October.

Bel, Bernard (1998)
https://hal.science/hal-00250274
Migrating Musical Concepts - an overview of the Bol Processor
Computer Music Journal, Vol. 22, 2: 56-64.

Bel, Bernard (2001)
https://hal.science/hal-00134179v1
Rationalizing musi­cal time: syn­tac­tic and symbolic-numeric approach­es
In Clarence Barlow, (ed.) The Ratio Book. Den Haag: Royal Conservatory - Institute of Sonology: 86-101.

QAVAID

Kippen, James & Bernard Bel (1989)
https://hal.science/halshs-00004505
The iden­ti­fi­ca­tion and mod­el­ling of a per­cus­sion ‘lan­guage', and the Emergence of Musical Concepts in a machine-learning exper­i­men­tal set-up
Computers and the Humanities, 23 (3): 119-214.

Bel, Bernard (1990)
https://hal.science/hal-00275789v2
Inférence de lan­gages réguliers
👉  Follow link to read an abstract and review in English
Journées Françaises de l'Apprentissage, Lannion, France : 5-27.

MUSICOLOGY

Arnold, E. James (1982)
A Mathematical Model of the Shruti-Swara-Grama-Murcchana-Jati System
Journal of the Sangit Natak Akademi, New Delhi 1982.

Bel, Bernard (1988)
A Mathematical Discussion of the Ancient Theory of Scales accord­ing to Natyashastra
Note interne, Groupe Représentation et Traitement des Connaissances (CNRS), Marseille.

Bel, Bernard (1988)
https://hal.science/hal-00008280v1
Raga : approches con­ceptuelles et expéri­men­tales
Actes du col­loque "Structures Musicales et Assistance Informatique". Marseille.
👉  Download an English translation

Arnold, James (1985)
https://hal.archives-ouvertes.fr/hal-00373725
L'intonation juste dans la théorie anci­enne de l'Inde : ses appli­ca­tions aux musiques modale et har­monique
Revue de musi­colo­gie, JSTOR, 71e (1-2), p.11-38.
👉  Download an English translation

Modelling music with grammars

James Kippen & Bernard Bel

Modelling music with gram­mars: for­mal lan­guage rep­re­sen­ta­tion in the Bol Processor. In A. Marsden & A. Pople (eds.): Computer Representations and Models in Music, London, Academic Press, 1992, p. 207-238.

Abstract

Improvisation in North Indian tabla drum­ming is sim­i­lar to speech inso­far as it is bound to anun­der­ly­ing sys­tem of rules deter­min­ing cor­rect sequences. The par­al­lel is fur­ther rein­forced by the fact that tabla music may be rep­re­sent­ed with an oral nota­tion sys­tem used for its trans­mis­sion and, occa­sion­al­ly, per­for­mance. Yet the rules are implic­it and avail­able only through the musi­cians’ abil­i­ty to play cor­rect sequences and recog­nise incor­rect ones. A lin­guis­tic mod­el of tabla impro­vi­sa­tion and eval­u­a­tion derived from pat­tern lan­guages and for­mal gram­mars has been imple­ment­ed in the Bol Processor, a soft­ware sys­tem used in inter­ac­tive field­work with expert musi­cians. The paper demon­strates the abil­i­ty of the mod­el to han­dle com­plex struc­tures by tak­ing real exam­ples from the reper­toire. It also ques­tions the rel­e­vance of attempt­ing to mod­el irreg­u­lar­i­ties encoun­tered in actu­al performance.

Excerpts of an AI review of this paper (Academia, June 2025)

Summary of the Work

The man­u­script explores the use of for­mal gram­mar the­o­ries to mod­el impro­vi­sa­tion­al struc­tures in North Indian tabla drum­ming. Drawing an anal­o­gy to lan­guage, the authors dis­cuss how grammar-based rep­re­sen­ta­tions can cap­ture the rhythm, struc­ture, and con­straints of tabla musi­cal sequences, which often rely on mnemon­ic syl­la­bles (“bols”) rather than Western script. By intro­duc­ing and detail­ing the Bol Processor soft­ware, the authors demon­strate how the tool can gen­er­ate, ana­lyze, and com­pare tabla phras­es in ways that blend both deter­min­is­tic and prob­a­bilis­tic approach­es. Throughout the work, real-world exam­ples from per­for­mances and teach­ing tra­di­tions bol­ster the the­o­ret­i­cal explanations.

Strengths

Clear Theoretical Rationale

The authors pro­vide a thor­ough back­ground for why lin­guis­tic concepts—particularly gram­mat­i­cal formalisms—are suit­able for ana­lyz­ing tabla com­po­si­tions. They effec­tive­ly frame the sim­i­lar­i­ties between lan­guage rules and musi­cal rules, espe­cial­ly regard­ing how musi­cians dif­fer­en­ti­ate “cor­rect” from “incor­rect” sequences.

Comprehensive Treatment of Formal Grammars

The dis­cus­sion includes mul­ti­ple types of gram­mars (context-free, context-sensitive, mark­ing of struc­tur­al posi­tions, and pat­tern gram­mars) and shows how each can be adapt­ed or extend­ed to cap­ture nuances of tabla music. The step-by-step expla­na­tions of gram­mar deriva­tions, con­texts, pars­ing, and mem­ber­ship tests are detailed and instructive.

Practical Demonstration via the Bol Processor

By anchor­ing the dis­cus­sion in a work­ing piece of soft­ware, the man­u­script tran­scends the­o­ry and illus­trates prac­ti­cal method­ol­o­gy. Concrete exam­ples of how the Bol Processor is used—both in gen­er­a­tion (modus ponens) and mem­ber­ship checks—highlight the val­ue of the tool for eth­no­mu­si­co­log­i­cal field­work and analysis.

Engagement with Complex Musical Realities

The man­u­script acknowl­edges that musi­cal per­for­mance often devi­ates from neat­ly defined the­o­ret­i­cal mod­els. The authors address how irreg­u­lar­i­ties and “mav­er­ick” vari­a­tions might still be cap­tured or rec­on­ciled with­in the for­mal frame­work, although at the cost of increas­ing­ly com­plex grammars.

Probabilistic Extension

The move from pure­ly deter­min­is­tic gram­mars toward prob­a­bilis­tic gram­mars is a notable con­tri­bu­tion, espe­cial­ly giv­en impro­vi­sa­tion­al con­texts. Assigning weights to pro­duc­tion rules cap­tures more real­is­tic musi­cal sce­nar­ios, enabling the soft­ware to sug­gest typ­i­cal (rather than mere­ly pos­si­ble) musi­cal phrases.

Overall Assessment

The man­u­script pro­vides a robust, method­olog­i­cal­ly sound illus­tra­tion of how for­mal gram­mars can be adapt­ed to mod­el and ana­lyze the com­plex world of North Indian tabla impro­vi­sa­tion. Its detailed explo­ration of gram­mar types and pars­ing approach­es is com­mend­able and is sup­port­ed by real-world musi­cal exam­ples that demon­strate both the poten­tials and the evolv­ing nature of such com­pu­ta­tion­al mod­els. The Bol Processor, as pre­sent­ed, appears to be a valu­able con­tri­bu­tion not only for eth­no­mu­si­col­o­gists and com­pu­ta­tion­al musi­col­o­gists but also for any schol­ar inter­est­ed in struc­tur­al approach­es to musi­cal impro­vi­sa­tion. The incor­po­ra­tion of prob­a­bilis­tic rea­son­ing fur­ther deep­ens the system’s applic­a­bil­i­ty to performance-based con­text and high­lights how for­mal lan­guage mod­els can be refined through inter­ac­tive feed­back with expert practitioners.

Download this paper

Pattern grammars

Bernard Bel

Pattern gram­mars in for­mal rep­re­sen­ta­tions of musi­cal struc­tures. 11th International Joint Conference on Artificial Intelligence, Workshop on AI & Music, 20 August 1989, p.113-42

Abstract

This paper intro­duces sev­er­al for­mal mod­els of pat­tern rep­re­sen­ta­tion in music. Polyvalent mul­ti­modal gram­mars describe par­tial­ly over­lap­ping sound events as found in poly­phon­ic struc­tures. Bol Processor gram­mars are char­ac­ter­i­sa­tions of sequen­tial events in terms of sub­string rep­e­ti­tions, homo­mor­phisms, etc. Parsing tech­niques, sto­chas­tic pro­duc­tion and recent devel­op­ments of BP gram­mars are briefly described.

Excerpts of an AI review of this paper (June 2025)

Summary

This paper presents a thor­ough explo­ration of pat­tern gram­mars and their applic­a­bil­i­ty to musi­cal struc­tures, specif­i­cal­ly focus­ing on poly­phon­ic and homo­phon­ic aspects. It intro­duces Polymodal Multivalent Grammars (PMGs), demon­strates how tem­po­ral and struc­tur­al rela­tion­ships in music can be mod­eled using a lat­tice of time rela­tions, and draws par­al­lels with for­mal lan­guage the­o­ry. The dis­cus­sion also extends to Bol Processor (BP) gram­mars, offer­ing insights into pat­tern rules, mem­ber­ship tests, and sto­chas­tic pro­duc­tion for music gen­er­a­tion and analy­sis. The work’s illus­tra­tions, which delve into North Indian tabla sequences and Western musi­cal exam­ples (notably Bach), add con­crete demon­stra­tions of how these gram­mars can cap­ture and repli­cate real-world musi­cal practices.

Major Strengths

Methodological Clarity and Formal Rigor

  • The paper pro­vides a clear for­mal frame­work for under­stand­ing music as an algo­rith­mic process. This is exem­pli­fied by pre­cise def­i­n­i­tions of pat­tern gram­mars, rewrit­ing rules, and homomorphisms.
  • The use of math­e­mat­i­cal nota­tion (e.g., par­tial orders, lat­tices, homo­mor­phisms) lends a rig­or­ous back­ing to the arguments.

Comprehensive Treatment of Time Overlaps

  • The con­cep­tu­al sep­a­ra­tion of out-time and in-time struc­tures, and the ensu­ing treat­ment of 13 dis­tinct pos­si­ble tem­po­ral rela­tions, is notable. This approach tack­les many of the com­plex­i­ties found in poly­phon­ic and par­tial­ly over­lap­ping musi­cal events.

Insightful Practical Applications

  • Educating read­ers on how gram­mars can be used for music com­po­si­tion, impro­visato­ry mod­el­ing, and per­for­mance prac­tice is high­ly valuable.
  • The exam­ples of North Indian tabla reper­toires and Bach’s poly­phon­ic com­po­si­tions con­crete­ly illus­trate the poten­tial breadth of these models.

Contribution to Epistemological and Analytical Discourse

  • By address­ing exist­ing debates (e.g., par­al­lels with lin­guis­tic the­o­ry, eth­no­mu­si­co­log­i­cal crit­i­cisms, and gen­er­a­tive approach­es), the paper bridges a gap between tra­di­tion­al ana­lyt­i­cal meth­ods and com­pu­ta­tion­al modeling.

General Comments

This work makes a sol­id the­o­ret­i­cal con­tri­bu­tion by bring­ing togeth­er for­mal lan­guage the­o­ry and con­cise exam­ples of musi­cal struc­tures. It is equal­ly rel­e­vant to researchers in com­pu­ta­tion­al musi­col­o­gy, eth­no­mu­si­col­o­gy, and music the­o­ry. The paper may also be of broad­er inter­est to any­one study­ing the inter­sec­tion of arti­fi­cial intel­li­gence and cre­ative process­es. Overall, its strengths lie in its the­o­ret­i­cal depth, its range of illus­tra­tive appli­ca­tions, and its attempts to uni­fy diverse per­spec­tives under a sin­gle for­mal mod­el­ing frame­work for musi­cal representation.

Download this paper

Time-setting of sound-objects

Bernard Bel

Time-setting of sound-objects: a constraint-satisfaction approach. Invited paper, Workshop on Sonic Representations and Transforms. INTERNATIONAL SCHOOL FOR ADVANCED STUDIES (ISAS), Trieste, 26-30 October 1992.

Abstract

This paper deals with the sched­ul­ing of “sound-objects”, here­by mean­ing pre­de­fined sequences of ele­men­tary tasks in a sound proces­sor, with each task mapped to a time-point. Given a struc­ture of sound-objects com­plete­ly ordered in a phase dia­gram, an “instance” of the struc­ture may be obtained by com­put­ing the dates at which each task should be exe­cut­ed. Time-setting the struc­ture amounts to solv­ing a sys­tem of con­straints depend­ing on (1) met­ric and topo­log­i­cal prop­er­ties of sound-objects, (2) con­texts in which they are found, and (3) para­me­ters relat­ed to the per­for­mance itself (“smooth” or “stri­at­ed” time, speed, etc.). This may require relocating/truncating objects or delay­ing part of the sound-object struc­ture. A constraint-satisfaction algo­rithm is intro­duced, the time com­plex­i­ty of which is O(n.k) in most cas­es, where n is the num­ber of sequences and k the max­i­mum length of a sequence. In the worst case it remains bet­ter than O(n2.k3). Other fields of appli­ca­tions are pro­posed, includ­ing mul­ti­me­dia per­for­mance and computer-aided video editing.

Excerpts of an AI review of this paper (Academia, June 2025)

Summary of the Work

The man­u­script details a com­pu­ta­tion­al approach to the sched­ul­ing and instan­ti­a­tion of “sound-objects,” which are defined as sequences of ele­men­tary tasks in a sound proces­sor. The crux of the work is an algo­rithm that solves a sys­tem of con­straints aris­ing from topo­log­i­cal and met­ri­cal prop­er­ties of these sound-objects, as well as from con­tex­tu­al per­for­mance para­me­ters. The algo­rithm bal­ances local changes (relo­ca­tion and trun­ca­tion of objects) against glob­al shifts (delays) to ensure that all con­straints with­in sequences of sound-objects are met. In addi­tion to musi­cal appli­ca­tions, such an approach could be extend­ed to oth­er time-based media, includ­ing mul­ti­me­dia sce­nar­ios and video editing.

Core Contributions

Explicit Discussion of Time and Constraints

  • The paper frames time not just as a uni­ver­sal met­ric but as a struc­ture of dis­crete “time streaks” or beats. In this sense, the work bridges for­mal rep­re­sen­ta­tions of time (from dis­crete puls­es to “smooth” con­tin­u­ous flow) with performance-related constraints.
  • The for­mu­la­tion of con­straints (e.g., over­lap­ping or dis­joint objects) is sys­tem­at­i­cal­ly addressed through defin­able prop­er­ties (e.g., overBeg, overEnd, truncBeg, truncEnd), which are then used in a constraint-satisfaction process.

Algorithmic Design and Complexity Analysis

  • The step-by-step “Locate()” func­tion is well described with a clear flow­chart, detail­ing how the algo­rithm attempts cor­rec­tions through local or glob­al drifts, as well as par­tial trun­ca­tions of the sound-objects.
  • A worst-case time com­plex­i­ty of O(n²·i³) (under cer­tain con­di­tions) is estab­lished, yet it often per­forms more effi­cient­ly, show­ing that this method is viable for real-world musi­cal and mul­ti­me­dia applications.

Applicability to Broader Contexts

While the exam­ples focus pri­mar­i­ly on musi­cal objects, the paper rec­og­nizes poten­tial appli­ca­tions in any set­ting where time-based data need to be sched­uled, such as multiple-screen video edit­ing or live mul­ti­me­dia per­for­mances. This gen­er­al­iz­able frame­work under­scores the ver­sa­til­i­ty of the approach.

Strengths

  • Comprehensive Motivations: The work demon­strates a sol­id under­stand­ing of music com­po­si­tion needs and how strict time-based approach­es can ben­e­fit from greater flexibility.
  • Thorough Explanations: The back­ground and ratio­nale for each com­po­nent of the constraint-satisfaction process are well artic­u­lat­ed, guid­ing read­ers step-by-step.
  • Foundational for Further Development: The text pro­vides ample con­cep­tu­al and algo­rith­mic foun­da­tions for more advanced tim­ing algo­rithms, poten­tial­ly inspir­ing oth­er constraint-based sched­ul­ing research in music and mul­ti­me­dia domains.

Overall, the paper pro­vides a struc­tured and flex­i­ble method for rep­re­sent­ing and manip­u­lat­ing time-synchronized objects, show­ing promise not only for music com­po­si­tion but also for a wide vari­ety of mul­ti­me­dia appli­ca­tions requir­ing coor­di­nat­ed play­back and sequenc­ing. The detail in con­straint cod­i­fi­ca­tion, strate­gies for local and glob­al cor­rec­tions, and empha­sis on com­pu­ta­tion­al com­plex­i­ty will be par­tic­u­lar­ly valu­able to those work­ing with large-scale or com­plex per­for­mance setups.

Download this paper

The Well-tempered Clavier

   

Below is the com­plete set of Preludes and Fugues by J.S. Bach known as The Well-Tempered Clavier, Books II and II, pub­lished around 1722 and 1742 respectively.

What was the composer's inten­tion when he used the term "well tempered"?

All the scores in this cor­pus have been con­vert­ed from MusicXML to Bol Processor syn­tax — see Importing MusicXML scores. This paved the way for tonal analy­sis using Bol Processor's tonal batch pro­cess­ing tool, described in detail on the Bach Well-tempered tonal analy­sis page.

Each musi­cal work has been com­pared with a set of tun­ing schemes imple­ment­ed on the Bol Processor. These include tem­pera­ments doc­u­ment­ed by Pierre-Yves Asselin ([1985], 2000) and "nat­ur­al" scales sys­tem­at­i­cal­ly con­struct­ed — see pages Microtonality and Creation of just-intonation scales.

The match­ing algo­rithm select­ed the tun­ing scheme(s) that best matched the def­i­n­i­tions of 'con­so­nant' and 'dis­so­nant' melod­ic and har­mon­ic inter­vals. Two sets of def­i­n­i­tions were used: "stan­dard" and " alter­na­tive". Obviously, under any hypoth­e­sis, some tun­ing schemes are more suit­able than oth­ers for achiev­ing the composer's pre­sumed per­cep­tion of 'con­so­nance'. Therefore, the fol­low­ing sound pro­duc­tions of the Preludes and Fugues, with their "best" tun­ing schemes, should not be tak­en as a defin­i­tive answer to the ques­tion of tem­pera­ment dis­cussed by Bach's stu­dents and fol­low­ers. They may, how­ev­er, come clos­est to what the com­pos­er intend­ed, with­in the lim­its of the ear's abil­i­ty to dis­crim­i­nate between intervals.

Note that if sev­er­al tun­ing schemes ranked first for match­ing a piece, only one of them was used for the demo. It is pos­si­ble that anoth­er may sound better.

Settings of an audio unit for the post-processing

All the pieces were played and record­ed on a Csound instru­ment, sim­i­lar to a harp­si­chord, allow­ing a clear appre­ci­a­tion of the tonal inter­vals. This kind of "mag­ni­fy­ing glass" view of the tonal inter­vals pro­duced harsh sound­ing ver­sions, avail­able in the Standard (raw) and Alternate (raw) fold­ers. These have been post-processed with a bit of reverb to pro­duce soft­er attacks. The post-processed sound files are the ones accessed in the tables below. Readers famil­iar with sound edit­ing are invit­ed to down­load the raw files and sug­gest bet­ter post-processing options.

The last two columns of each table con­tain record­ings of human inter­pre­ta­tions of the same works by out­stand­ing harp­si­chordists. These explore dimen­sions of musi­cal­i­ty that the mechan­i­cal inter­pre­ta­tion of the score with per­fect tonal inter­vals could not reach. It remains that the chal­lenge of accu­rate tonal­i­ty was a pri­or­i­ty for this cor­pus, as evi­denced by the title "well-tempered" giv­en by its composer.

Book I sound examples

These Bol Processor + Csound record­ings may be reused under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) licence. Attribution includes links to the present page, to Csound and to the author/editor of its MusicXML score (list­ed on the Bach Well-tempered tonal analy­sis page).

Listen with head­phones or a very good sound system!

The record­ings of Wanda Landowska's (1879-1959) are from YouTube. Other inter­pre­ta­tions are cour­tesy of Wikimedia Commons.

As explained on the Bach Well-tempered tonal analy­sis page, the D'Alambert-Rousseau tem­pera­ment was found to be equiv­a­lent to H.A. Kellner's BACH in terms of scale intervals.

Standard
(favourite: Sauveur)
Alternate
(favourite: D'Alembert-Rousseau)
Humanper­for­mance   
KeyPreludeFuguePreludeFuguePreludeFugue
1BWV 846CmajSauveurSauveurRameau en sibMarpurgMartha GoldsteinMartha Goldstein
2BWV 847CminSauveurSauveurD'Alambert-RousseauD'Alambert-RousseauWanda LandowskaMartha Goldstein
3BWV 848C#majAbmajZarlino nat­ur­alD'Alambert-RousseauD'Alambert-RousseauWanda LandowskaWanda Landowska
4BWV 849C#minWerckmeister 4Werckmeister 4CminCminWanda LandowskaWanda Landowska
5BWV 850DmajSauveurSauveurD'Alambert-RousseauRameau en doMartha GoldsteinMartha Goldstein
6BWV 851DminSauveurSauveurD'Alambert-RousseauD'Alambert-RousseauMartha GoldsteinMartha Goldstein
7BWV 852E♭majRameau en sibRameau en sibRameau en sibD'Alambert-RousseauWanda LandowskaWanda Landowska
8BWV 853E♭min/D#minEbminMarpurgEbminDminWanda LandowskaWanda Landowska
9BWV 854EmajSauveurWerckmeister 4EmajD'Alambert-RousseauWanda LandowskaWanda Landowska
10BWV 855EminSauveurSauveurD'Alambert-RousseauD'Alambert-RousseauWanda LandowskaWanda Landowska
11BWV 856FmajSauveurSauveurD'Alambert-RousseauD'Alambert-RousseauWanda LandowskaWanda Landowska
12BWV 857FminZarlino nat­ur­alSauveurD'Alambert-RousseauD'Alambert-RousseauWanda LandowskaWanda Landowska
13BWV 858F#majMarpurgF#majD'Alambert-RousseauD'Alambert-RousseauWanda LandowskaWanda Landowska
14BWV 859F#minSauveurSauveurFminD'Alambert-RousseauWanda LandowskaWanda Landowska
15BWV 860GmajSauveurSauveurD'Alambert-RousseauD'Alambert-RousseauWanda LandowskaWanda Landowska
16BWV 861GminSauveurSauveurRameau en sibRameau en sibWanda LandowskaWanda Landowska
17BWV 862A♭majAbmajZarlino nat­ur­alD'Alambert-RousseauD'Alambert-RousseauWanda LandowskaWanda Landowska
18BWV 863G#minGminAbminGminDminWanda LandowskaWanda Landowska
19BWV 864AmajSauveurSauveurD'Alambert-RousseauD'Alambert-RousseauWanda LandowskaWanda Landowska
20BWV 865AminSauveurSauveurD'Alambert-RousseauD'Alambert-RousseauWanda LandowskaWanda Landowska
21BWV 866B♭majSauveurSauveurRameau en sibMarpurgMartha GoldsteinWanda Landowska
22BWV 867B♭minSauveurMarpurgAminAminWanda LandowskaWanda Landowska
23BWV 868BmajBmajMarpurgD'Alambert-RousseauEbmajWanda LandowskaWanda Landowska
24BWV 869BminSauveurSauveurD'Alambert-RousseauD'Alambert-RousseauWanda LandowskaWanda Landowska
➡ Click a scale or a performer's name to lis­ten to the recording

Book II sound examples

The record­ings of Ottavio Dantone are from YouTube.

As explained above, D'Alambert-Rousseau tem­pera­ment was found to be equiv­a­lent to H.A. Kellner's BACH.

Standard
(favourite: Sauveur)
Alternate
(favourite: D'Alembert-Rousseau)
Humanper­for­mance 
KeyPreludeFuguePreludeFuguePreludeFugue
1BWV 870CmajSauveurSauveurMarpurgD'Alambert-RousseauOttavio DantoneOttavio Dantone
2BWV 871CminRameau en sibSauveurD'Alambert-RousseauD'Alambert-RousseauOttavio DantoneOttavio Dantone
3BWV 872C#majMarpurgDbmajD'Alambert-RousseauD'Alambert-RousseauOttavio DantoneOttavio Dantone
4BWV 873C#minSauveurWerckmeister 4D'Alambert-RousseauD'Alambert-RousseauOttavio DantoneOttavio Dantone
5BWV 874DmajSauveurSauveurD'Alambert-RousseauD'Alambert-RousseauOttavio DantoneOttavio Dantone
6BWV 875DminSauveurSauveurD'Alambert-RousseauD'Alambert-RousseauOttavio DantoneOttavio Dantone
7BWV 876E♭majRameau en sibRameau en sibRameau en sibRameau en sibOttavio DantoneOttavio Dantone
8BWV 877D#minMarpurgMarpurgD'Alambert-RousseauDminOttavio DantoneOttavio Dantone
9BWV 878EmajSauveurWerckmeister 4Werckmeister 4Werckmeister 4Ottavio DantoneOttavio Dantone
10BWV 879EminSauveurSauveurD'Alambert-RousseauD'Alambert-RousseauOttavio DantoneOttavio Dantone
11BWV 880FmajSauveurSauveurMarpurgD'Alambert-RousseauOttavio DantoneOttavio Dantone
12BWV 881FminZarlino nat­ur­alZarlino nat­ur­alD'Alambert-RousseauD'Alambert-RousseauOttavio DantoneOttavio Dantone
13BWV 882F#majF#majBmajD'Alambert-RousseauD'Alambert-RousseauOttavio DantoneOttavio Dantone
14BWV 883F#minSauveurSauveurD'Alambert-RousseauD'Alambert-RousseauOttavio DantoneOttavio Dantone
15BWV 884GmajSauveurSauveurD'Alambert-RousseauD'Alambert-RousseauOttavio DantoneOttavio Dantone
16BWV 885GminSauveurSauveurRameau en sibD'Alambert-RousseauOttavio DantoneOttavio Dantone
17BWV 886A♭majZarlino nat­ur­alAbmajD'Alambert-RousseauD'Alambert-RousseauOttavio DantoneOttavio Dantone
18BWV 887G#minAbminAbminD'Alambert-RousseauD'Alambert-RousseauOttavio DantoneOttavio Dantone
19BWV 888AmajSauveurSauveurRameau en doD'Alambert-RousseauOttavio DantoneOttavio Dantone
20BWV 889AminSauveurSauveurD'Alambert-RousseauD'Alambert-RousseauOttavio DantoneOttavio Dantone
21BWV 890B♭majSauveurSauveurMarpurgMarpurgOttavio DantoneOttavio Dantone
22BWV 891B♭minBbminMarpurgAminAminOttavio DantoneOttavio Dantone
23BWV 892BmajBmajBmajD'Alambert-RousseauD'Alambert-RousseauOttavio DantoneOttavio Dantone
24BWV 893BminSauveurSauveurD'Alambert-RousseauBbminOttavio DantoneOttavio Dantone
➡ Click a scale or a performer's name to lis­ten to the recording

More examples?

Interestingly, sim­i­lar clas­si­fi­ca­tions of tun­ing sys­tems apply to anoth­er famous cor­pus by J.S. Bach: the Goldberg Variations (1741). Read the Bach well-tempered tonal analy­sis page.

Listen to the syn­the­sis of Goldberg Variations with Sauveur's mean­tone tem­pera­ment.
Listen to the syn­the­sis of Goldberg Variations with D'Alembert-Rousseau tem­pera­ment.
Listen to the Aria on a harp­si­chord tuned with Werckmeister III mean­tone temperament.

In the same peri­od (1730), the French musi­cian François Couperin com­posed Les Ombres Errantes, for which our tonal analy­sis sug­gests a Rameau en sib temperament:

François Couperin's “Les Ombres Errantes” inter­pret­ed by the Bol Processor + Csound
with a “Rameau en sib” tem­pera­ment ➡ Image
Source: MusicXML score by Vinckenbosch in the MuseScore com­mu­ni­ty

Conclusive remarks

The title of this cor­pus, The Well-Tempered Clavier, sug­gests that its com­pos­er intend­ed to demon­strate the suit­abil­i­ty of one or more tem­pera­ments for the per­for­mance of musi­cal works in any tonal­i­ty. As pre­vi­ous­ly stat­ed, this does not imply that they were all intend­ed to con­form to the same unique solu­tion; how­ev­er, it is tempt­ing to hypoth­e­size that the same instru­ment and tun­ing scheme were uti­lized for the entire­ty of the set. This has led to spec­u­la­tion by J.S. Bach's pupils, who were not instruct­ed on how to pro­ceed. Part of the rep­u­ta­tion of great artists in those days was based on the with­hold­ing of information.

It would be illog­i­cal in the con­text of human musi­cians and phys­i­cal instru­ments to play a pre­lude in one tun­ing and then retune the instru­ment sole­ly for the pur­pose of play­ing the fugue. Consequently, these audio exam­ples are not intend­ed to emu­late a gen­uine per­for­mance. They can, how­ev­er, assist in eval­u­at­ing the suit­abil­i­ty of a pre­ferred tun­ing scheme for each musi­cal work.

A "deaf musi­col­o­gist" employs a method of tonal­i­ty assess­ment that involves mea­sur­ing melod­ic and har­mon­ic inter­vals in terms of fre­quen­cy ratios. The results of this assess­ment depend on the val­ues (weights) assigned to cer­tain ratios in advance. Our find­ings demon­strate that equal­ly mean­ing­ful sets of hypothe­ses can lead to com­plete­ly dif­fer­ent results, which only trained ears can dis­tin­guish. The com­bi­na­tion of hypothe­ses may not elu­ci­date the sit­u­a­tion. An appar­ent pref­er­ence for a tun­ing scheme may be the result of a numer­i­cal arte­fact rather than proof of its validity.

Bach's fam­i­ly tree, unknown artist (source)

A metic­u­lous lis­ten­ing to these record­ings, with the exclu­sion of the some­what inel­e­gant ren­der­ing of fast trills in the low­er octave, reveals a musi­cal dimen­sion that can­not be reduced to the con­cept of 'inter­vals'. Each piece can be likened to a pre­cious stone, exhibit­ing an aston­ish­ing reg­u­lar­i­ty in its struc­ture. The lis­ten­er is invit­ed by the artist to explore all sides of the crys­tal and to appre­ci­ate its puri­ty: a 'tonal land­scape'. In this approach, the slight­est imper­fec­tion, such as a few cents up or down, is ampli­fied by the struc­ture. In short, the most impor­tant fea­ture may be less the choice of a struc­ture than its con­sis­ten­cy in ren­der­ing each musi­cal phrase.

It is uncer­tain whether J.S. Bach had a spe­cif­ic, unique musi­cal tem­pera­ment in mind when he com­posed The Well-Tempered Clavier. This is because the high­est rat­ing in terms of inter­vals may not be the most appro­pri­ate. This ques­tion remains open to art his­to­ri­ans and musi­col­o­gists. However, from the sound exam­ples, it is evi­dent that play­ing this reper­toire on improp­er­ly tuned instru­ments — in terms of con­so­nance — is tan­ta­mount to expos­ing plas­tic imi­ta­tions of diamonds.

Reference(s)

Asselin, P.-Y. Musique et tem­péra­ment. Paris, 1985, repub­lished in 2000: Jobert. Soon avail­able in English.

Musicians inter­est­ed in con­tin­u­ing this research and relat­ed devel­op­ment can use the Bol Processor BP3 to process musi­cal works and imple­ment fur­ther tun­ing pro­ce­dures. Follow the instruc­tions on the Bol Processor ‘BP3’ and its PHP inter­face page to install BP3 and learn its basic oper­a­tion. Download and install Csound from its dis­tri­b­u­tion page.

Bernard Bel — January 2022

Please join the BP users help forum , BP open dis­cus­sion forum and/or the BP devel­op­ers list to stay in touch with the progress of work and dis­cuss relat­ed the­o­ret­i­cal issues.