@libraz/libcantus - v0.9.3
    Preparing search index...

    Function isScaleTone

    • Test whether a pitch belongs to the scale.

      Parameters

      • pitch: number

        MIDI pitch or bare pitch class.

      • key: KeyScale

        The key/scale to test against.

      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