Skip to main content
Topic: "Audit Enharmonics" tool: some possible improvements (Read 22751 times) previous topic - next topic

"Audit Enharmonics" tool: some possible improvements

I'm starting a new thread on this subject (which came up in the "silly notation" thread) because I think the Audit Enharmonics tool is among the least competent parts of NWC - if not the least competent. It isn't needed very often, so most of us probably think of it as a low priority for upgrading. But if a new user needs it, uses it, and reads the output critically, he or she is not very likely to become an old user. So, in that sense, fixing it - and thereby raising the correctness of the program's output, and its esteem among new users - might be considered critical.

The current rules the tool operates under seem to be two:

  • if a note is spelled as an accidental but there is a natural enharmonic equivalent (e.g., B# = C; Gbb = F), substitute the natural equvalent.
  • substitute sharps for all flats, unless the music is in a flat key. In that case, substitute flats for all sharps.

These rules are general approximations only, and are wrong about half the time.

As Rick G. pointed out in the "silly notation" thread, analysing the score to find the functionally correct accidental in each case is beyond what we can expect NWC to do; even if accomplishable, it would blow the small size and rapid functionality of the program out of the water, and these are things we treasure about it. This doesn't mean, however, that the enharmonics tool isn't improvable. Here are two simple additional rules, which might be applied in a second pass:

  • if the next note is a tone or a semitone higher, use a sharp; if it is a tone or a semitone lower, use a flat.
  • if an accidental will cause the next note to require a natural, use its enharmonic equivalent.

These two new rules would take care of most of the tool's problems. They would also bring in a few of their own, as they are not perfectly reliable in all cases. Because of that, I offer a  third suggestion:

  • give the tool an "ask before changing" option.

This last suggestion doesn't depend on the other two, and would be an excellent place to start.

I welcome others' comments, criticisms, and suggestions.

Cheers,

Bill

Re: "Audit Enharmonics" tool: some possible improvements

Reply #1
Audit Enharmonics will never of much use until it can operate on a selection, rather than the entire staff.
Audit Note Stems is much less useful than it could be for the same reason.

Any User Tool that could be written will be awkward since it gets the selection devoid of any context.

That said, it is still useful to discuss guidelines such as "sharps up, flats down" and "don't use dbl flats/sharps for instrument x". Some day, User Tools may get enough context to implement them.
Registered user since 1996

Re: "Audit Enharmonics" tool: some possible improvements

Reply #2
Quote
if an accidental will cause the next note to require a natural, use its enharmonic equivalent
That would be wonderful!

Re: "Audit Enharmonics" tool: some possible improvements

Reply #3
Thanks for the input. Rick, I like the idea of having the tool operate on a selection - that would make it much more useful.

- Bill

Re: "Audit Enharmonics" tool: some possible improvements

Reply #4
Quote
Audit Enharmonics will never of much use until it can operate on a selection, rather than the entire staff.

The selection needs to include the following bar line, so that all subsequent notes of the same pitch (and octaves?) in a measure are scanned for adjustment, and so that naturals can be placed on subsequent notes in the same position on the staff to which the adjusted note is being moved. It gets a little complicated to keep track of it all when several notes are being adjusted, especially when they are adjacent.

Quote
if an accidental will cause the next note to require a natural, use its enharmonic equivalent

My limited attempts at a PHP script to do only this were never quite good enough because of the above reasons. In practice, I had to limit my selection to only one bar because I usually had to correct the results, and it became confusing if the selections was too large. It became easier to just make the adjustments manually.




Re: "Audit Enharmonics" tool: some possible improvements

Reply #5
A very simple rule based on the probability of a note occurring within a particular key signature would be simple to implement too. Take the key of C major as the role model. Look for the nearest major key signature (in the circle of fifths) which contains the pitch (i.e. the MIDI note) you are looking for and express it as it appears in that key. E.g. F# is found in G (one away from C) whereas Gb is in Db, (five steps away) so F# it is.

So in the key of C major you would choose C# Eb F# and Bb as the most likely candidates. That leaves G#/Ab where both are equally likely (in terms of distance from the home key). But this can be decided in favour of G# since that is the leading note of A minor which shares the same key signature.

The same accidental structure applies in any key. Just transpose the C major model maintaining the consistent intervals. So in F# major you would transpose up three staff positions and apply the appropriate accidentals. You'd get Fx Anat B# Enat and Cx as the appropriate accidentals. In F it would be F# Ab Bnat Eb and C#. Etc, etc.

Admittedly this is pretty well context free but at least you'd know what you were getting and would be right considerably more than half the time.

Re: "Audit Enharmonics" tool: some possible improvements

Reply #6
Peter, your rule seems a bit complicated for the program to follow, and I'm not sure it would be right as often as you think it would. It ignores tendancy tones (flats go down; sharps go up), and it would break down in cases where the music has modulated but the composer hasn't changed the key signature, because - short of a full harmonic analysis (which, as Rick has pointed out, we really can't expect NWC to do) - the key signature is the only thing the program has to go on. Nor is the matter of G#/Ab as clear-cut as you make it, because the flat sixth (e.g., Ab major in the key of C) is a fairly common chord. Your rule would spell that chord G#-C-Eb, a provocatively bad idea. And what about modern composers who don't use key signatures and don't build chords by thirds?

Not trying to be nasty here, just pointing to some of the complications that have probably kept Eric from tackling the enharmonic audit tool's deficiencies in the first place. I think the best we can hope for is some simple rules depending on immediate context (the notes immediately before, simultaneous with, and immediately after the note whose accidental is being examined, on the same staff).

Cheers,

Bill

Re: "Audit Enharmonics" tool: some possible improvements

Reply #7
Quote
if an accidental will cause the next note to require a natural, use its enharmonic equivalent.

I acknowledge that in an ink-heavy bar, it's a good rule, but there's a caveat.  Many people using charts created with NWC won't be familiar with oddball accidentals. 

Perhaps a better choice would be for the audit enharmonic to move sequentially through the staff, and give the user the choice of approving each change instead of just adjusting the entire staff full of notes at once.


Re: "Audit Enharmonics" tool: some possible improvements

Reply #8
William. The rule is absolutely straightforward. Given a key signature and a pitch it determines simply and uniquely how that pitch should be notated. Admittedly that could lead to an incorrect result but that's life. I suggest that you re-read what I've said. Perhaps in trying to explain the logic I've hidden the basic simplicity of the idea.

Your point about modern composers is not well made. What on earth would they be doing auditing accidentals in the first place if they don't use a key signature?

And I didn't say that G# was always to be preferred over Ab (in C major). Just that a decision has to be made and in A minor that's the obvious choice.

Let's face it. Noteworthy does not do context or analysis so any suggestion that it should do so in this situation is doomed to rejection.

My suggestion is a vast improvement on the current behaviour. It's not a cure-all but at least it's logical and easy.

Re: "Audit Enharmonics" tool: some possible improvements

Reply #9
Sorry, Peter. I'm a modern composer. I rarely use a key signature. But I do care a lot about getting the notation enharmonically correct. I think most of us do. It's the key to getting the musical meaning correct - even in atonal music, where I have been known to use double flats and double sharps if the musical thought requires them. As for the G#/Ab question, here's what you said:

Quote from: Peter Edwards
But this can be decided in favour of G# since that is the leading note of A minor which shares the same key signature.

That's rather unequivocal. And wrong a good portion of the time.

- <sigh> - I'm not trying to start an argument here. It's just that there are serious flaws, from a music theory standpoint, in what you propose - which would require a lot more contextual analysis, in any case, than is necessary to just check the pitch class of the next and previous notes. And we haven't even begun to talk about modulations.

I think David has the right idea. Give us the ability to accept or reject each enharmonic correction before it becomes permanent. That, along with Rick's oft-stated request to let the tools operate on selections instead of only on full staves, would go a long way toward making auditing enharmonics useful again.

Re: "Audit Enharmonics" tool: some possible improvements

Reply #10
Of course G# will be wrong sometimes (although not as often as you suggest). In C major there's nothing to suggest which is correct: they are equally distant from the home key. But in A minor the case really is pretty unequivocal; it's the leading note.

My suggestion is solely for a context free application. Once you accept that there's no point in discussing the finer points of musical theory. You may well sigh but you are the one who's arguing. I'm just putting forward a workable improvement.

 

Re: "Audit Enharmonics" tool: some possible improvements

Reply #11

Quote from: Peter Edwards
I'm just putting forward a workable improvement.

That's the trouble: I'm not sure it's workable, and I don't think, for the purposes that I use the tool, that it would be much of an improvement. But Eric will have the final call, in any case, so we should simply agree to disagree here.

Cheers,

Bill