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

    Function resolveContext

    • Resolve a context (or a bare seed) into the form the generators use.

      The algorithm version takes part in every derivation, so two versions never share a draw: pinning one is what makes a saved project reopen as the piece it was, and a version this build does not produce is rejected rather than quietly rendered as another.

      Parameters

      Returns ResolvedContext

      The resolved context.

      If the seed is not a 32-bit integer, a dial is out of range, the tempo is not positive, or the algorithm version is unknown.

      import { resolveContext } from '@libraz/libcantus';
      const ctx = resolveContext({ seed: 42, complexity: { rhythmic: 0.8 }, bpm: 96 });
      ctx.part('drums').prob(0.5, 'ghost', 1, 2); // the same answer however often it is asked