Skip to content
roomi fields

Composing with structure

BPscript

A composition language that writes Bol Processor (BP3) grammars in plain terms and derives them in the browser.

active

Try it Source code

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: apart from the online demo, frozen in June 2026, the public repository does not install on its own, because its checks call a package that is still private.

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

Common issues

Sargam and solfège do not compile in the demo. Observed on 28 September 2026, producing the 53 examples one by one: 49 produce, 4 fail to compile (the two ragas, “Raga Sargam” and “Solfège”). “Tied Notes” produces, but reports two lost tied notes.

A clone of the repository fails its own checks. npm install succeeds; npm run verify stops at type checking, for lack of the @kairos/core module, which is not public. Measured on 28 September 2026 on a fresh clone, with Node 22.

The README describes two pipelines. Its text announces compilation to BP3, its diagram derivation by BPx; the diagram is the current one.

Where it stands

Licence: to be decided; the repository declares none. No published version; 1,634 commits between 12 March and 7 September 2026.

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. As of 7 September 2026, out of the 114 grammars in the corpus, 61 are active, 39 are still to be tested and 12 are excluded; the 239 automatic checks pass (the repository’s baseline-status.json file).

The public repository has not moved since 7 September 2026: work continues in a private repository that brings together BPscript, Kanopi and their engines.

Repository · 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