Expand description
Music transformation layer for the SIM music constellation.
This crate applies transformations to musical material: classic operations
such as transpose, invert, retrograde, augment, and diminish; configurable
pitch and time remaps; pattern mutators; and a capability-gated custom event
filter pipeline. Transforms read a MusicObject into a canonical
PianoRoll and return new Music, optionally paired with diagnostics in a
TransformReport.
Structs§
- Callable
Filter Definition - A named, reusable filter definition stored in a registry.
- Callable
Filter Ref - A by-name reference to a registered callable filter.
- Callable
Filter Registry - Lookup table of
CallableFilterDefinitionvalues by name. - Callable
Pitch Map - Named pitch map that applies a fixed chromatic offset to each pitch.
- Custom
Filter - A declared, capability-gated event filter with input/output shapes.
- Custom
Filter Run - Output of evaluating a custom filter: produced events and traces.
- Custom
Filter Trace - A single recorded step of a custom filter’s evaluation.
- Custom
Pitch Axis - Named inversion axis carrying an explicit pitch.
- Filter
Capability Set - An ordered set of
FilterCapabilitygrants. - Filter
Context - Runtime grants and seed supplied when evaluating a custom filter.
- Filter
Rule - A
when -> oprule: an operation applied to matching events. - Filter
Shape - The set of lane kinds a filter port accepts.
- Function
MapRegistry - Lookup table of
FunctionMapvalues addressed by name. - IntMatrix
- Integer 2x3 affine matrix mapping
(degree, octave, 1)to a new pitch. - Invert
Transform - Inversion transform that mirrors pitch about a
PitchAxis. - Pattern
Lock Set - Set of source note indices held fixed (locked) during mutation.
- Pattern
Mutator Config - Configuration describing a sequence of pattern mutations and their controls.
- Pattern
Mutator Player - Player that applies a
PatternMutatorConfigto incoming material. - Retrograde
Transform - Retrograde transform that reverses material under a
RetrogradeMode. - Time
MapPoint - One
(input -> output)breakpoint in a piecewise-linear time map. - Transform
Chain - An ordered pipeline of
TransformStepvalues applied in sequence. - Transform
Diagnostic - A single diagnostic emitted by a transform, tagged with its origin.
- Transform
Report - Result of a transform: the produced music plus any diagnostics raised.
- Transpose
Transform - Transpose transform that shifts pitch by a
PitchDelta. - Tuning
Remap - Microtonal tuning offset expressed in cents.
- Warp
Marker - A warp anchor pairing a source time with its target time.
Enums§
- Custom
Filter Error - Error raised while building or evaluating a custom filter.
- Determinism
Policy - Determinism contract a custom filter promises to honor.
- Filter
Body - The evaluable body of a
CustomFilter. - Filter
Capability - A permission a custom filter must hold to perform a class of operations.
- Filter
Op - An operation a
FilterRuleperforms on a matching event. - Filter
Predicate - Condition selecting which events a
FilterRuleacts on. - Filter
Trace Action - The kind of action recorded in a
CustomFilterTrace. - Function
Map - Named diatonic function (mode) used to remap scale degrees onto pitches.
- Mutation
Op - A single mutation operation applied to a pattern’s notes.
- Pattern
Mutator Error - Error raised while parsing or validating a pattern mutator.
- Pitch
Axis - Specification of the axis an
InvertTransformmirrors about. - Pitch
Delta - Amount and kind of pitch displacement for a transpose transform.
- Pitch
Remap - A pitch remapping strategy applied note by note across material.
- Retrograde
Mode - Strategy for placing notes when reversing material in time.
- Stretch
Policy - Strategy for stretching or warping material along the time axis.
- Transform
Diagnostic Code - Classification of a problem a transform encountered while running.
- Transform
Error - Error returned by transforms that reject invalid scaling factors.
- Transform
Step - A single step in a
TransformChain, wrapping one transform kind.
Functions§
- augment
- Lengthens every onset and duration by
factor(time augmentation). - chord_
tones_ in - Snaps every note to the nearest pitch belonging to the given scale.
- diminish
- Shortens every onset and duration by
factor(time diminution). - ensure_
custom_ filter_ codec - Checks that a codec name is supported by the custom filter surface.
- lane_
kind_ from_ wire - Parses a lane kind from its wire label, if recognized.
- loop_n
- Repeats the material
ntimes back to back along the time axis. - map_
to_ function - Remaps each in-key note to the same scale degree under another function.
- mutate_
pattern - Applies a
PatternMutatorConfigto material and returns the mutated music. - pitch_
class_ name - Returns the canonical name of a pitch class.
- pitch_
invert - Inverts every note’s pitch about the given axis pitch.
- player_
mutator - Builds a
PatternMutatorPlayerfrom a mutator configuration. - quarter
- Returns the
Timevalue for one quarter note (1/4). - retrograde
- Reverses the material in time using the default
RetrogradeMode::Cutout. - retrograde_
invert - Applies
pitch_invertthenretrograde(retrograde inversion). - retrograde_
with_ mode - Reverses the material in time using the given
RetrogradeMode. - shift_
octave - Shifts every note by the given number of whole octaves.
- silence
- Builds a
Restspanning the given duration. - simple_
melody - Builds a single-voice
Melodyfrom(MIDI key, duration)pairs. - slice
- Extracts the
[start, end)time window, clipping note spans to the bounds. - time_
invert - Mirrors note onsets about the total duration, then rebases to start at zero.
- transpose
- Transposes every note chromatically by the given number of semitones.
- transpose_
diatonic - Transposes every note by
stepsscale degrees within the given scale.