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

    Function assertModeMask

    • Require a twelve-bit mode mask, and return it.

      A mask is read with bit operations, and those coerce: a null reads as the empty mask, an object as zero. Every answer taken from a mask is a musical claim — which form a key stands in, whether its signature is its own, which system it belongs to — so a value that is not a mask has to be refused rather than answered, and it is refused in one place so the answers cannot disagree about what a mask is.

      Parameters

      • modeMask12: number

        The value to check.

      • name: string = 'modeMask12'

        What the value is, for the error message.

      Returns number

      The mask.

      If it is not an integer in [1, CHROMATIC_MASK].

      import { assertModeMask, MAJOR_MASK } from '@libraz/libcantus';
      assertModeMask(MAJOR_MASK); // 2741