
Tapestry
The multi-track session model: tracks, clips, lanes and scenes, edits with undo, a crash-safe project store.
Tapestry is the component that holds what a project is and how it changes. It is part of Signals & Sorcery, a coherent set of Rust audio building blocks for audio apps, plugins, players and DAWs.
| Repository | github.com/shiehn/tapestry-session-model |
|---|---|
| License | MIT, free for commercial and closed-source use |
| Status | Planned |
| Layer | Musical structure (how the layers stack) |
| Crates (planned names) | tapestry |
What it is
Every DAW has a document: tracks in folders, clips on a timeline, automation, a tempo map, plugin chains, maybe a grid of launchable clips. Every DAW also needs undo that never lies, and a project folder that survives a crash in the middle of a save. Tapestry is those three things as one generic model.
The model. Tracks and folders with sends; MIDI and audio clips of one clip type used on a timeline lane and in a launcher slot; take lanes and comping in the design; scenes and launch groups; an optional section layer (intro, verse, chorus); automation lanes with curves; tempo, meter and key maps in Orrery's types; plugin chains as data; and app data on every entity: namespaced, size-capped, opaque values an application attaches without forking the model. One model aims to describe a linear timeline DAW, a session and arrangement DAW with a clip launcher, and shapes nobody has built yet.
Edits with inverses. Every change is an intent: a typed edit that returns the new document and its inverse. Intents go to an append-only log, which gives linear undo and redo, replay of a whole session, and an inverse self-check (apply, invert, compare) that tests run over every intent. Applications register their own intents and get undo and replay for free.
The project store. A project is a folder: canonical JSON for the document, content-addressed blob stores (audio, plugin state, renders), append-only logs and a manifest. Saving uses a two-step commit with file-system barriers, so a crash at any moment leaves the old project or the new one, never a mix. Opening verifies what it reads, unused blobs are collected, and a lock stops two processes writing one project.
Usage example
Illustrative sketch
Planned, not final. Taken from the README.
use tapestry::{Project, Store, intents::*};
let mut store = Store::create("MySong.project", StoreSpec::default())?;
let mut doc = store.open_document()?;
let drums = doc.apply(TrackInsert::audio("Drums"))?;
let clip = doc.apply(ClipPlace::new(drums, media_ref, Bars(1)..Bars(9)))?;
doc.apply(AutomationAdd::volume(drums).point(Bars(8), -12.0))?;
doc.undo()?; // the automation point is gone
doc.redo()?; // and back
store.commit(&doc)?; // crash-safe save
// An application's own intent, with undo and replay for free:
doc.registry_mut().register::<MyApp::SetMood>();
How it fits in the ecosystem
Tapestry is in the musical structure row, beside Procession. Dependencies point down, never up.
Below it: Orrery (repo) for time types and Runecraft (repo) for its floor. It produces the mixer description that Leyline (repo)'s compiler turns into a graph, and refers to media in Scriptorium (repo) by content.
Beside it: Procession (repo). The two don't depend on each other.
Above it:
- Grimoire (repo) turns a project into a playback description for Procession and exposes intents through its protocol.
- Familiar (repo) extensions keep their own data in Tapestry's app data, so it is saved, versioned and undoable with everything else.
What it deliberately doesn't do: no playback (it describes; Procession and Leyline play), no user interface (editors emit intents), no collaborative merging (it is a linear log, not a CRDT), and no interchange format yet.
| Component | Repository | Role | Status |
|---|---|---|---|
| Runecraft | runecraft-audio-core | Shared contracts, realtime safety, process isolation and realtime-safe logging: the floor every other component stands on | In preparation |
| Orrery | orrery-musical-time | Tempo and meter, transports, bar, beat and sample maths, timed MIDI | In preparation |
| Summoner | summoner-plugin-host | Out-of-process VST3 and Audio Unit plugin hosting with crash isolation | In preparation |
| Aethergate | aethergate-audio-platform | Audio devices (cpal, CoreAudio, a fake device for tests) and shared-memory meters | Planned |
| Leyline | leyline-audio-graph | A realtime audio graph with delay compensation, and a compiler from an edit model to a graph | Planned |
| Cantrips | cantrips-audio-dsp | Built-in mixer DSP: sampler, fader, pan, meters, compressor | Planned |
| Scriptorium | scriptorium-audio-media | Decode and encode, a sample store, streaming voices, crash-safe recording | Planned |
| Tapestry | tapestry-session-model | Tracks, clips, lanes and scenes; edits with undo; a crash-safe project store | Planned |
| Procession | procession-timeline-engine | What plays in each block: regions, notes, automation, launches | Planned |
| Grimoire | grimoire-daw-engine | The assembled engine and its headless JSON-RPC protocol | Planned |
| Familiar | familiar-plugin-sdk | An SDK for plugins and panels that extend a Signals & Sorcery engine | Planned |
| Glyphwork | glyphwork-audio-ui | Audio UI widgets: meters, knobs, faders, waveforms | Planned |
Status
Planned. No code yet. The repository holds the design.
Pure Rust over the file system: macOS, Windows and Linux. A WebAssembly build that edits projects in a browser is a later exploration.
Links
- Repository: github.com/shiehn/tapestry-session-model (README, LICENSE)
- Depends on: orrery-musical-time, runecraft-audio-core; feeds leyline-audio-graph, refers to scriptorium-audio-media
- Used by: grimoire-daw-engine, familiar-plugin-sdk
- All twelve components · For agents · llms.txt