Skip to main content

Crate sim_lib_music_core

Crate sim_lib_music_core 

Source
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 and time grid, 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.
ArrangerDiagnostic
Diagnostic raised while rendering a placement.
ArrangerPlacement
Single placement of playable material at a point on the arranger timeline.
ArrangerRender
Result of rendering an Arranger: play events plus diagnostics.
AudioEvent
An audio-frame event covering a span of frames.
AutomationCell
An automation breakpoint targeting a named parameter.
ChainDevice
A single processing stage in a player chain.
ChainPlacement
Placement of a chain device: where it runs and under what rate profile.
ChainPlacementPlan
Plan listing the placement of every device in a chain.
ChainRender
Result of rendering a chain: the output events and their trace records.
ChainTraceRecord
A single trace record describing one action in a player chain.
Channel
A MIDI channel number in the range 0..=15.
ChannelPressureCell
A MIDI channel-pressure (aftertouch) cell.
Chord
A set of pitches sounded together, optionally tagged with a chord symbol.
ControlChangeCell
A MIDI control-change cell.
ControlEvent
A control-change event setting a named control to a value.
Counterpoint
Several independent melodic lines sounding together with labels.
DiagnosticEvent
A diagnostic message emitted on a lane.
DirectRecording
A directly captured render: metadata plus its events and traces.
DrumCell
A drum hit cell addressed by MIDI key.
FilterRef
Lane filter that keeps a placement only when its lane is retained.
FreezeMeta
Reproducibility metadata for a frozen player chain.
FrozenPlayable
Fully rendered snapshot of a Playable with a content hash.
FrozenPlayerChain
A frozen player chain: cached render output keyed by its FreezeMeta.
HeldPerformanceNote
A note currently held down at a source.
LaneDescriptor
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.
MemoryPerformanceSource
An in-memory PerformanceSource holding state and an optional capture.
MidiEvent
A timestamped MIDI event with provenance.
MidiFileObj
A complete Standard MIDI File wrapped as a music object.
MidiPlayEvent
A raw MIDI event bound to a lane.
MidiTrackObj
A raw MIDI track wrapped as a music object.
MusicComponentCitizenDescriptor
Runtime citizen wrapper around a MusicComponentDescriptor.
MusicComponentDescriptor
Full description of a music component: its identity, category, capabilities, ports, lanes, parameters, and behavioral contracts.
MusicComponentRegistry
An ordered collection of music components keyed by qualified id.
MusicComponentRegistryEntry
A single registered music component, wrapping its descriptor.
MusicParamDescriptor
Describes a single configurable parameter of a music component.
MusicPortDescriptor
Describes a single input or output port of a music component.
Note
A single pitched note with timing, dynamics, and articulation.
NoteEvent
A pitched note with duration, velocity, and channel.
ObjectCell
A cell that places a named runtime object on a lane.
Par
Parallel composition: children that sound simultaneously.
ParamSnapshot
Sorted, deduplicated snapshot of named player parameters.
PerformanceEvent
A performance-intent event tying a rendered time back to its input.
PerformanceInput
A raw performance gesture submitted to a source at a given input time.
PerformanceInputBinding
Binds a named performance input to a lane and channel.
PerformanceNoteKey
Identity key for a held note, combining channel and pitch.
PerformanceSourceState
Mutable performance state tracked by a source.
PerformanceTake
A captured recording of performance events with a content-addressed cassette.
PianoRoll
A piano roll: a set of timed lanes over a shared timing grid.
PianoRollLane
A single lane of a piano roll holding cells of one kind.
Pitch
An octave-aware pitch: a PitchClass together with an octave number.
PitchBendCell
A MIDI pitch-bend cell.
PitchClass
A mod-12 pitch class, where C = 0 and values increase by semitone to B = 11.
PitchEvent
A bare pitch event without duration or velocity.
PlacedChainDevice
Pairing of a device id with its resolved placement.
PlayContext
Rendering context handed to a Playable during prepare/render/freeze.
PlayableDescriptor
Static description of a Playable: its identity, lanes, and clocking.
PlayableEvent
A reference to a named playable to trigger.
PlayableShape
Shape record describing the playable protocol surface.
PlayerChain
A source music object plus an ordered chain of devices and an output target.
PlayerDeviceId
Stable identifier for a device within a player chain.
PlayerTargetDescriptor
Descriptor of a chain’s output target and its rate contract.
PolyPressureCell
A MIDI polyphonic key-pressure cell.
Progression
An ordered sequence of chords, optionally in a named key.
Rest
A span of silence.
ScaleDegreeCell
A note addressed by scale degree and octave rather than absolute pitch.
ScaleLock
A set of allowed pitch classes that incoming notes are snapped to.
Score
A top-level score: global settings plus a musical body.
Seq
Sequential composition: children that play one after another.
SmfFile
A parsed Standard MIDI File: its format, resolution, and tracks.
SourceRecording
Identifying record for a recorded source, without its rendered output.
TempoMapRef
A reference to a tempo map, carrying its id and constant tempo.
TickTime
A point in musical time measured in ticks at a given resolution.
TimeGrid
Timing grid for a piano roll.
TimeRange
A half-open span of ticks [start, end).
TimedAtom
A single flattened atom together with its absolute onset time.
TimedNote
A note placed at an absolute onset time.
TraceEvent
A trace / debugging step marker on a lane.

Enums§

Articulation
Performance articulation applied to a note.
AtomRef
A leaf event produced when a MusicObject is flattened into voices.
ChannelMessage
A MIDI channel-voice message, carrying its target Channel and payload.
DeterminismPolicy
How reproducible a component’s output is.
LaneKind
Category of content carried by a lane.
LaneTarget
Destination a lane routes its events to.
MelodyItem
One element of a monophonic Melody: either a note or a rest.
MidiPayload
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.
MusicCapability
A capability a music component advertises to the runtime.
MusicComponentCategory
The broad category a music component belongs to.
MusicError
Error returned when a musical value violates a model invariant.
MusicPortDirection
The direction of a component port relative to the component.
MusicUnit
The unit a parameter value is measured in.
ParamValue
Typed value for a player parameter snapshot entry.
PerformanceIntent
A single live-performance gesture.
PianoRollCell
A single placed event in a piano roll lane.
PitchError
Error returned when a pitch, pitch class, or interval cannot be constructed or parsed.
PitchRemap
Pitch remapping applied after a placement’s transforms.
PlacementTransform
Pitch or time transform applied to a placement’s notes.
PlayEvent
A single scheduled event on a lane, tagged by its content kind.
PlayableRef
Reference to the playable material a placement renders.
PlayerMode
How a chain device combines its output with the events flowing through it.
SiteHint
Hint about the execution site a render is expected to run on.
StretchPolicy
Time-scaling policy applied to a placement.
TraceAction
The kind of action a player chain took on an event, as traced.
TracePolicy
Tracing verbosity for a placement during rendering.

Statics§

RECIPES
Cookbook recipes for this lib, embedded at build time.

Traits§

MusicObject
A playable musical structure that can report its span and flatten to atoms.
PerformanceSource
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.
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 subject from 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 a Pitch.
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 Tick reference.
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.
MusicalTime
A musical position or duration in beats, as a rational Time.
PlayStream
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.