SPB Git

Repository Public

CLAUDE.md 3.2 KB

# ORIX Sonata — working rules

Native macOS music-programming studio: Sonata language → compiler → Musical IR / DSP IR → real-time and offline audio. Bundle ai.spboucher.orix.sonata, Apple Silicon, macOS 15+. The mandate is traced section by section in ROADMAP.md. State of the work: STATUS.md. Risks: RISKS.md.

# Non-negotiable

  1. No fake anything. No decorative waveform, no silent instrument declared working, no button without an effect, no number that was not measured. Unfinished = disabled and listed in STATUS.md.
  2. Audio thread: no allocation, blocking lock, file or network access, logging or compilation in any process path. Preallocate; SPSC queues and atomics only.
  3. One source of truth: the compiler crates. The app, CLI and LSP call them; nobody re-implements parsing, timing or parameter tables. Time conversions go through sonata_ir::time.
  4. Headers: every first-party source file starts with the ORIX Sonata header (project, File: relative path, Description:, author Simon-Pierre Boucher, contact@spboucher.ai).
  5. Never touch other projects, signing material or secrets. Nothing is published without the owner's word.
  6. Safe loudness: tests and previews start quiet; the master limiter is on by default.

# Layout and ownership

Path Role
crates/sonata-ir contracts: Rational, tempo map, diagnostics, Program, DspGraph, PatchSpec, Registry types. Change only with the integrator's agreement.
crates/sonata-lexer, -parser, -semantics, -compiler frontend, formatter, language services, graph builder, cache
crates/sonata-dsp primitives (core, osc, filter, env), effects, analysis
crates/sonata-instruments engines, patch interpreter, engine registry
crates/sonata-runtime, -render real-time engine, offline render, file writers
crates/sonata-interop MIDI, MusicXML, audio import
crates/sonata-cli, -lsp, -ffi command line, language server, C ABI for Swift
Apps/ORIXSonata, Packages/* the macOS app (XcodeGen project.yml)
StandardLibrary/std the standard library, written in Sonata, embedded in the compiler
Documentation/ spec, ADRs, manual; Examples/ are compiled by the tests

# Commands

bash
cargo test --workspace            # all Rust tests
cargo clippy --workspace --all-targets -- -D warnings
cargo fmt --all
cargo run -p sonata-cli -- render Examples/aurora.sonata --output build/aurora.wav
Scripts/build.sh debug|test|release   # app (after M1)

Rust 1.95 (pinned in rust-toolchain.toml), rustfmt.toml at the root. Dependencies are kept minimal, MIT/Apache-2.0 only, and recorded in Documentation/DEPENDENCIES.md.

# Working in parallel

Several agents work in this repository at once. Stay inside the paths you own, never run git add -A or git commit -a: commit only your own paths (git add <paths> && git commit), retry if index.lock is held. Do not rewrite history. Do not edit another owner's file: note the request in your final report instead. Use your own CARGO_TARGET_DIR only if builds block each other for long. Do not spawn sub-agents.

Files main
Menu

Theme