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

    Function isConsonantInterval

    • Test whether an interval is consonant.

      The consonant set is {0, 3, 4, 5, 7, 8, 9} mod 12. In two-voice counterpoint the perfect fourth (5) is treated as a dissonance, so twoVoice set to true excludes it.

      Parameters

      • semitones: number

        Interval size in semitones (may be negative or compound).

      • twoVoice: boolean = true

        When true, the perfect fourth is treated as dissonant.

      Returns boolean

      True if the interval is consonant in the given context.