Expand description
§xmrs — A Safe SoundTracker Library
§Architecture
xmrs
├── core/ ← Modern DAW data model (format-agnostic)
│ ├── module::Module
│ │ ├── instrument: Vec<Instrument>
│ │ ├── tracks: Vec<Track> ──► Cell { event, effects: Vec<TrackEffect> }
│ │ ├── clips: SortedClips
│ │ ├── automation: Vec<AutomationLane>
│ │ ├── timeline_map: TimelineMap
│ │ └── quirks: PlaybackQuirks (default all-off)
│ ├── compatibility::{PlaybackQuirks, PanResetPolicy}
│ ├── instr_{opl, sid, robsid} ← chip-synth voices (cfg `synth_opl`/`synth_sid`)
│ ├── daw/ ← AutomationLane, Clip, Track, TimelineMap, Euclidean
│ └── fixed/ ← Q-format primitives
│
├── format/ ← Native `.xmr` project format (cfg `format`)
│ ├── container ← chunked byte grammar, PNG-style case bits
│ ├── wire::v1 ← frozen schema v1 payloads (CBOR)
│ ├── pcm ← raw `PCM ` blob region, deduplicated
│ └── document::{read, write} ← Module ⇄ bytes, + LoadReport
│
└── tracker/ ← Historical-format support
├── format::ModuleFormat ← (gated on any `import_*`)
├── profiles::{ft2, it214, st3, pt} ← preset quirks
├── period::FrequencyType
├── codepage ← CP437 / Latin-1
├── mix_plugin ← IT OpenMPT extension (cfg import_it)
└── import/ ← XM / IT / S3M / MOD / SID readers
├── build/ ← Pattern → Tracks + Clips + TimelineMap
└── extract/ ← TrackImportUnit → AutomationLane§Features
Default std + import matches the desktop / server case. For a
clean no-tracker build:
[dependencies]
xmrs = { version = "0.15", default-features = false, features = ["std"] }In this mode Module carries only the universal fields: no
origin, no mix_plugins. The historical presets in
tracker::profiles are absent — quirks are all-off by default.
InstrumentType’s variant set does not shrink: the chip
instruments (Opl / Sid / RobSid) are format-agnostic,
integer-only data and are compiled in every build. Only their
render engines gate on synth_opl / synth_sid. That split is
what lets a .xmr written by a full build be read, kept and
re-saved by a build that cannot synthesise a note of it.
§Saving
Module derives serde, so any codec will round-trip it — fine
for a cache, wrong for an archive, since a derived repr carries
no version. Enable format for the project’s own archival
format instead (module format, absent without it): a chunked
container, a frozen
per-schema wire layer, sample data kept out of CBOR, and a
LoadReport that names anything a read had to skip.
Modules§
- core
- Core data model — format-agnostic. Core data model — format-agnostic.
- edit
- Edit command API (atomic, undoable mutations of
Module) Editing API: atomic, validated, undoable commands. - format
- Native
.xmrfile format — chunked container + CBOR wire types (gated on theformatfeature). Seesrc/core/FORMAT_RFC.md. Native.xmrfile format — the chunked container, the frozenwire::vNtypes, the migration chain, and the CBOR codec. Seesrc/core/FORMAT_RFC.mdfor the specification and the reasoning. - generators
- Signal / event generators (runtime synthesis & rhythm engines) — see
the module docs. Sits beside
coreandtracker: not format I/O, not the bare model, but the things that generate at playback. Signal / event generators — the runtime engines that produce sound or note events at playback, as opposed tocrate::core(the format-agnostic data model) andcrate::tracker(format I/O and the format-tied data structures). - prelude
- The Xmrs Prelude The Xmrs Prelude.
- tracker
- Format-tied items: presets, importers, format helpers. (Chip-synthesis
instruments are format-agnostic and live in
crate::core, not here.) Most sub-modules are gated behind one or moreimport_*features. Format-tied items: presets ofcrate::core::compatibility::PlaybackQuirksmirroring historical trackers, theformat::ModuleFormattag, and the import readers / build / extract pipelines. (The chip-synthesis instrument types are not here — they are format-agnostic authoring primitives and live undercrate::core.)