BPscript
A composition language that writes Bol Processor (BP3) grammars in plain terms and derives them in the browser.
active last change 4 November 2026
BPscript comes from BP3, the Bol Processor that Bernard Bel and Jim Kippen have been developing since 1981: it keeps its weighted rules, its flags and its polymetry, and replaces a dense syntax with a readable language. Its main limitation: the code is private; only the online demo can be played, and it has been frozen since June 2026.
The demo plays without installing anything: 53 examples, including a ten-step tutorial, which you edit and produce in the page.
A scene is a set of rewriting rules
You write rules: S -> A B says that the start symbol S is rewritten as A then B, and so on down to the terminals, the notes or sounds. The temporal structure, what comes when and for how long, lives in these rules.
The sound comes from elsewhere: from libraries declared at the top (note alphabet, tuning, controls) and, for the rest, from native code placed between backticks. The language itself fits in three reserved words and twenty-four symbols (S2).
Getting started
In the demo, open the tutorial “8. Polymetry” and click Produce:
@core
@controls
@alphabet.western:browser
S -> {C4 E4 G4, D4 F4 A4 C5}
The page shows the BP3 grammar it produced, gram#1[1] S --> {C4 E4 G4,D4 F4 A4 C5}, then the engine places three notes of 1,000 ms against four of 750 ms, over the same three seconds. Observed on 28 September 2026 on the online demo (file demos/tuto-08-polymetry.bps). Playback goes through Play, in the browser, or through the MIDI button.
The demo uses the June 2026 syntax. In the current version, directives are written without @ (core, alphabet.western:audio) and a ----- line separates them from the rules.
What it does
- Pick a rule at random by its weight: under
@mode:random,Motif -> C4 E4 G4 E4 [weight:40](tutorial 7). - Stack voices of different lengths:
{…, …}stretches each voice over the same duration (tutorial 8, example “3 vs 4 vs 5”). - Write rests and prolongations:
-and_(tutorial 3). - Count and condition with flags and guards (tutorial 10, example “Flags Counter”).
- Separate structure from material in subgrammars (tutorial 9).
- Tune: equal temperament, just intonation, A at 442 Hz, maqam rast in quarter tones, gamelan slendro and pelog, the Bohlen-Pierce scale.
- Output to Web Audio or MIDI: channels, controllers, pitch bend computed for microtonality, two outputs at once through actors (
@actor). - Embed code between backticks (S4): JavaScript in the demo; the SuperCollider example needs a bridge installed locally.
- Change it while it plays: the Live button re-derives the scene during playback (S11).
Where it stands
Licence: to be decided. In the demo, 4 examples out of 53 fail to compile, the two ragas “Raga Sargam” and “Solfège” (observed on 28 September 2026, producing the examples one by one).
Since 19 July 2026, the compiler no longer produces BP3 text: it returns a tree, which BPx derives, an engine written to succeed BP3 and still private (S10, S13). BP3 remains the reference: what the two engines produce is compared grammar by grammar. On 7 September 2026, the 239 automatic checks passed (the repository’s baseline-status.json file).
The code is private: work happens in a repository that brings together BPscript, Kanopi and their engines.
Demo · S1 · S12 · BP3 in the browser · Bol Processor
Thanks to Bernard Bel, whose engine and example grammars serve as the reference, and who merged into BP3, as early as version 3.3.19, a fix that came out of these comparisons.
How it was made. Claude Code (Claude Opus 5.5), from the repository, its README and its release notes. Method