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

    Function vocabularyOfKind

    • Narrow a mixed dictionary to the entries one part understands.

      A context carries a single list, because a caller thinks in terms of "the vocabulary of this piece" rather than of one list per generator. Each generator recognises its own material by shape, so an entry meant for the bass is invisible to the drums instead of being mis-read by it.

      Type Parameters

      • T

      Parameters

      • entries: readonly Vocabulary<unknown>[]

        The mixed dictionary.

      • isMaterial: (material: unknown) => material is T

        Guard recognising one kind of material.

      Returns Vocabulary<T>[]

      The entries whose material the guard accepts.