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

    Function parseTimeSignature

    • Parse a time signature such as "4/4" or "6/8", or the additive "2+2+3/8".

      Parameters

      • text: string

        The signature text.

      Returns TimeSignature

      The parsed time signature.

      If the text is not n/d with positive integers, or names a signature the library rejects. Use tryParseTimeSignature where failure is ordinary, such as a meter field read on every keystroke.

      import { parseTimeSignature } from '@libraz/libcantus';
      parseTimeSignature('6/8'); // { numerator: 6, denominator: 8 }