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

    Type Alias Draw

    The samplers a generator needs, each addressed by the position it is drawing for rather than by how many draws came before it.

    Every method is a pure function of the source and the path: asking twice gives the same answer, asking in a different order changes nothing, and a position nobody asks about costs nothing. That is what lets a caller change one parameter — or one bar — without redrawing the rest of the piece.

    type Draw = {
        at: (...path: SeedPath) => number;
        prob: (p: number, ...path: SeedPath) => boolean;
        range: (lo: number, hi: number, ...path: SeedPath) => number;
        float: (lo: number, hi: number, ...path: SeedPath) => number;
    }
    Index
    at: (...path: SeedPath) => number

    The raw draw at a position: a float in [0, 1).

    prob: (p: number, ...path: SeedPath) => boolean

    Whether an event of probability p happens at a position. Because the underlying draw is fixed by the path, raising p only ever turns more positions on.

    range: (lo: number, hi: number, ...path: SeedPath) => number

    An integer in the inclusive range [lo, hi] at a position.

    float: (lo: number, hi: number, ...path: SeedPath) => number

    A float in [lo, hi) at a position.