sim-lib-music-serial
Immutable serial plans with stable row and event identity, explicit role and origin provenance, and validated partial temporal order.
sim-lib-music-serial keeps the structural source honest before and during
realization. Rows remain immutable RowForm values from
sim-lib-pitch-serial; events cite them through stable OrdinalRef values
rather than flattening them into a fake score order. Equal-onset chords are
expressed through simultaneous groups, while independent temporal requirements
stay in a validated precedence DAG. Roles and origins stay explicit, every
event declares at least one structural-reading license for downstream reports,
and every non-structural event carries parent evidence.
Strict realization adds explicit register, duration, velocity, articulation,
voice, rest, tie, and simultaneity choices without mutating the source plan.
Rendered serial notes retain their planned event and ordinal provenance, then
pass through the canonical sim-lib-music-core staff, piano-roll, and score
forms so equal-pitch occurrences, voice identity, and the structural readings
that license each note survive rendering.
When one composition needs inspectable serial policy rather than a hidden style
switch, compose a SerialPractice from open PracticeRule components and
evaluate a named SerialReading: StructuralPlan, DeclaredRoles, or
AllSounding. Built-in rules cover aggregate, order, repeats, doublings,
simultaneity, row mixing, foreign material, and parameter exhaustion. The
result is an explicit invariant ledger with the rule id, expected fact, observed
fact, evidence ids, and any declared waiver for every preserved, relaxed, or
violated policy.
When one composition needs inspectable deployment rather than a privileged
style mode, compose a TechniquePlan from open SerialDeployer components.
The built-in deployers cover complete horizontal statements, motivic
partitions, chordal vertical blocks, interlocking partitions,
melody/accompaniment distribution, aggregate rotation, and simultaneous forms.
schoenberg_partitioned() is one ordinary public composition of those parts.
use BTreeMap;
use ObjectId;
use ;
use PitchClass;
use ;
let row = try_from_classes?;
let row_form = row.apply;
let row_id = new?;
let group = new?;
let license = new?;
let mut rows = new;
rows.insert;
let opening = PlannedSerialEvent ;
let answer = PlannedSerialEvent ;
let plan = try_new?;
assert_eq!;
# Ok::
Construction fails closed when row or event ids are malformed, ordinal references leave the row, structural coverage is incomplete, parent evidence is missing or cyclic, or precedence fabricates an order inside one simultaneous group.