The key the line is written in; a key name such as 'C major' is read as that key.
OptionalchordChord the downbeats are pulled to, if any; it may be written as a chord symbol as well as given as chord data.
Length of the motif in bars of ts.
OptionaltsMeter the bars are counted in. It sets the bar length, so a motif shares a bar grid with the other generators instead of assuming four beats.
OptionalcontourMelodic contour shape the line follows.
OptionaljitterProbability in [0, 1] that a note is nudged by a single diatonic step. The nudge direction is balanced (up or down with equal odds), so it adds variety without biasing the line off its contour. Default 0, which reproduces the requested contour exactly (no drift, tails return to tonic).
Sugar for ctx: { complexity: { ornament } } — a nudge off the contour is
decoration rather than rhythm; the context wins where both are given. Being
the same dial, it takes the same values: one outside [0, 1] is rejected here
exactly as it is there, rather than being folded to the nearest end.
OptionalctxThe generation context. Its complexity.ornament is this generator's
jitter, and its seed fixes which notes are nudged.
Options controlling generateMotif.