Universal Music Theory Library - v0.12.0
    Preparing search index...

    Class Counterpoint

    Checks counterpoint rules for a given species. cf = cantus firmus notes; counter = counterpoint notes. Notes should be in the same tuning system. Intervals are read in 12-TET semitones (notes of other tunings at their nearest semitone).

    Index

    Constructors

    Methods

    Constructors

    Methods

    • Validates a counterpoint voice against a cantus firmus.

      The counterpoint is given on a grid of slots per cantus firmus note: 1 (1st species), 2 (2nd), 4 (3rd), 2 (4th: slot 1 is the tied-over note, slot 2 the new one) and 4 (5th: a longer note repeats its pitch in the following slots; a tie is a repeated pitch across the bar line).

      • Strong slots (the first of each measure) must be consonant, except a suspension in the 4th and 5th species: prepared (same pitch in the slot before, consonant there) and resolved down by step to a consonance.
      • Weak slots: a dissonance must be a passing or neighbour note (approached and left by step); in the 4th species weak slots are consonant.
      • Parallel 5ths and octaves between consecutive strong slots; hidden 5ths and octaves in the 1st species; unison only at the start and end.

      Parameters

      • species: 1 | 2 | 3 | 4 | 5

        1 | 2 | 3 | 4 | 5

      • cf: Note[]

        Cantus firmus notes (one per measure).

      • counter: Note[]

        Counterpoint notes on the slot grid above.

      • Optionalmode: string

        Optional mode, on its white-key finalis ("dorian" = D) or transposed ("G dorian"): dorian, phrygian, lydian, mixolydian, aeolian, ionian, locrian. Enables modal checks: finalis (CF must start and end on it), ambitus (counterpoint within [-7, +15] semitones of the finalis), and melodic tritone detection.

      Returns CounterpointIssue[]