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

    Type Alias Complexity

    How involved the generated music should be, on axes that do not imply one another.

    The first three ask for more of something and are continuous: moving one of them adds material without disturbing what is already sounding. Complexity.difficulty is not one of those — it is a ceiling, and it only ever takes candidates away.

    type Complexity = {
        rhythmic?: number;
        harmonic?: number;
        ornament?: number;
        difficulty?: number;
    }
    Index
    rhythmic?: number

    Subdivision and syncopation, in [0, 1].

    harmonic?: number

    Tension, substitution and passing chords, in [0, 1].

    ornament?: number

    Ghosts, flams and decoration, in [0, 1].

    difficulty?: number

    The hardest the result may be to play, from 1 (a beginner's part) to 5 (at the limit of the instrument). It is a ceiling rather than a strength: "involved but easy" and "plain but hard" are both real requests, so this filters what the other three proposed instead of scaling it. It governs the timing layer alone — whether the note exists on the instrument, and whether the shape can be held, follow from GenerationContext.instruments and apply whatever the ceiling says.