Chamber

Chamber

An opinionated language environment for ABC notation.

Fast, partial-safe language toolkit for writing, checking, and refining ABC notation. Inspired by tools like Biome.

Try Playground Get Started GitHub

Features

Partial-safe Parsing

Never crashes on unfinished input. Editing always comes first.

Structured Diagnostics

30+ diagnostic codes with rich context and precise location info.

Lint Rules

Catch bar length mismatches, unusual octaves, suspicious durations.

Formatter

13 configurable options for consistent, readable notation.

Syntax Highlighting

Tokenizer for editor integration. Notes, rests, bars, decorations.

WASM Ready

Use in browser with npm. Zero dependencies, instant load.

Quick Start

npm (Browser/WASM)

$ npm install chamber-abc

CLI (Cargo)

$ cargo install chamber-cli

Usage

import init, { parse, analyze, format_default } from 'chamber-abc';

await init();

const source = `X:1
T:My Tune
M:4/4
L:1/8
K:C
CDEF GABc|`;

// Parse
const result = parse(source);
console.log(result.tune);        // AST
console.log(result.diagnostics); // Parse errors

// Analyze (lint)
const analysis = analyze(result.tune);
console.log(analysis.diagnostics); // Warnings

// Format
const formatted = format_default(source);

Rich Diagnostics

Precise error messages with context, just like modern compilers.

error[H002]: missing key field (K:)
 --> tune.abc:1:1
  |
1 | X:1
  | ^^^ tune must have a K: field

warning[W003]: bar length mismatch
 --> tune.abc:5:1
  |
5 | CDEFG|
  | ^^^^^ bar has 5/8, expected 4/4

Architecture

Modular design with clear separation of concerns.

source text
    
  lexer → tokens (for highlighting)
    
  parser (partial-safe)
    
   AST
    
 ┌──┴──┐
 │     │
analyzer  formatter
 
diagnostics
chamber_lexer

Tokenizer

chamber_parser

Partial-safe parser

chamber_analyzer

Lint rules

chamber_formatter

Code formatter

What Chamber is not

- Not a score renderer

- Not a playback engine

- Not a full ABC specification reference

Chamber focuses on language tooling, not visualization.

"Chamber is the environment where ABC notation is written, examined, and refined — like chamber music itself."