@libraz/libcantus - v1.1.0
    Preparing search index...

    Type Alias MotifOptions

    Options controlling generateMotif.

    type MotifOptions = {
        key: KeyLike;
        chord?: ChordLike | null;
        bars: number;
        ts?: MeterLike;
        contour?: MotifContour;
        jitter?: number;
        ctx?: GenerationContextInput;
    }
    Index
    key: KeyLike

    The key the line is written in; a key name such as 'C major' is read as that key.

    chord?: ChordLike | null

    Chord the downbeats are pulled to, if any; it may be written as a chord symbol as well as given as chord data.

    bars: number

    Length of the motif in bars of ts.

    Meter 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.

    4/4
    
    contour?: MotifContour

    Melodic contour shape the line follows.

    'arch'

    jitter?: number

    Probability 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.

    0
    

    If it is not a finite number in [0, 1].

    The generation context. Its complexity.ornament is this generator's jitter, and its seed fixes which notes are nudged.

    { seed: 0 }