Mode Detection for Square Script - ECHOES-from-the-Past/PAM GitHub Wiki

FUTURE - Details (More Nuanced View)

Based on notes from Manuel Pedro Ferreira about recent scholarship regarding mode detection, the parameter of "range" is not as important as once considered. Based on his notes, these would be the new things to implement according to a more modern, nuanced view:

  • 1st mode

    • The last note is D
    • The pitch range is D-D The pitch range can include notes above A
    • The most repeated pitch should be A
  • 2nd mode

    • The last note is D
    • The pitch range is A-A The pitch range should exclude notes above A (except in the case of ornamental notes)
    • The most repeated pitch should be F The most repeated pitch should be F (or, occasionally, G)
  • 3rd mode

    • The last note is E
    • The pitch range is E-E The pitch range can include notes above B
    • The most repeated pitch should be C (or, occasionally, B)
  • 4th mode

    • The last note is E
    • The pitch range is B-B The pitch range should exclude notes above B (except in the case of ornamental notes)
    • The most repeated pitch should be A
  • 5th mode:

    • The last note is F
    • The pitch range is F-F The pitch range can include notes above C
    • The most repeated pitch should be C
  • 6th mode:

    • The last note is F
    • The pitch range is C-C The pitch range should exclude notes above C (except in the case of ornamental notes)
    • The most repeated pitch should be A
  • 7th mode:

    • The last note is G
    • The pitch range is G-G The pitch range can include notes above D
    • The most repeated pitch should be D The most repeated pitches should be C and D
  • 8th mode:

    • The last note is G
    • The pitch range is D-D The pitch range should exclude notes above D (except in the case of ornamental notes)
    • The most repeated pitch should be C

Summary

Finalis Are Notes Above the 5th Allowed? Most Frequent Pitch Pitch Repeated in Succession Results in Mode
D TRUE (A) 5th (A) -- Mode 1
D FALSE (A), except ornamental 3rd (F) or ocassionally 4th (G) -- Mode 2
E TRUE (B) 6th (C) or occasionally 5th (B) -- Mode 3
E FALSE (B), except ornamental 4th (A) -- Mode 4
F TRUE (C) 5th (C) -- Mode 5
F FALSE (C), except ornamental 3rd (A) -- Mode 6
G TRUE (D) 5th (D) AND 4th (C) -- Mode 7
G FALSE (D), except ornamental 4th (C) -- Mode 8

CURRENT STATE - Details

  • 1st mode

    • The last note is D
    • The pitch range is D-D
    • The most repeated pitch should be A
  • 2nd mode

    • The last note is D
    • The pitch range is A-A
    • The most repeated pitch should be F
  • 3rd mode

    • The last note is E
    • The pitch range is E-E
    • The most repeated pitch should be C (or, occasionally, B)
  • 4th mode

    • The last note is E
    • The pitch range is B-B
    • The most repeated pitch should be A
  • 5th mode:

    • The last note is F
    • The pitch range is F-F
    • The most repeated pitch should be C
  • 6th mode:

    • The last note is F
    • The pitch range is C-C
    • The most repeated pitch should be A
  • 7th mode:

    • The last note is G
    • The pitch range is G-G
    • The most repeated pitch should be D
  • 8th mode:

    • The last note is G
    • The pitch range is D-D
    • The most repeated pitch should be C

CURRENT STATE - Implementation

This section outlines the heuristics behind predicting the mode and providing a percentage of certainty. To obtain the mode and its percentage of certainty, we check the following features:

  1. finalis
  2. ambitus (expected rangę based on the finals)
  3. expected repercussio (expected "most repeated note" based on the finalis)

1. Finalis

The finalis gives us with two possible modes (authentic and plagal), providing us with two possible "expected repercussio" notes and two possible ambitus (as indicated in the following table). We will evaluate these two features, repercussio and range, independently from one another (see steps 2 and 3, respectively) and combine the results at the end.

Finalis Authentic mode Plagal mode
D 1st mode with ambitus D-D (almost all notes are above the D finalis) and repercussio A 2nd mode with ambitus A-A (notes lie above and below the finalis) and repercussio F
E 3rd mode with ambitus E-E (almost all notes are above the E finalis) and repercussio C or B 4th mode with ambitus B-B (notes lie above and below the finalis) and repercussio A
F 5th mode with ambitus F-F (almost all notes are above the F finalis) and repercussio C 6th mode with ambitus C-C (notes lie above and below the finalis) and repercussio A
G 7th mode with ambitus G-G (almost all notes are above the G finalis) and repercussio D 8th mode with ambitus D-D (notes lie above and below the finalis) and repercussio C

The finalis won't contribute to the a percentage of certainty. This percentage will only depend on the independent features of ambitus and repercussio, each of them will contribute 50% each to the final percentage as indicated by the heuristic below.

2. Ambitus

Calculate the percentage of the notes in the ambitus for both authentic and plagal versions of the mode. Then divide by two.

  • Authentic: Percentage in authentic range (Max. 100%)
  • Plagal: Percentage in plagal range (Max. 100%)

3. Repercussio

Calculate the percentage for the repercussio by using this heuristics for the following cases:

  • Authentic

    i. If the expected repercussio note is the most repeated note: 100%

    ii. If the expected repercussio note is the second most repeated note after the finalis: 75%

    iii. If the expected repercussio note is the second most repeated note after a note other than the finalis: 50%

    iv. If the expected repercussio note is the third most repeated note: 25%

    v. If the expected repercussio note is the fourth most repeated note: 12.5%

  • Plagal

    i. If the expected repercussio note is the most repeated note: 100%

    ii. If the expected repercussio note is the second most repeated note after the finalis: 75%

    iii. If the expected repercussio note is the second most repeated note after a note other than the finalis: 50%

    iv. If the expected repercussio note is the third most repeated note: 25%

    v. If the expected repercussio note is the fourth most repeated note: 12.5%

Final probability of authentic and plagal

The final probability of the authentic and plagal modes is the average of the probability given by the ambitus and the one given by the repercussio:

  • Probability of authentic = (auth_ambitus + auth_repercussion) / 2 (max. 100%)
  • Probability of plagal = (plag_ambitus + plag_repercussion) / 2 (max. 100%)

The highest probability will be shown with that mode in the table. While the whole set of four percentages will be shown in the “Mode Description” field of the "Chant Information" panel.