The notes of the cell, in the order the transforms read them.
Where the cell stops sounding, measured from its own first onset.
A copy of the underlying plain cell.
StaticgenerateGenerate a seed motif.
The line follows the requested contour in diatonic steps from the tonic, snapped to the key; with a chord in hand, the notes landing on bar downbeats are pulled to the nearest chord tone.
Key, chord, length, contour, jitter and context; see MotifGenerateOptions.
The generated motif.
StaticfromRead a run of notes as a motif.
This is how a caller names a cell it already has — a subject lifted out of a score, a phrase a player typed in. Only the fields a motif note carries are kept, so notes that arrived from a score leave their dynamics behind.
The cell, in the order the transforms should read it.
The motif.
StaticfromStaticfromThe cell put through one of the classical transformations.
invert reflects the pitches about the earliest note and retrograde
mirrors the onsets about the cell's span, both self-inverse; augment and
diminish scale the note values by amount and its reciprocal;
transposeChromatic moves by semitones; transposeDiatonic and sequence
move by scale degrees with a key in hand, and by semitones without one.
The result's notes run in time order whichever way the source cell was written, so an inversion of a retrograde reflects about the note that now sounds first.
The transformation.
Optionalamount: number
Semitones, scale degrees, or the time factor, as the transformation reads it.
Optionalkey: KeyLike
Key context for the diatonic transformations: a name, plain key data, or a Key.
The transformed motif.
The cell laid across a span and snapped to the harmony under it.
The cell is tiled back to back to fill the bars asked for; the notes carrying structural weight are pulled to the nearest chord tone of the segment sounding there, and the ones between them are kept in the key.
The harmony to snap against, as a Timeline or the plain chord timeline the analysis layer hands out.
The key the passing notes are kept in.
How many bars to fill.
Meter the bars are counted in, in any form that names one. A motif carries no meter of its own — it is a run of notes — so there is nothing to fall back on, and a development laid on the wrong bar length drifts off the part it plays under.
The developed motif.
How this motif stands to another: the transformation that turns one into the other, named.
The statement to name against this one.
Optionalkey: SpelledKeyLike
Key context for the tonal reading. Without one an answer holding only diatonically is left unnamed unless its interval pattern also fits the retrograde family, in which case it is named there; a motif carries no key of its own, so this is the only way to have the tonal reading offered.
The relation, or null when the two stand in none.
How alike two lines are, in [0, 1].
What Motif.relateTo answers null for still scores here: this is the measure for a variant that adds a passing note or drops one, rather than for the exact transformations.
The line to compare with.
The likeness: 1 for the same line, a transposition of it included.
The cell as a score, so it reaches the rest of the class API.
Optionalopts: ScoreOptions
The meter, tempo and key to read the notes against; see ScoreOptions.
The score holding the cell.
Whether another motif holds the same notes in the same order.
The comparison is made through the other motif's public data, so two motifs built by different copies of the module still compare. The order is part of it: the transformations read the first note of the cell as its pivot, so two cells sounding alike but read from different ends are not the same motif.
The motif to compare.
True when the cells hold the same notes in the same order.
The plain form of the cell, for JSON.stringify.
A short melodic cell, and the transformations that make a piece out of one.
A motif is the smallest thing a composer works with: a handful of notes that come back inverted, in retrograde, a step higher, twice as slow. The library generates one and transforms one, but every step hands back a bare cell that has to be named again on the way into the next, and the key travels beside it by hand. A
Motifcarries the cell, so a subject and its answer are two expressions rather than two variables.The cell holds notes and nothing else: the key it was written in is not part of it, since the same figure is worth restating in another key, and the members that need one are given it.
Example