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

    Type Alias GenerationContext

    Everything a generator needs that is not about the notes themselves.

    type GenerationContext = {
        seed?: number;
        complexity?: Complexity;
        rng?: PositionalRng;
        instruments?: Record<string, InstrumentProfile>;
        bpm?: number;
        algorithmVersion?: number;
        vocabulary?: readonly Vocabulary<unknown>[];
    }
    Index
    seed?: number

    The project seed every part derives its own randomness from. Optional, and zero when left out: a context naming only a tempo is a whole request, and requiring the seed beside it would make the commonest context unwritable now that it is the only place a seed can go.

    complexity?: Complexity

    The dials; see Complexity.

    Draw from this source instead of one derived from seed. Each part still addresses its own namespace, so parts do not collide.

    instruments?: Record<string, InstrumentProfile>

    The instruments the parts are written for, keyed by part name — 'bass', 'drums'. Naming one is itself the request that the part be playable on it, so its range and physical limits always apply.

    bpm?: number

    Tempo in quarter-note beats per minute. Without it no generator can judge whether a passage is reachable in the time available, so a ceiling on difficulty has nothing to measure against.

    algorithmVersion?: number

    The algorithm version to generate under; defaults to the version this build produces. See resolveAlgorithmVersion for what the number promises.

    vocabulary?: readonly Vocabulary<unknown>[]

    Figures this piece may draw on, over and above the library's own.

    Genres are endless, which is the reason the vocabulary is data at all: a caller brings the dictionary for the music it is writing instead of waiting for the library to grow one. Entries for every part travel in one list — each generator recognises its own material by shape — and an entry carrying the id of a built-in replaces it rather than being offered alongside.