"Respell Pitches" Tool

• Nov 9, 2019 - 16:29

Hello, Musescorers!

I'm working on a project and, upon importing an XML file, the application chose to spell a pitch as "Gb" rather than "F#." In the context of the piece (G minor), F# makes much more musical sense.
After manually adjusting the notes, I wanted to expedite the process. I selected the next notes that I wanted to respell, then went to the "Tools" menu and clicked "Respell Pitches."
It did not respell the pitches in my selection, but instead went back to the notes that I had already fixed and respelled them back to "Gb," rather than "F#."

1: The Respell Pitches tool should apply only to a selection. If there is no selection made, a popup should predict the user to make a selection before using the tool.
2: Within the selection made, anything with an accidental (non-diatonic) should be respelled. In this case, my key signature has two flats, so the flat added to the G is a non-diatonic tone. The application should see that and respell this to the "F#"

There is a larger, more important layer here that's a much deeper adjustment to the program - how keys are defined. That needs to be improved as well. I'll address that in a different post, due to the deeper nature.

Have at it - let me know what questions you have!



The Respell Pitches tool is of a class of algorithms that looks at a broad section of the score and uses statistical modelling of contextual clues to decide on what it thinks is an appropriate representation. In specific, when used on short selections, it often either does nothing at all or produces faulty outcomes. It does not take the key signature into consideration. The case can be made that what I have just described is more or less useless, and the converse case can be made, i.e., that when applied to movements of some length, it gets 98.whatever% of the accidentals "right", and that's certification enough. It is a good High School Debate Night question which of these least violates the principle of least surprise.

In reply to by [DELETED] 1831606

From a coding/programming perspective, that makes sense. However, the end user of Musescore isn't a programmer, but rather a composer, a musician. The goal for Musescore, as an application, is to react the way a composer or musician intuitively thinks so that it becomes the go-to choice for notation software. We need to start by approaching the thought process from the composer's perspective and for the software to be a tool that allows for the writing of music. If I'm writing with pencil and paper, these are decisions that don't occur; there's a natural instinct. The software shouldn't add burdensome steps along the way.

As I teach my music theory students, "Spelling counts." The manner in which a note is spelled (Gb vs. F#) has significant meaning in music. If I see an F# followed by a G, I "hear" the F# as the leading tone to the G. If I see a Gb, I'm going to think it's chromatically closer to an F. They're the same "button" on a piano, but they have different musical implications. These implications start with the definition of the key signature and then continue forward through tonal language within the phrase.

In reply to by Ryan

You're not saying anything we all don't know. You have not addressed the argument in favor of the current behavior, that is, when applied to a movement of significant length with many misspellings, it gets the vast amount of it right. A case could easily be made that there should be two tools, one that works locally, and one that works on larger extents by different rules. As is well known, a doctor who cures 98% of his or her patients leaves one dead of every 50, very dissatisfying to the family of the same. How to assess the performance of an accidental-speller (there are papers on this), is not such a clear problem. And, of course, there are specific notes in composers even earlier than Wagner where the spelling is disputable (usually in highly chromatic or modulatory passages). I can show you a passage or two in Bach where C# and Db occur in the same voice (not tied to each other or enharmonically exchanged) in the same measure. Of course, Gb goes to G very frequently (bass line of "O Mensch, bewein' dein Sünde groß", Orgelbüchlein).

In reply to by [DELETED] 1831606

Thanks for the example! That's an extraordinary piece. It looks like the example might be a misprint after all though. If you look in the tenor part simultaneously above, it's spelled d-natural.

But even if it isn't a misprint, the beginning of the measure is finishing a temporary tonicizing of the iv of g minor, that is, c minor. So if you look at the organ line itself, it makes sense to spell d-flat. (Just play the organ line alone and think c minor to get this.) The next measure, however, is clearly aiming for a cadence in the original key of g minor, so the c # at the end of measure 72 makes sense in that key as a chromatic neighbor of the fifth scale degree (of g minor), that is of the note d. (A very common melodic procedure found throughout the common practice.) So the first harmonic idea, in c minor, ends at the beginning of measure 72, and the next idea, in g minor, begins on the anacrusis at the end of measure 72, not in measure 73. So even if it isn't a misprint, it still does make analytical sense, and doesn't represent an arbitrary decision on behalf of composer or editor. This is my view at least. 😏

If you like these sorts of puzzles, I have a good one from Brahms -- two different spellings of the same note, simultaneously in the same chord! It's actually a sort of analytical pun.

In reply to by [DELETED] 1831606

Well, you made more than one point, and the point I was addressing is when you said "the spelling is disputable." I'm saying it isn't disputable, that there's a correct way to spell the notes in this measure, and that they are in fact spelled correctly. Related to this, you also said "not a modulation", and there is indeed a transient modulation taking place here. (Very strong cadence in c minor to begin m 72.)

My brain is too flabby in the appropriate department to follow your other points, which I realize are the main ones. It's clear though that the programmers of Musescore haven't studied much voice-leading!

In reply to by ewmoor01

In terms of "disputable", I was not referring to this passage. I don't categorize the local use of secondary dominants as a "modulation". The basso ostinato has its yearnings towards neighboring keys, but I would reserve "modulation" for a more serious and lasting change of tonal center (which does happen in the movement, too, but not there). The main point is, as you say, that any one-size-fits-all scheme of accidental-inference will not, in fact, fit all.

Do you still have an unanswered question? Please log in first to post your question.