frmatthew / exsurge

A JavaScript library for rendering Gregorian Chant in square note notation
MIT License
54 stars 13 forks source link

Feature/enhanced diphthong centering #53

Closed bbloomf closed 8 years ago

bbloomf commented 8 years ago

This one, I'm not as certain about, since I think Gregorio will treat any two vowels in a row as a diphthong if the first of the two is neither "i" nor "u". However, according to Wheelock's and this older Latin Grammar, these are the only vowels combinations that occur in Latin as diphthongs.

frmatthew commented 8 years ago

Hmm, I'm not really sure about this either, it's been a while since I've looked at the syllabification logic. My thought is that before merging we should beef up the unit tests in test/index.js. Maybe we can compile a list of words that cover all of the syllabification rules, as well as edge cases, and use that to confirm that these changes give expected results?

On the other hand, I just went to run the tests via npm test and now they're all failing because of the dependency on the browser, so I'll have to look into that...

bbloomf commented 8 years ago

Actually, I wasn't really concerned about the syllabification logic right now, but I think the neumes should center themselves over "eu" and such, if that vowel combination is entered into a single syllable. As I had mentioned before, Gregorio itself seems to handle any combination of two vowels in a row by treating them as a diphthong for centering purposes (unless the first of the two is either i or u), but there are certainly very few words that use any of these diphthongs. Other than euge, I don't think I have encountered any of them in Gregorian chant, and I know I've seen cui syllabified as cu-i in a Gregorian hymn before. However, if in the gabc, a single syllable has one of these combinations, I do think it should center over the entire width of the two vowels.

bbloomf commented 8 years ago

As far as syllabification goes, I think one rule that seems to be missing from Wheelock's (and thus from your algorithm) is that the gu in a [aeiou]ngu[aeiou] sequence should be treated as a consonant, as in san-guis, lin-gua, pin-guis, etc.