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

    Function classifySpelledInterval

    • Classify a spelled interval by consonance, the way a counterpoint exercise reads it.

      The spelling decides, not the semitone count: a diminished fourth is a dissonance though it sounds like a major third, and an augmented fifth is a dissonance though it sounds like a minor sixth. Only the perfect unison, fifth and octave and the major and minor thirds and sixths are consonant. The perfect fourth is context-dependent exactly as in classifyInterval.

      Parameters

      • interval: SpelledInterval

        The spelled interval between the two voices.

      • twoVoice: boolean = true

        When true, the perfect fourth counts as a dissonance.

      Returns ConsonanceClass

      The counterpoint quality of the interval.

      import { classifySpelledInterval, ConsonanceClass, parseInterval } from '@libraz/libcantus';
      classifySpelledInterval(parseInterval('d4')); // ConsonanceClass.Dissonance
      classifySpelledInterval(parseInterval('M3')); // ConsonanceClass.ImperfectConsonance