Roman Numeral Analysis font deadlock
I find it supremely vexing that the people in Kgrad, who are not responsible for the development of the desktop application, tell those who are, "You shouldn't install this font, but instead, engineer a more elaborate feature" when they are not in a position to schedule or mount such development. If you put the font in the next release, what are they going to do, refuse to install it?
Comments
No problem, if that font is then getting embedded into MuseScore, which AFAIK is @Marc Sabatella's mid-term plan? Having that font on the musescore.com site, was/is meant as a short time workaround IIRC.
And those people in Kgrad are paying Anatoly's and Dmitri's wages ;-)
I think it's reasonable not to embed a font into MuseScore before the development of the feature that will take advantage of it. The danger is the font ends up needing to change in some incompatible way based on issues we can't foresee until the development happens. We don't want to introduce incompatible changes into MuseScore twice if we can time it so it happens only once.
For the record, the work on chord symbol playback for GSoC is progressing very nicely, and my assumption is that it will be merged into an upcoming release this fall, and my hope is to get the RNA feature in simultaneously, because the code changes will overlap with the chord symbol playback work.
Once the RNA feature is in MuseScore, the font would be included within the program just like other fonts we provide are, and musescore.com won't need to provide special support for it, nor will people who download scores be required to install the font in order to use the score - everything will just work.
In reply to I think it's reasonable not… by Marc Sabatella
Just for the record: I was not proposing to embed that score now, but indeed together with a fully fleged RNA feature.
In reply to I think it's reasonable not… by Marc Sabatella
Well, if it's really "scheduled" soon, I can wait ...
In reply to Well, if it's really … by [DELETED] 1831606
The quotes on the word "scheduled" are completely appropriate :-), but yes, it's my personal goal and plan of record. It really does make more sense than embedded a font into musescore.com prematurely. Also consider, given that RNA support will presumably be coming to MsueScore as a new element type, we'd really rather people don't create too many scores "faking" it as staff text or lyrics or what not. I mean, that's what we've always done so far of course, but if we're creating something for posterity - as I know you are! - better to use the real thing.
My vision for how the feature would work is that it would be just like chord symbols with regard to the navigation features - space to move to next note or beat, tab to next measure, the other shortcuts as well - but would otherwise be plain text that just happens to render using Campania by default. So it won't take long to implement at all, but it would not be backwards-compatible: if someone downloads using the feature and tries to open it in versions that don't support it (eg, 3.2.3) the analysis won't show at all. This is why I think it's important to do it once and do it right.
It is possible we could instead to reuse an existing type like staff text but just introduce a new text style. Then the analysis would still show in older versions, just not using Campania. It would be a bit more work to get the navigation working if I used that approach.
Feedback on these ideas welcome!
So, I'm working on this now, and think I have something fairly reasonable going. Internally, it's implemented as a special type of chord symbol, and thus uses the same navigation commanfs (Space, Tab, semicolon, Ctrl+duration) as other chord symbols, but using its own style settings so it's as if it were a new element type, Also a new command to add RNA. This approach seems best for MusicXML compatibility, although it's actually quite unclear to me how MusicXML is really supposed to work with RNA.
At this point, I'm not seeing any reason not to just use Campania to do the "heavy lifting" of rendering. So really, the main point of my current working code is to disable anything else special about how chord symbols are treated, if they are marked as being RNA. So no transposing, no special parsing in the code above and beyond what the font does already.
The question then is, are people finding Campania sufficient for their needs, and if not, what additional features would the font need?
I'm trying to decide if a similar approach makes sense for the Nashville number system, BTW.
In reply to So, I'm working on this now,… by Marc Sabatella
I have not given it any serious use beyond my initial checkout because of the inability to post scores using it.
In reply to So, I'm working on this now,… by Marc Sabatella
I'm finding Campania almost perfect for my RNA needs.
The only extra features I can think of would be to include some additional chord type symbols, like the circle for diminished and the triangle for Maj7, etc, and perhaps the X that some people like to use for a secondary dominant. Otherwise I can't think of anything it's missing.
Many thanks for making the font available, and even more so if the RNA ability can be incorporated in Musescore itself.
In reply to I'm finding Campania almost… by MarkWWW
Ooops, I ve just noticed that you have already included the circle (dim).
In reply to Ooops, I ve just noticed… by MarkWWW
And 0 to enter the half-diminished symbol, and, I think, ^ for triangle.
Not sure I've seen the X - how does that work?
In reply to And 0 to enter the half… by Marc Sabatella
I think it must be a very old-fashioned style of symbol. The only examples I can find are in books by John Mehegan, like the image below which comes from his "Jazz Improvisation - Tonal and Rhythmic Principles".
It's not something I use myself, but I thought it might be of some use to someone, if anyone other than him still uses it.
In reply to I think it must be a very… by MarkWWW
Gotcha. Mehegan is definitely a well-regarded thinker, but his notation system is a bit quirky. Use of "x" to enter a double-sharp seems more important to me. But I'll see if there is a way to get the "x" in there somehow.
In reply to I think it must be a very… by MarkWWW
Not too old-fashioned.
I'm used to it.
(I don't think this sign is going to be confused with double sharps. Sharps and flats are on the left.)
It is less encrypted than writing V7/V.
you just add an "x" to the right of the roman number, and that is a secondary dominant and the following chord becomes supertonic. eg: IIx V
In reply to Not too old-fashioned. I'm… by Ziya Mete Demircan
but 'x' is used to enter a double sharp
In reply to but 'x' is used to enter a… by Jojo-Schmitz
Is the Roman numerical analysis entry system not yet prepared?
In this analysis, flats and sharps are used on the left. It's not hard to define. eg:
bIIx I
Please note that "b" is used for both chord and flat input.
In reply to Is the Romen numerical… by Ziya Mete Demircan
The problem is interpreting IIx6 - is that IIx 6, or II x6?
In reply to The problem is interpreting… by Marc Sabatella
It should be IIx65 (secondary dominant 7th chord, 1st inversion)
or IIx(65)
And if this is not a secondary dominant-7th chord, why should we use x?
(The symbol 6 is the first inversion of a triad chord.)
In reply to It should be IIx65 … by Ziya Mete Demircan
It's not clear why Mehegna proposes using "x" at all, but it's clear from the example he doesn't limit its usage to secondary dominant (bII7 would essentially never occur as a secondary dominant, only as a tritone substitution). Also, it seems quite unlikely to me Mehegan would use 6 to indicate an inversion; that's taboo in the jazz world. So really, nothing about this usage of "x" is clear to me. If someone can produce a fuller explanation of the special circumstances in which this symbol is used, that would be helpful.
In any case, glyph substitution in fonts can be context-aware, but only to a limited extent. Devising an appropriate set of GSUB rules to make "x" render literally in just the right cases, while still fully supporting the more common use of the "x" to mean double-sharp everywhere else, would likely be tricky. But I can't really begin without a really full explanation of this unique usage of "x".
In reply to It's not clear why Mehegna… by Marc Sabatella
https://books.google.com.tr/books?id=7RELAQAAQBAJ&lpg=PT11&ots=FQsNy3A3… (see also the following pages)
In addition, dim chords should be considered as (rootless) secondary dominant,
in C: G#ox => Am7; F#ox => G7
PS: bII7x is a simple mistake. I also substitute the representation of the bII7 chord 👀
In reply to https://books.google.com.tr… by Ziya Mete Demircan
OK, that's most unfortunate then - looks like this usage has the "x" (with no 7) to mean "non-diatonic dominant seventh", and inversions are marked with the classical 65 etc. I wonder if (and how if so) Mehegan and his followers (who apparently include the author of that book) indicate sixth chords?
Anyhow, I don't see a way to reconcile that with the more traditional use of double sharp, so is probably no way to have to "x" automatically produce the "right" thing depending on context. Meaning, something will have to give. The use of "x" to mean non-diatonic seventh still strikes me as extremely non-standard, but on the other hand, double sharps on interval indications after the root will be extremely uncommon (unlike double-flats, which of course would occur in a literal spelling of a diminished seventh chord). So maybe the compromise is is, make "##" be the primary method of entering double sharp in any context but allow "x" as an alias only before a root, which is probably the only time it will come up in practice.
In reply to OK, that's most unfortunate… by Marc Sabatella
I'd expect double-sharp diminished sevenths in preludes in very sharp keys, e.g., the leading-tone diminished seventh, F##o7, in G# minor (a not uncommon key).
In reply to I'd expect double-sharp… by [DELETED] 1831606
Yes, but while the note has a double sharp, that wouldn't reflect in the Roman numeral analysis. It would still be just viio. And even if you did have a case of a chord built on a double-sharped scale degree, that goes before the numeral, so the idea of just substituting for "x" in that context (eg, xiio) would still work. The only case that fails is if an interval after the root requires a double sharp, like "V x6". And while that might extremely rarely happen in figured bass, I am having a hard time imagining a case where it would in RNA.
In reply to OK, that's most unfortunate… by Marc Sabatella
...or use X (capital x) as the alternate double sharp symbol. I realize this is a deviation from all of the other chord modes, but it removes ambiguity. You could make the parsing program default to x if the position is ambiguous when x is entered, but when X (or ##) is entered always treat it as a double sharp.
In reply to ...or use X (capital x) as… by mike320
In C# minor, Augmented sixth chord on A would have and F## in the figure.
In reply to In C# minor, Augmented sixth… by [DELETED] 1831606
I would normally notate that as simply It6 or whatever, do you use bVI##6? Again, we're talking RNA< not figured bass. But the fact that you are spelling it ## here helps me feel OK about saying that's how you'd need to type it in Campania - bVII##6 to yield:
(if that's what you really want)
In reply to In C# minor, Augmented sixth… by [DELETED] 1831606
But isn't that still just number #6 (or +6)?
Or am I from another echol (school)?
In reply to ...or use X (capital x) as… by mike320
Interesting idea, but I hesitate on this for a few reasons:
It's not particularly intuitive, no one is likely to stumble on "X" to mean double-sharp before figuring out "##" works.
As mentioned above, font GPOS rules just aren't as smart as what can be done in code. I guess I need to reiterate - my RNA support involves no special parsing in the code whatsoever (on the contrary, I disable all parsing for RNA). All the fancy formatting is handled by the Campania font itself (https://github.com/MarcSabatella/Campania). The advantage is, you get a font that is equally well usable in plain text (so it can be used within a text frame, or in a word processor, or another notation program). The downside is, one is a little more limited in how the parsing can work. Yet it has proven surprisingly powerful and useful.
I have already made a tentative change to the font that disables the x-to-double-sharp conversion except before a root, and to enable "##" to always convert, right now I'm feeling comfortable with this.
In reply to Interesting idea, but I… by Marc Sabatella
(Ziya) I suppose so, in RNA (but not FB, although FB is inconsistent that way).
In reply to So, I'm working on this now,… by Marc Sabatella
Hello Marc, I didn't know where to post this, but I am working in Campania doing RNA in MuseScore. I am trying to label Augmented 6th Chords that resolve to other scale degrees than 5 (dominant). However, I cannot figure out how to make a caret or hat over a number so that it represents the scale degree. Ex. Fr+6/^1. but I want the caret to be over the number. Like the example attached.
In reply to Hello Marc, I didn't know… by jimdrum661
I didn't program in an automatic way to do that, as I'm not familiar with that particular notation. I mean, I have seen carets used to indicate scale degrees, but only in a melodic context, not a harmonic one, In RNA I'm not sure why you wouldn't just use I (capital Roman numeral). Is this a notation used in some textbooks?
Anyhow, you should be able to add that symbol from the Special Characters dialog (press F2 while editing to display). assuming you can figure out the appropriate Unicode sequences to get that. Either there is a precomposed glyph already defined or you'd need to enter the number and caret separately.
BTW, I don't suppose you're looking at the Chopin E minor Prelude? There's something kind of like that there...
In reply to I didn't program in an… by Marc Sabatella
Hi Marc,
Thank you for your response. I responded in the other comment in the forum.
https://musescore.org/en/node/303323#comment-989308
In reply to I didn't program in an… by Marc Sabatella
By-the-way, something like the Chopin in E minor Prelude would make sense for use of this kind of thing. I'm not currently working on that piece with my students, but the potential is there. This kind of resolution happens "quite often" (but is still rare), in music from the Romantic Era. You nailed it (the context) on the head!
Jim
FWIW, I have submitted a PR for the changes, although it still doesn't include embedding the font itself, so if anyone wants to build and test the PR, you'll need to download and install the font separately.
Here's the PR:
https://github.com/musescore/MuseScore/pull/5246
And here's Campania (including the changes discussed for triangle, x, and double sharp):
https://github.com/MarcSabatella/Campania
Users on Windows can take advantage of the AppVeyor build that can be "installed" like a nightly build:
https://ci.appveyor.com/api/buildjobs/3vm84bj1t8hx44p8/artifacts/MuseSc…
To use the RNA feature, see Add / Text / Roman Numeral Analysis (you can also define a shortcut for this).
In reply to FWIW, I have submitted a PR… by Marc Sabatella
What is the rationale for not submitting the font embedding? MuseScore is getting too good to believe.
In reply to What is the rationale for… by [DELETED] 1831606
:-) I just need to figure out the logistics of how to do that.
In reply to :-) I just need to figure… by Marc Sabatella
:-)
In reply to FWIW, I have submitted a PR… by Marc Sabatella
New Windows build that includes the Campania font:
https://ci.appveyor.com/api/buildjobs/vp1fbom6xaamfhfd/artifacts/MuseSc…
@BSG, are you able to do builds from source? The way fonts get included is different for macOS, and I'm unable to test if I got that right.
In reply to New Windows build that… by Marc Sabatella
Yeh, I can. It is all merged in master, right?
In reply to Yeh, I can. It is all merged… by [DELETED] 1831606
No, you'd need to pull Marc's PR
In reply to No by Jojo-Schmitz
What is the git command for doing so? assuming I have master fetched ....
In reply to What is the git command for… by [DELETED] 1831606
See https://musescore.org/en/handbook/developers-handbook/finding-your-way-…
In reply to See https://musescore.org/en… by Jojo-Schmitz
What is the name of his branch with this PR? That's a wonderful document but I can't master it all tonight.
In reply to What is the name of his… by [DELETED] 1831606
https://github.com/musescore/MuseScore/pull/5246
In reply to https://github.com/musescore… by Jojo-Schmitz
All set, building, thanx -- results to follow -- oh no, I can't test it because I have Campania installed on my system! .... I guess I can remove it.
In reply to All set, building, thanx --… by [DELETED] 1831606
That's what I did. Anyhow, also just check the commands and navigation etc.
In reply to All set, building, thanx --… by [DELETED] 1831606
Where do I find the commands?
In reply to Where do I find the commands? by [DELETED] 1831606
The font is there. I still don't know where the command is.
In reply to The font is there. I still… by [DELETED] 1831606
If I set the Chord Symbols font to Campania, I can type in the way I expect for RNA, but as soon as I type space, it reverts to Times Roman in the chord symbol. I suppose there's another command, but I don't know it.
In reply to The font is there. I still… by [DELETED] 1831606
Add / Text / Roman Numeral Analysis. And you can define a keyboard shortcut in the usual way, Edit / Preferences / Shortcuts.
The command works pretty much the same way as the lyrics, figured bass, or chord symbol commands in terms of adding an element, then using Space, tab etc to navigate. Internally it's a chord symbol so it uses the exact same shortcuts, including supporting ";" for next beat, Ctrl+(duration) etc.
There is a new text style for RNA, it has its own style setting for default placement, etc.
In reply to Add / Text / Roman Numeral… by Marc Sabatella
I tried all those; they work. How do you say V7 chord in third inversion (6-4-2) in RNA?
In reply to I tried all those; they work… by [DELETED] 1831606
All is in order!
In reply to I tried all those; they work… by [DELETED] 1831606
Excellent, glad things are working!
Sounds like you've figured it out, but the intent of Campania is you just type a notation naturally and the positioning rules in the font handle the rest. So, type "V642" and it automatically stacks the digits. It knows not to stack 13, it knows to start the stack for 642 higher than 64, etc, it converts "b", "#" to proper accidentals, etc.
See the README at https://github.com/MarcSabatella/Campania for some additional info & examples.
In reply to Excellent, glad things are… by Marc Sabatella
Yes, I know that, and did all that, but could not stack 3 figures. Let me try again.
In reply to Yes, I know that, and did… by [DELETED] 1831606
V642 definitely does not work. It puts the 6 and 4 nicely, and then puts the 4 above and smashes the 6 and 2 in the lower position.
In reply to V642 definitely does not… by [DELETED] 1831606
Weird, here's how that looks for me:
I suppose there could be a bug in how the font rendering library is working on macOS. Not sure if that's Qt, freetype, or within macOS. Does it work if you do go back and install Campania normally? Be sure to grab the current recent version from that same link. Ideally try both the TTF and OTF if you mind (OTF is what I embedded in MuseScore). If the OTF fails but the TTF works, I could just make that change. If both work when installed outside MuseScore but fail inside, that's tougher.
And thanks so much for your feedback - I had a feeling this sort of cross-platform testing would prove especially important!
In reply to Weird, here's how that looks… by Marc Sabatella
Where to I download the Campania you want me to test (from what same link)?
In reply to Where to I download the… by [DELETED] 1831606
How did you insert that image in your text?
In reply to Weird, here's how that looks… by Marc Sabatella
Same link as I posted a bit ago with more info on the font - https://github.com/MarcSabatella/Campania
To attach a file to a post, see the "File Attachments" link right below where you type your comment. I used the Image Capture tool within MuseScore to save the image. After attaching the file, you can use the "Insert" link that then appears, to make it appear inline at the cursor location.
In reply to Same link as I posted a bit… by Marc Sabatella
In reply to I hope to get to this this… by [DELETED] 1831606
To get it to display inline, hit the "Insert" link that appears after attaching the image.
In reply to To get it to display inline,… by Marc Sabatella
Aha! There is balm in Gilead! I'll get to this in the next hour (I'm as distressed about it as you are, but ...)
In reply to Aha! There is balm in… by [DELETED] 1831606
The ttf works correctly in Text Edit:
In reply to The ttf works correctly in… by [DELETED] 1831606
The otf works, too. I suspect MS isn't giving it a high enough ceiling.
In reply to The ttf works correctly in… by [DELETED] 1831606
Huh, that's really interesting. What I'm concluding from this is that the GPOS rule I have in the font to position that first 6 is somehow not firing correctly, but only with the library that renders the font for us. Probably something about the expression I am trying match in order to detect this. I don't think it's related to total height of the string, as it is not cutting anything off, it's just not positioning the 6 at all. Unless maybe there is some setting in the font I don't know about and that other libraries ignore, that sets an upper bound on high high things are allowed to be positioned, and rules are disqualified if they would result in that being exceeded.
In reply to The ttf works correctly in… by [DELETED] 1831606
Here's another simple test to perform, then: try "[I64]", and compare against the correct result:
There are only two places in the font where I perform explicit vertical adjustments: one is handling those three-high stacks of numbers (two-high stacks are done using pre-superscripted and pre-subscripted characters), and the other is to make the brackets align a little better with the Roman numerals.
It could be the case that for whatever reason, no vertical adjustments are working with FreeType on macOS. If that's the case, I'd expect to see the brackets a little too low, with the top of bracket aligning with the top of the "I" and the "6" thus sticking out above, and the bracket extended well below the bottom of the "I" and "4". If the rule is functioning correctly, the bracket will be raised a bit to encompass the 6 & 4 better, as shown above.
If the bracket works correctly within MuseScore but the 642 does not, this tells me the issue is with the three-high stacks specifically, either the syntax of my rule or something above exceeding the nominal height. But if the bracket doesn't get adjusted correctly, that tells me vertical GPOS rules are not working at all, so either tat's a limitation in FreeType for macOS or some setting I've missed that somehow doesn't matter on other platforms.
In reply to Here's another simple test… by Marc Sabatella
In MS, [I64] seems to work with a glitch:
Note that the inside is a tiny bit higher than in your image.
In reply to In MS, [I64] seems to work… by [DELETED] 1831606
Yep, that seals it - vertical GPOS adjustments are simply not happening. If you enter another I64 on the next beat but without brackets, you should presumably see the letters and numbers line up. Which is to say, it's not that the inside is higher, it's that the outside is lower - the brackets were supposed to be moved up. But the same thing that prevented the "6" in 642 from being moved up is preventing the brackets from being moved up, and that's an incompatibility between how GPOS tables work in OpenType vs how FreeType handles them on Windows and macOS.
So, I know the terms to throw around and have a vague sense of what they mean, and I also believe it's possible we can solve this with trial and error, as I recall doing during the MuseScore 2.0 beta period as I worked on the kerning of the MuseJazz font. Then, I had access to a Mac to test with, but now I don't. So if you can spare the time to work with me on this, I'll follow up with you via email.
One way or another we'll solve this, though. Worst case, I can define "ligatures" (pre-composed combinations of glyphs) just for the sequences actually likely to be used - eg, 753, 653, 643, 642 - and automatically substitute those rather than trying to position the top number above the rest with GPOS rules. And I can always just modify the bracket itself to sit higher rather than use fancy positioning rules. But I'd rather not need to do either of those if I can get the GPOS rules to work correctly.
In reply to Yep, that seals it -… by Marc Sabatella
The letters and numbers do line up in what I sent, but not the brackets.
In reply to Aha! There is balm in… by [DELETED] 1831606
Understood, no hurry. BTW, I assume the problematic V642 is displaying above the staff because you moved it there explicitly, not because you actually entered it as a chord symbol? Not that this should change anything, it works for me even if I enter it as a chord symbol (only thing that goes wrong is that a leading "b" for flat gets misinterpreted as the root of the chord).
In reply to Understood, no hurry. BTW,… by Marc Sabatella
Yes, I displayed it above the staff to de-interfere with my text string. Anyway, you have the new data about it working in Text Edit.
In reply to Yes, I displayed it above… by [DELETED] 1831606
Yes, and again, thank you so much so this valuable testing! Hopefully I'll be able to figure something out. May need to borrow a Mac for some testing, or see if someone else is able to assist with actual changes to the font to work around this.
In reply to Yes, and again, thank you so… by Marc Sabatella
I suspect it's hitting the ceiling and wrapping around for some reason; you can kludge the height of the string if you see 3 figures. I very much look forward to this feature...
In reply to Weird, here's how that looks… by Marc Sabatella
Your mention of the availability of both TTF and OTF versions reminds me of something I meant to report a little while ago but forgot to, so I'll report it now.
When I was experimenting with a previous version of Campania I found that it all seemed to work fine inside Musescore, but when I came to print any score including it the Campania font would not appear. After a bit of head scratching I eventually tried removing the OTF version I had originally installed and installing the TTF version instead, and then all was fine - Campania appeared on screen and on the printed page as well.
This might be specific to my setup, which is admittedly a bit odd - I'm running Musescore 2.3.2 on WindowsXP, and printing to a HP OfficeJet Pro 7720, but it would be good to have confirmation that printing works correctly on other people's more modern systems with both the OTF and TTF versions.
(The new features available in Musescore 3 have finally persuaded me to order a new machine running Windows 10, but it isn't here yet so I can't do these tests myself yet, I'm afraid.)
In reply to Your mention of the… by MarkWWW
Interesting! That could indeed be something relating to XP. But also, if the earlier version was the one I originally posted, that one was actually totally different "under the hood" even though it looks about the same - it was based on FreeSerif where the current one is based on Doulos (less restrictive license agreement). This difference could be directly relevant to one working better as TTF but the other working better as OTF, as a font kind of needs to choose which one to optimize for even if it supports both.
Anyhow, I'll try a print tonight and let you know.
In reply to Interesting! That could… by Marc Sabatella
Pardon me for butting in but... If I ran WinXP and was on the internet I would consider switching. It's the most broken into target on the net. Just sayin' in case you haven't heard.
-Dale