tessella
by stephenwil
README.md
# Tessella kit
Write music for [Tessella](https://stephenwil.github.io/tessella-showcase/) in code, or let an AI agent write it.
The kit runs the real Tessella sound engine (`engine/melodee.wasm`) in Node.js. It needs no browser, no server and
nothing from npm.
- **Compose:** describe a song in plain text, tracks of notes like `"D5 - - A4 . F5"`, and build it.
- **Save, render and share:** save the song as a `.tsp` file, render a WAV (the mix, or the four tracks as stems),
or print a link that plays it in anyone's browser.
- **MCP:** a Model Context Protocol server, so Claude, Cursor or any MCP client can compose, play, tweak and render
songs for you.
- **Covers:** draw a song's cover picture from its music.
Needs **Node.js 18 or newer**. Nothing to install:
```bash
git clone https://github.com/stephenwil/tessella-kit && cd tessella-kit
node bin/compose_song.mjs songs/iron_comet.mjs --wav iron.wav --link
```
That builds IRON COMET from [`songs/iron_comet.mjs`](songs/iron_comet.mjs), renders it to `iron.wav` and prints a
link that opens it in the Tessella Studio.
## Write a song
A song file is a JavaScript module whose default export is a **SONG SPEC**:
```js
export default {
name: "FIRST LIGHT",
tempo: 120,
tracks: [
{ sound: "DRUM/909 KIT", // ENGINE/PRESET
patterns: { A: "K+CH . CH . S+CH . CH . K+CH . CH K S+CH . CH CH" } },
{ sound: "FM6/SOLID BASS", params: { "VOICE MODE": "MONO" },
patterns: { A: "C2! . C3 . C2 . Eb2 . F2 . . . G2 . Bb1 ." } },
],
song: ["AA x4"], // a bank letter for each track, then repeats
};
```
```bash
node bin/compose_song.mjs first_light.mjs --tsp first-light.tsp --wav first-light.wav --link
```
- **Step notation**, one token per step: `C4` a note, `C4+E4+G4` a chord, `.` a rest, `-` hold. On a DRUM
track: `K S CP CH OH T RIM BELL`, combined with `+`. Add `!` for an accent.
- [docs/SONG_SPEC.md](docs/SONG_SPEC.md) has the whole format.
- [`songs/`](songs/) holds three complete pieces to learn from.
## Pick and shape the sounds
Each of the four tracks plays one sound: an **engine** and one of its **presets**, then shaped with parameters.
```bash
node bin/compose_song.mjs --sounds # every ENGINE/PRESET (FM6, ORACLE, TRIO, PHYS, DRUM)
node bin/compose_song.mjs --params # every parameter: name, track or global, default, range
node bin/compose_song.mjs --params FILTER # only those named ...FILTER...
```
A track's `params` set any of them by name, as a number or a value name: `{ "VOICE MODE": "LEG", "GLIDE": 6 }`.
To design a sound by ear, with every operator and envelope, use the
[Sound Editor](https://stephenwil.github.io/tessella-showcase/editor/). It also imports Yamaha DX7 `.syx` banks.
For how the five engines work under the hood — signal flow, voice budget, parameter tables and how to add a new engine
in C — see [docs/SOUND_ENGINES.md](docs/SOUND_ENGINES.md) and the
[Sound Engines Infographic](docs/sound_engines_infographic.html) ([PNG](docs/sound_engines_infographic.png)).
## Use it from an AI agent (MCP)
```json
{ "mcpServers": { "tessella": { "command": "node", "args": ["/ABS/PATH/TO/tessella-kit/mcp/tessella_mcp_server.mjs"] } } }
```
Then ask for a song: *"write a 60-second calm piece in F major on Tessella and give me the link"*.
[docs/MCP.md](docs/MCP.md) lists the 15 tools: `compose_song`, `list_sounds`, `find_params`, `set_params`,
`render_wav`, `render_stems_zip`, `share_link`, and more. Check it with `node mcp/tessella_mcp_server.mjs --self-test`.
## Use it from your own code
```js
import fs from "node:fs";
import { Composer } from "./lib/tessella_compose.mjs";
import { songLink } from "./lib/share.js";
const { instance } = await WebAssembly.instantiate(fs.readFileSync("engine/melodee.wasm"), {});
const x = instance.exports;
x._initialize(); x.web_nor_erase(); x.web_boot();
const c = new Composer(x);
c.compose(spec); // a SONG SPEC
const n = x.web_song_get(); // the song as a .tsp record
const tsp = new Uint8Array(x.memory.buffer, x.web_slot_buf(), n).slice();
console.log(await songLink(tsp, "https://stephenwil.github.io/tessella-showcase/sim/"));
```
[docs/ENGINE_API.md](docs/ENGINE_API.md) lists every engine export: rendering, stems, MIDI in and out, the panel,
parameters, patterns, songs and slots.
## What's here
| Path | What |
| --- | --- |
| `bin/compose_song.mjs` | build a song file, then save, render and link it; list sounds and parameters |
| `lib/tessella_compose.mjs` | the compose library: SONG SPEC, step notation, sounds and parameters by name |
| `lib/share.js` | share links: a whole song packed into a URL (`#song=…`), for Node and browsers |
| `lib/tessella_thumbnail.mjs` | a song's cover (SVG) drawn from its music: `node lib/tessella_thumbnail.mjs song.tsp --out cover.svg` |
| `mcp/tessella_mcp_server.mjs` | the MCP server |
| `docs/` | song spec, MCP tool list, engine exports, sound engines technical guide and infographic |
| `songs/` | IRON COMET, SOFT LANTERN and AFTERGLOW SIGNAL as song files |
| `tunes/` | the eleven showcase tunes as `.tsp` files, their catalog (`tunes.json`) and covers |
| `engine/` | the sound engine (`melodee.wasm`) and its complete source code |
| `test/smoke.mjs` | `node test/smoke.mjs`: everything above, checked |
## Licences
- **The kit's own code, docs and songs** are **MIT** ([`LICENSE`](LICENSE), Copyright (c) 2026 Stephen Wilson).
That covers `bin/`, `lib/`, `mcp/`, `songs/`, `docs/` and `test/`, plus the tunes IRON COMET, SOFT LANTERN and
AFTERGLOW SIGNAL and all the covers.
- **The sound engine** (`engine/melodee.wasm`) is free software under the **GNU General Public License, version 3
only** ([`engine/LICENSE-GPL-3.0.txt`](engine/LICENSE-GPL-3.0.txt)). It is a modified version of
[Tessera](https://github.com/Rastapopolix/tessera) (Theo Dainis), [Melodee](https://github.com/keremimo/melodee)
(Kerem Kilic, Ellic Studio) and [Felucca](https://github.com/hugelton/Felucca) (Leo Kuroshita, Hügelton
Instruments). Its complete source is [`engine/tessella-engine-source.zip`](engine/), which rebuilds it byte for
byte ([`engine/README.md`](engine/README.md)). If you ship the engine, ship it under the GPL with its source.
- **The eight classic tunes** in `tunes/` (Still Tide, Koto Garden, Low Harbour, Slow Light, Cedar Rain, Undertow,
Paper Kites, Ember Field) come with Tessera, under its licence (GPL-3.0-only).
- **Your own songs** are yours, under whatever licence you choose.
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues