Skip to content
SJsi-jam-sessions
Rust to WebAssembly · open source

Every note graded, to the sample.

A music engine where an AI's playing can be graded exactly, replayed exactly, and trained on with a clean conscience. The model proposes. A checker that is not the model admits the proposal or refuses it with a reason, and a deterministic law commits and hashes what it admits.

Fetch the piano

cargo run -p host --release -- fetch-piano

Play

cargo run -p host --release -- play

Play along

cargo run -p host --release -- jam --midi 0

Listen: one hymn, two arrangers

Two models arranged the same 1862 edition of Battle Hymn of the Republic. The law committed every note of each, and the piano played what it committed.

Arranged by glm-5.35:02 · 1,720 notes

Uncompressed WAV, 116 MB ·the notes the law committed85b2d56723cacc6c87895a2784d2cd034dea1142e62de6d8a1a9d2867dad2eed

Arranged by kimi-k34:37 · 1,924 notes

Uncompressed WAV, 106 MB ·the notes the law committedbf49d310de5e94975b277cd1e7c57134388a0232d53bb059f12e7727baeba017

Introduction: kimi-k3 plays louder: average velocity 93 against 89.

This browser could not start WebGL, so the 3D view is off. The table below has the same measurements.

Where they differ, section by section

Each cell gives the section's length, notes a second, range and average velocity (out of 127), measured from the notes the law committed. The last column states the largest of five differences: length, notes a second, median note, average velocity, and the most notes sounding at once. Both arrangements follow the same form: an introduction, five verses each with its chorus, and a coda.

Sectionglm-5.3kimi-k3The largest difference
Introduction9.5 s · 7.8 notes/s · E♭1–D5 · 899.5 s · 7.4 notes/s · E♭1–D5 · 93kimi-k3 plays louder: average velocity 93 against 89
Verse 128.4 s · 6.5 notes/s · E♭2–D5 · 8425.7 s · 6.4 notes/s · E♭1–D5 · 78kimi-k3's median note sits 4 semitones higher
Chorus 125.3 s · 6.9 notes/s · F1–D5 · 8825.3 s · 4.2 notes/s · E♭1–D5 · 82glm-5.3 stacks up to 7 notes at once, against 4
Verse 228.4 s · 4.3 notes/s · E♭2–D5 · 8525.7 s · 6.8 notes/s · E♭1–D5 · 82kimi-k3 plays 1.6× as many notes a second
Chorus 225.3 s · 5.7 notes/s · E♭1–D5 · 8925.3 s · 7.0 notes/s · E♭1–D5 · 88kimi-k3 stacks up to 7 notes at once, against 5
Verse 328.4 s · 6.7 notes/s · E♭1–D5 · 9225.7 s · 8.4 notes/s · E♭1–D5 · 87kimi-k3's median note sits 4 semitones higher
Chorus 325.3 s · 7.5 notes/s · E♭1–D5 · 9125.3 s · 5.9 notes/s · E♭1–D5 · 93kimi-k3's median note sits 5 semitones higher
Verse 428.4 s · 3.4 notes/s · B♭2–B♭4 · 8825.7 s · 6.1 notes/s · E♭1–D4 · 78kimi-k3 plays 1.8× as many notes a second
Chorus 425.3 s · 4.4 notes/s · B♭1–D5 · 8925.3 s · 7.4 notes/s · E♭1–D5 · 93kimi-k3 plays 1.7× as many notes a second
Verse 528.4 s · 6.8 notes/s · E♭1–D6 · 9325.7 s · 11.3 notes/s · E♭1–D6 · 93kimi-k3 plays 1.7× as many notes a second
Chorus 525.3 s · 6.2 notes/s · E♭1–D6 · 9525.3 s · 7.4 notes/s · E♭1–D6 · 96kimi-k3's median note sits 7 semitones higher
Coda23.2 s · 3.7 notes/s · B♭1–D5 · 9212.2 s · 3.8 notes/s · E♭1–C6 · 95glm-5.3 takes 11.0 s longer

Piano: Salamander Grand Piano V3 by Alexander Holm, CC BY 3.0. Both arrangements are dedicated to the public domain under CC0 1.0. Each was generated on Ollama Cloud from this project's transcription of the anonymous 1862 Ditson edition, and admitted by the law's licence check with its evidence. Each recording is rendered through the law. Rendering it again gives the same bytes, on the same machine and on Windows and Linux.

How it works

A model may propose anything. Only the law decides what happened.

Integer time

The law keeps time at 3,360 ticks per quarter note and steps a fixed quantum of 48 samples at 48 kHz, whether anyone plays or not. A plan that arrives late is refused; it never stalls the music.

The take is part of the law

Every note you play is graded against the score to the sample, inside a gate of ±40 ms. "Late by 45 ms" is a fact the engine can prove, and the waveform is only presentation.

One hash everywhere

The law is no_std Rust with no floating point, compiled to one pinned WebAssembly binary. The Entertainer’s golden hash is the same on x86_64 and ARM64 and under V8, SpiderMonkey and JavaScriptCore; the exemplars’ goldens are checked on both architectures.

Every song earns its place

A score is admitted only with evidence: a composition in the public domain in the US and the EU, a free or self-engraved arrangement, the source edition and its year, and an in-file licence that matches its receipt.

Replays without a model

The law is deterministic, so a recorded take replays to the same hash without calling a model. CI replays The Entertainer’s constructed take on every run.

Reviewed across families

Before a code change merges, two models from families other than the author’s review it on Ollama Cloud, each blind to the other.

Try it

Rust 1.98.1, which rustup installs, or the container, which already holds the host. Windows runs everything, though live input has not yet met a real MIDI keyboard. On Linux, CI builds, tests and renders, and live input is Windows-only for now.

Or use the container

docker run --rm -v "$PWD:/out" \
  ghcr.io/mcp-tool-shop-org/si-jam-sessions:0.2.1 \
  notes /out/notes.json

Get the grand piano once

git clone https://github.com/mcp-tool-shop-org/si-jam-sessions
cd si-jam-sessions
cargo run -p host --release -- fetch-piano  # 742 MB, checked by SHA-256

Listen

cargo run -p host --release -- play  # glm-5.3
cargo run -p host --release -- play --piece battle-hymn-kimi-k3

Play along

cargo run -p host --release -- devices  # find your MIDI input
cargo run -p host --release -- jam --midi 0

Reproduce a recording

cargo run -p host --release --locked -- render battle-hymn-glm-5.3.wav \
  --piece battle-hymn-glm-5.3 --voice piano
# SHA-256 85b2d56723cacc6c87895a2784d2cd034dea1142e62de6d8a1a9d2867dad2eed

Pinned

Every claim on this page is a hash you can check.

WhatSHA-256
The Entertainer: the golden take, gradedb43db3787577b4f959f611ae6e7d84c0b92e69d34c31bcbfe927a9f67f0eda11
Battle Hymn, glm-5.3: the law’s snapshot409a3341a35af9e7ad203ef573a28e475600b27e183cc08d1b8b0cfbb03d2f97
Battle Hymn, kimi-k3: the law’s snapshote792361b22413de14e1cd0740947af2a34725970ef0d126be1e720f96b06395f
Battle Hymn, glm-5.3: the WAV85b2d56723cacc6c87895a2784d2cd034dea1142e62de6d8a1a9d2867dad2eed
Battle Hymn, kimi-k3: the WAVbf49d310de5e94975b277cd1e7c57134388a0232d53bb059f12e7727baeba017
The Salamander piano archiveb7760e168494cf095344e217b0af013fc449ad033abbbdf1c65211cf11dc038b

Trust model

What the code touches, and what it never does.

The law does no I/O

CI checks that the WebAssembly module imports nothing at all.

One download, pinned

Only fetch-piano uses the network: one archive from one fixed address, checked by SHA-256 before anything is unpacked, with links and escaping paths refused.

No telemetry

Nothing is collected or sent. There are no accounts, and the code handles no credentials.