Subsequence API reference
Everything subsequence.__all__ lists at the pinned commit, grouped by kind, each linked to its entry.
Classes
Composition- The top-level controller for a musical piece.Motif- An immutable musical figure: timed note events + control gestures + a length in beats.Phrase- A sequence of Motifs with segmentation preserved.Degree- A scale degree — 1-based, resolved against key + scale at placement.ChordTone- An index into the current chord's tones — 1-based, resolved at placement.Approach- A half-step approach into a target pitch at the next chord boundary.MotifEvent- One timed note event inside a Motif.ControlEvent- One timed control gesture inside a Motif: a discrete write or a shaped ramp.Cadence- One cadence formula — a named tail plus its melodic close.Section- One section of a form — the payload home.Form- A frozen sequence of Sections — the editable, bindable form value.Progression- A frozen sequence ofChordSpan— the governing harmony value.ChordSpan- One chord with a duration and its decoration — the unit of harmonic time.PitchSet- A nameless sonority — a frozen set of absolute MIDI pitches.Chord- Represents a chord as a root pitch class and quality.Groove- A timing/velocity template applied to quantized grid positions.MelodicState- Persistent melodic context that applies NIR scoring to single-note lines.Tuning- A microtonal tuning system expressed as cent offsets from the unison.Definitions- The name-to-number tables read from a project definitions file.PlacedNote- One note read back off a pattern being built — seePatternBuilder.placed().
Functions
motif- The lowercase shortcut: a melody as 1-based scale degrees.sentence- The classical sentence, as a thin combinator — idea, idea, drive, close.period- The classical period, as a thin combinator — question, then answer.progression- Build aProgression— the lowercase factory.parse_chord- Parse a chord name like"Cm7"or"Dbmaj7"into aChord.register_chord_quality- Register a custom chord quality for use everywhere chords are used.between- A harmonic rhythm that varies between two lengths (in beats).register_scale- Register a custom scale for use withp.snap_to_scale()andscale_pitch_classes().scale_notes- Return MIDI note numbers for a scale within a pitch range.bank_select- Convert a 14-bit MIDI bank number to (MSB, LSB) for use withp.program_change().load_definitions- Load and validate a project definitions file.sieve- Xenakis sieve: the sorted integers in[lo, hi)in any of the classes.residual_class- A single residual class{x : x % modulus == residue}as aSieve.generators- Describe every generator Subsequence offers, as plain data.describe_generator- Describe one generator's parameters as plain data.transforms- Describe every transform Subsequence offers, as plain data.describe_transform- Describe one transform's parameters as plain data.
Modules
roles- Role parameter bundles — starting points you splat, not a role API.