Skip to content
roomi fields

Composing with structure

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 last change 22 September 2026 licence BSD-3-Clause

Try it Source code Website

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.

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.

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).

In the demo, 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 and 2 overflow the browser’s call stack.

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