Expand description
§trem — mathematical music engine
Core library for exact-arithmetic music composition and audio processing. No I/O dependencies — this crate compiles to WASM and renders offline.
§Key modules
math— Exact rational arithmetic (Rational= p/q in lowest terms)pitch— Pitch representation, scales, and tuning systems (EDO, just intonation, free)time— Beat-accurate durations and time spansevent— Note events (scale degree + octave + velocity) and graph events (frequency + voice)tree— Recursive temporal trees for rhythmic subdivision (Seq,Par,Weight)grid— 2D step sequencer grid (rows = steps, columns = voices)graph— Audio processing DAG with typed processor nodesdsp— Built-in processors: oscillators, envelopes, filters, distortion, effects, drum synths, plus composite voicesdsp::analog_voiceanddsp::lead_voiceeuclidean— Euclidean rhythm generation (Toussaint 2005)render— Offline rendering of trees/grids through audio graphs
Modules§
- dsp
- Audio DSP processors for the Trem graph: oscillators, envelopes, dynamics, mixing, filters, noise, drum voices, time-based effects, EQ, and composable graph voices.
- euclidean
- Evenly spaced onsets (Euclidean rhythms) and cyclic pattern rotation.
- event
- Composition-layer note data and runtime graph events with sample timing.
- graph
- Audio graph:
Processornodes, routing, block processing, and parameter introspection. - grid
- Row/column pattern editor backed by a flat cell vec and
Treeconversion. - math
- Exact arithmetic for time and rhythm backed by
num_rational::Rational64. - pitch
- Pitch representation, scales, and tuning systems.
- registry
- Processor registry: create processors by short tag at runtime.
- render
- Turn
Trees andGrids intoTimedEvents and offline multi-blockGraphrenders. - time
- Beat-based durations and half-open time spans using exact
Rationalmath. - tree
- Hierarchical rhythm trees: sequential splits, parallel layers, and weighted subdivisions.