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

    Function includeAt

    • Whether the event at a position belongs in the output at a given complexity.

      The test is at(...path) < complexity, and because the draw is fixed by the position, the selected set grows monotonically with complexity: for any c1 < c2 the events at c1 are a subset of the events at c2 over the same seed and the same path space. Complexity 0 selects nothing and complexity 1 selects everything.

      Parameters

      • rng: PositionalRng

        The positional source; may be a caller-supplied one.

      • complexity: number

        The dial, in [0, 1].

      • ...path: SeedPath

        The position to test.

      Returns boolean

      True when the position is included.

      If the complexity is outside [0, 1], or the source returns a value outside [0, 1).

      import { createPositionalRng, includeAt } from '@libraz/libcantus';
      const rng = createPositionalRng(7);
      includeAt(rng, 0.3, 'ghost', 4, 2.5); // raising 0.3 only adds hits