Bol Processor 3 in the browser
BP3's C engine, compiled to WebAssembly, and BPweb, a page that runs it with nothing to install.
archived licence BSD-3-Clause
BP3 usually runs on a computer, driven by a PHP interface; in March 2026, I compiled its C engine with Emscripten so that a plain web page could run its derivations. Its main limitation: this port no longer follows the engine, and the online page runs a binary from 11 March 2026, while BP3 has reached version 3.5.5, of 26 September 2026.
The demo plays without installing anything: you pick a grammar from the library, Produce derives it, Play plays it.
The same engine, called by a page
Nothing was rewritten: this is Bernard Bel’s C code, compiled a second time for another target. Where the PHP interface launches a program and reads its files, the page calls the engine’s functions directly from JavaScript: load the grammar and the alphabet, produce, build the temporal structure.
What cannot live in a browser, the console program’s entry point, writes to standard output, terminal settings, is set aside at compile time by #ifdef __BP3_WASM__ guards. The native code is not changed by them.
Getting started
Open the demo, choose “Mozart” in the Western / Classical family, click Produce: the engine compiles the grammar and returns 510 MIDI events. Observed on 28 September 2026. Play starts playback.
Building the engine yourself requires Emscripten: a clone of BPweb does not contain the WebAssembly binaries, contrary to what its README says. They are built in the bp3-engine submodule with ./build.sh wasm.
What it does
- Derive BP3 grammars: the library holds 44, taken from Bernard Bel’s corpus of examples, in four families: tabla and Indian music (8), Western music (6), experimental (14), examples and tutorials (16).
- Edit grammar, alphabet and settings, in three tabs.
- Return the result as text (the string of terminals produced) and as MIDI events.
- Follow compilation: the Messages tab shows what BP3 writes to its console, errors included.
Common issues
One grammar in three returns nothing. Observed on 28 September 2026, producing the 44 grammars one by one, each in a fresh page, with default settings: 29 produce, 13 stop without a result (including dhati, Ruwet, koto3, tryFlags), and 2 (vina, vina3) overflow the browser’s call stack.
Ruwet fails on its homomorphism. The engine replies “Can’t make sense of “mineur"": the homomorphism mineur, declared in the alphabet, is not recognised (B6).
The stack overflows on vina and vina3. Working hypothesis, not checked on these two grammars: the recursion of PolyMake, which resolves polymetric structures, uses more stack under WebAssembly than in native C, as a case studied for BPscript showed (B13).
Where it stands
Archived: the fork says so in its description and points to Bernard Bel’s repository. The BPweb interface has not changed since 23 April 2026; its repository has no licence, and the engine keeps the Bol Processor’s (three-clause BSD).
The port has gone upstream. Bernard Bel’s code, at version 3.5.5, carries the __BP3_WASM__ guards, for example around main() in ConsoleMain.c. And the home page of bolprocessor.org states: “In 2026, Romain Peyrichou started integrating BP3 into a WebAssembly (WASM) architecture to create interactive links between BP3 and powerful sound design platforms, such as SuperCollider.” It adds that BP3’s C code “has been patched to compile with Emscripten, in addition to MacOS, Windows and Linux”.
The fork now serves another purpose: its wasm branch builds the native BP3 binary used as the reference for BPscript’s comparisons. The BPscript demo embeds the same engine, in a build from 10 April 2026.
Engine fork · BPweb · Bol Processor · I2 · S10
Thanks to Bernard Bel, who welcomed this port into his code and onto his site, and to the other authors of the Bol Processor named in its licence: Jim Kippen, Srikumar Karaikudi Subramanian, Anthony Kozar.
How it was made. Claude Code (Claude Opus 5.5), from the repository, its README and its release notes. Method