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

    Function isScaleTone

    • Test whether a pitch belongs to the scale.

      Parameters

      • pitch: number

        MIDI pitch or bare pitch class.

      • key: KeyLike

        The key/scale to test against, as a key name, a key/scale, or a Key.

      Returns boolean

      True if the pitch class is a member of the scale.

      import { majorKey, isScaleTone } from '@libraz/libcantus';
      const key = majorKey(0); // C major
      isScaleTone(64, key); // true — E is in C major
      isScaleTone(61, key); // false — C# is not