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

    Function avoidNotes

    • List a scale's avoid notes over a chord.

      An avoid note is a non-chord scale tone that lies a semitone directly above a chord tone, or the third a suspension displaced; sounding it against the chord clashes. The scale is rooted on the chord root. If the scale does not contain the chord, no avoid notes exist.

      The rule states which tones must not be sounded against the chord, which is not the same question as which tones a line may not touch. Pass { use: 'melodic' } for the melodic reading: only the semitone above the root survives it, so the result is always a subset of the harmonic one.

      Parameters

      • chord: ChordLike

        The chord providing the chord tones, as a chord symbol, chord data, or a Chord.

      • scaleName: ScaleNameInput

        A key of NAMED_SCALES, or an alias of one. A world scale is not one: chord-scale theory is a Western practice, so a raga named here is rejected rather than answered with a number.

      • opts: AvoidNotesOptions = {}

        Set use: 'melodic' to judge a line rather than a voicing.

      Returns number[]

      The avoid-note pitch classes, sorted ascending in [0, 11].

      If scaleName is not a built-in scale. An empty result already means "this scale has no avoid notes over this chord"; answering a typo the same way would make the two indistinguishable.

      import { makeChord, avoidNotes } from '@libraz/libcantus';
      avoidNotes(makeChord(0, 'maj7'), 'ionian'); // [5] — F clashes with the third
      avoidNotes(makeChord(0, 'maj7'), 'ionian', { use: 'melodic' }); // [] — a line may pass through it