Expand description
Core music model layer for the SIM music constellation.
SIM is a Rust runtime with multiple codec surfaces; this crate supplies the
concrete music domain that those surfaces operate on. It defines the music
object model (notes, chords, melodies, scores), the descriptor metadata that
describes music components and their ports and parameters, events and lanes,
the piano roll, multiplicity-preserving exact note slices, and time grid,
loss-audited score conversion through an
identity-bearing Staff, event snapshots and change streams, players and
playables, performances and takes, the arranger, freeze surfaces, traces,
the component registry, and the citizen integration that registers these
types with the runtime.
Structs§
- Arranger
- Arrangement of playable material laid out across lanes on a timeline.
- Arranger
Diagnostic - Diagnostic raised while rendering a placement.
- Arranger
Placement - Single placement of playable material at a point on the arranger timeline.
- Arranger
Render - Result of rendering an Arranger: play events plus diagnostics.
- Audio
Event - An audio-frame event covering a span of frames.
- Automation
Cell - An automation breakpoint targeting a named parameter.
- Chain
Device - A single processing stage in a player chain.
- Chain
Placement - Placement of a chain device: where it runs and under what rate profile.
- Chain
Placement Plan - Plan listing the placement of every device in a chain.
- Chain
Render - Result of rendering a chain: the output events and their trace records.
- Chain
Trace Record - A single trace record describing one action in a player chain.
- Channel
- A MIDI channel number in the range
0..=15. - Channel
Pressure Cell - A MIDI channel-pressure (aftertouch) cell.
- Chord
- A set of pitches sounded together, optionally tagged with a chord symbol.
- Control
Change Cell - A MIDI control-change cell.
- Control
Event - A control-change event setting a named control to a value.
- Conversion
Loss - One explicit, identity-addressed conversion loss.
- Counterpoint
- Several independent melodic lines sounding together with labels.
- Diagnostic
Event - A diagnostic message emitted on a lane.
- Direct
Recording - A directly captured render: metadata plus its events and traces.
- Drum
Cell - A drum hit cell addressed by MIDI key.
- Filter
Ref - Lane filter that keeps a placement only when its lane is retained.
- Freeze
Meta - Reproducibility metadata for a frozen player chain.
- Frozen
Playable - Fully rendered snapshot of a
Playablewith a content hash. - Frozen
Player Chain - A frozen player chain: cached render output keyed by its
FreezeMeta. - Held
Performance Note - A note currently held down at a source.
- Lane
Descriptor - Describes a single lane: its identity, content kind, target, and order.
- LaneId
- Stable string identifier for a lane.
- Melody
- A single monophonic line of notes and rests in sequence.
- Memory
Performance Source - An in-memory
PerformanceSourceholding state and an optional capture. - Midi
Event - A timestamped MIDI event with provenance.
- Midi
File Obj - A complete Standard MIDI File wrapped as a music object.
- Midi
Play Event - A raw MIDI event bound to a lane.
- Midi
Track Obj - A raw MIDI track wrapped as a music object.
- Music
Change Stream - Chronological note-on/note-off representation of a score.
- Music
Component Citizen Descriptor - Runtime citizen wrapper around a
MusicComponentDescriptor. - Music
Component Descriptor - Full description of a music component: its identity, category, capabilities, ports, lanes, parameters, and behavioral contracts.
- Music
Component Registry - An ordered collection of music components keyed by qualified id.
- Music
Component Registry Entry - A single registered music component, wrapping its descriptor.
- Music
Conversion - Converted value with identity retention and complete loss evidence.
- Music
Param Descriptor - Describes a single configurable parameter of a music component.
- Music
Port Descriptor - Describes a single input or output port of a music component.
- Music
Snapshot - Complete pitch-activity snapshot at one exact boundary.
- Note
- A single pitched note with timing, dynamics, and articulation.
- Note
Event - A pitched note with duration, velocity, and channel.
- Note
Occurrence - Stable identity of one note occurrence inside a piano-roll lane.
- Note
Slice - Exact half-open piano-roll window with every sounding note occurrence.
- Object
Cell - A cell that places a named runtime object on a lane.
- Object
Id - Stable identity for a voice, note, or score event.
- Par
- Parallel composition: children that sound simultaneously.
- Param
Snapshot - Sorted, deduplicated snapshot of named player parameters.
- Performance
Event - A performance-intent event tying a rendered time back to its input.
- Performance
Input - A raw performance gesture submitted to a source at a given input time.
- Performance
Input Binding - Binds a named performance input to a lane and channel.
- Performance
Note Key - Identity key for a held note, combining channel and pitch.
- Performance
Source State - Mutable performance state tracked by a source.
- Performance
Take - A captured recording of performance events with a content-addressed cassette.
- Piano
Roll - A piano roll: a set of timed lanes over a shared timing grid.
- Piano
Roll Lane - A single lane of a piano roll holding cells of one kind.
- Pitch
- An octave-aware pitch: a
PitchClasstogether with an octave number. - Pitch
Bend Cell - A MIDI pitch-bend cell.
- Pitch
Class - A mod-12 pitch class, where
C = 0and values increase by semitone toB = 11. - Pitch
Event - A bare pitch event without duration or velocity.
- Placed
Chain Device - Pairing of a device id with its resolved placement.
- Play
Context - Rendering context handed to a
Playableduring prepare/render/freeze. - Playable
Descriptor - Static description of a
Playable: its identity, lanes, and clocking. - Playable
Event - A reference to a named playable to trigger.
- Playable
Shape - Shape record describing the playable protocol surface.
- Player
Chain - A source music object plus an ordered chain of devices and an output target.
- Player
Device Id - Stable identifier for a device within a player chain.
- Player
Target Descriptor - Descriptor of a chain’s output target and its rate contract.
- Poly
Pressure Cell - A MIDI polyphonic key-pressure cell.
- Progression
- An ordered sequence of chords, optionally in a named key.
- Rest
- A span of silence.
- Scale
Degree Cell - A note addressed by scale degree and octave rather than absolute pitch.
- Scale
Lock - A set of allowed pitch classes that incoming notes are snapped to.
- Score
- A top-level score: global settings plus a musical body.
- Score
Voice - Voice metadata retained by non-staff event representations.
- Seq
- Sequential composition: children that play one after another.
- Sliced
Note - One identity-bearing note present in a
NoteSlice. - SmfFile
- A parsed Standard MIDI File: its format, time division, and tracks.
- Snapshot
Stream - Event-boundary snapshot representation of a score.
- Source
Recording - Identifying record for a recorded source, without its rendered output.
- Staff
- Identity-bearing canonical score timeline.
- Staff
Note - A note placed on an identity-bearing staff.
- Staff
Voice - One named staff voice with an exact notated span.
- Tempo
MapRef - A reference to a tempo map, carrying its id and constant tempo.
- Tick
Time - A point in musical time measured in ticks at a given resolution.
- Time
Grid - Timing grid for a piano roll.
- Time
Range - A half-open span of ticks
[start, end). - Timed
Atom - A single flattened atom together with its absolute onset time.
- Timed
Note - A note placed at an absolute onset time.
- Trace
Event - A trace / debugging step marker on a lane.
Enums§
- Ambiguous
Conversion Policy - Explicit choice used when a target cannot represent every simultaneous line.
- Articulation
- Performance articulation applied to a note.
- AtomRef
- A leaf event produced when a MusicObject is flattened into voices.
- Channel
Message - A MIDI channel-voice message, carrying its target
Channeland payload. - Conversion
Error - Error raised when a requested conversion cannot honor its explicit policy.
- Conversion
Loss Kind - Machine-readable kind of information a conversion could not carry.
- Determinism
Policy - How reproducible a component’s output is.
- Lane
Kind - Category of content carried by a lane.
- Lane
Target - Destination a lane routes its events to.
- Melody
Item - One element of a monophonic Melody: either a note or a rest.
- Midi
Payload - The payload of a
MidiEvent: one of the four event families. - Music
- The unified musical value: any node that can appear in a Score body.
- Music
Capability - A capability a music component advertises to the runtime.
- Music
Change - One identity-bearing change in a score event stream.
- Music
Component Category - The broad category a music component belongs to.
- Music
Error - Error returned when a musical value violates a model invariant.
- Music
Port Direction - The direction of a component port relative to the component.
- Music
Unit - The unit a parameter value is measured in.
- Param
Value - Typed value for a player parameter snapshot entry.
- Performance
Intent - A single live-performance gesture.
- Piano
Roll Cell - A single placed event in a piano roll lane.
- Pitch
Error - Error returned when a pitch, pitch class, or interval cannot be constructed or parsed.
- Pitch
Remap - Pitch remapping applied after a placement’s transforms.
- Placement
Transform - Pitch or time transform applied to a placement’s notes.
- Play
Event - A single scheduled event on a lane, tagged by its content kind.
- Playable
Ref - Reference to the playable material a placement renders.
- Player
Mode - How a chain device combines its output with the events flowing through it.
- Score
Form - Catalog score representations supported by
convert_score. - Score
Form Kind - Target representation for a catalog conversion.
- Site
Hint - Hint about the execution site a render is expected to run on.
- Stretch
Policy - Time-scaling policy applied to a placement.
- Trace
Action - The kind of action a player chain took on an event, as traced.
- Trace
Policy - Tracing verbosity for a placement during rendering.
Statics§
- RECIPES
- Cookbook recipes for this lib, embedded at build time.
Traits§
- Music
Object - A playable musical structure that can report its span and flatten to atoms.
- Performance
Source - A live performance source that turns inputs into events and captures takes.
- Playable
- Object that can describe, render, and freeze itself into play events.
Functions§
- arpeggio_
lab_ player_ descriptor - Returns the descriptor for the Arpeggio Lab player.
- arpeggio_
lab_ player_ id - Returns the registry id of the arpeggio-lab player.
- automation_
curve_ modulator_ descriptor - Returns the descriptor for the automation curve modulator.
- automation_
curve_ modulator_ id - Returns the registry id of the automation-curve modulator.
- bassline_
player_ descriptor - Returns the descriptor for the Bassline Generator player.
- bassline_
player_ id - Returns the registry id of the bassline-generator player.
- beat_
map_ player_ descriptor - Returns the descriptor for the Beat Map player.
- beat_
map_ player_ id - Returns the registry id of the beat-map player.
- chord_
sequencer_ player_ descriptor - Returns the descriptor for the Chord Sequencer player.
- chord_
sequencer_ player_ id - Returns the registry id of the chord-sequencer player.
- convert_
score - Converts any catalog score form to any other through the identity-bearing staff.
- default_
instrument_ descriptor - Returns the descriptor for the default instrument.
- default_
music_ component_ registry - Builds a registry populated with every built-in music component descriptor.
- drum_
key_ map_ player_ descriptor - Returns the descriptor for the Drum Key Map player.
- drum_
key_ map_ player_ id - Returns the registry id of the drum-key-map player.
- dual_
arpeggio_ player_ descriptor - Returns the descriptor for the Dual Arpeggio player.
- dual_
arpeggio_ player_ id - Returns the registry id of the dual-arpeggio player.
- envelope_
modulator_ descriptor - Returns the descriptor for the envelope modulator.
- envelope_
modulator_ id - Returns the registry id of the envelope modulator.
- euclid_
player_ descriptor - Returns the descriptor for the Euclidean Drums player.
- euclid_
player_ id - Returns the registry id of the euclid player.
- keyboard_
performance_ source_ descriptor - Returns the descriptor for the keyboard performance source.
- lfo_
modulator_ descriptor - Returns the descriptor for the LFO modulator.
- lfo_
modulator_ id - Returns the registry id of the LFO modulator.
- music_
browse_ card_ expr - Builds the browse card expression for
subjectfrom the registry. - music_
browse_ symbols - Lists the registered component ids exposed to the browse surface.
- music_
component_ card - Renders the full browse card for a single registry entry.
- music_
component_ card_ class_ symbol - Returns the class symbol for music component cards.
- music_
component_ descriptor_ class_ symbol - Returns the class symbol for music component descriptors.
- music_
component_ registry_ class_ symbol - Returns the class symbol for the music component registry.
- note_
echo_ player_ descriptor - Returns the descriptor for the Note Echo player.
- note_
echo_ player_ id - Returns the registry id of the note-echo player.
- oscillator_
modulator_ descriptor - Returns the descriptor for the oscillator modulator.
- oscillator_
modulator_ id - Returns the registry id of the oscillator modulator.
- parse_
pitch - Parses a pitch spelling such as
"C4","Eb5", or"Cs4"into aPitch. - pattern_
mutator_ player_ descriptor - Returns the descriptor for the Pattern Mutator player.
- pattern_
mutator_ player_ id - Returns the registry id of the pattern-mutator player.
- performance_
event_ data_ kind - Returns the qualified data-kind symbol for performance-event stream packets.
- play_
event_ data_ kind - Returns the qualified data-kind symbol used for encoded play events.
- polystep_
player_ descriptor - Returns the descriptor for the PolyStep Sequencer player.
- polystep_
player_ id - Returns the registry id of the polystep player.
- quad_
note_ player_ descriptor - Returns the descriptor for the Quad Note Generator player.
- quad_
note_ player_ id - Returns the registry id of the quad-note-generator player.
- random_
walk_ modulator_ descriptor - Returns the descriptor for the random walk modulator.
- random_
walk_ modulator_ id - Returns the registry id of the random-walk modulator.
- render_
music_ events - Renders a music object into clipped, stably ordered note play events.
- scales_
chords_ player_ descriptor - Returns the descriptor for the Scales and Chords player.
- scales_
chords_ player_ id - Returns the registry id of the scales-chords player.
- stable_
event_ order - Sorts events in place into a deterministic order.
- stable_
lane_ order - Sorts lanes deterministically by order, then id, then kind.
- stream_
envelopes - Drains a play stream into transport envelopes over a memory-local profile.
- tempo_
lfo_ descriptor - Returns the descriptor for the Tempo LFO modulator.
- tick_
to_ kernel_ tick - Encodes a tick on a named clock as a kernel
Tickreference. - time_
to_ tick - Converts a musical time in beats to ticks at the given pulses-per-quarter.
Type Aliases§
- Beat
- A musical position or duration measured in beats, as a rational
Time. - Musical
Time - A musical position or duration in beats, as a rational
Time. - Play
Stream - Stream of rendered play items produced by a
Playable. - Tick
- A position or duration in MIDI-style ticks, re-exporting
TickTime. - Time
- Exact musical time measured in whole notes as a rational number of beats.