Enharmonic trouble

When I press the keys C, G , Ab, G, Bb, Ab, G, Ab on my MIDI keyboard (Alto Sax, Transposed score) and even if my key signature is ‘Atonal’ and I’m using a Tonality system that has a couple of microtonal accidentals, this is certainly not what I want to see: B#, G, G#, G, A#, G#, G, G# (screenshot attached). What do I need to do to force Dorico to make better enharmonic interpretations? This mess (not untypical - I’m not happy with Dorico’s enharmonic algorithms) slows work down considerably - but perhaps there are settings I’m not aware of?

https://www.steinberg.net/forums/viewtopic.php?f=246&t=177523

Yes, I’m aware of previous discussions on the subject although I hadn’t seen that one. It only goes on to show, in several examples, how Dorico’s algorithm which makes decisions based on melody and favours flats for descending and sharps for ascending lines without taking the spelling of the same pitch in the bar nor the key or tonal context into account, results in poor enharmonic notation. Because there’s no setting for one’s enharmonic preferences in the notation options, there’s always a lot of extra work in correcting Dorico’s choices (note by note, or using the edit filter).

But in the present case, as you can see, Dorico’s algorithm doesn’t even follow its usual rules. B# G G# G H A# G G# G for Alto Sax in Eb is not awkwardness caused by an inflexible rule, it’s simply nonsensical. Perhaps the microtonal Tonality System and Atonal key signature I’m using cause this behaviour which to me looks more like a bug than the result of an algorithm working as intended.

If you attach a project so we can see how your tonality system is defined, you might get a better answer.

Thank you!
Project attached.
Enharmonic spelling.dorico.zip (519 KB)

I don’t know if this is the whole explanation, but the spelling of your attachment looks perfectly reasonable in concert pitch with the notes spelled D# A# B C#.

Of course transposing that spelling into Eb produces a mess, compared with spelling it Eb Bb Cb Db.

I wonder if the “Midi spelling” code actually works in concert pitch, even if you input in transposed pitch.

If that guess is correct, you might get better results if you add a key signature of E flat to the staff before you input the notes, and delete it afterwards. That might persuade Dorico to use flats instead of sharps.

I see. Would the E flat key signature work with the 72EDO tonality system? Of course it wold have to be a user-defined key sig, anyway. I’ll look into it.
Anyway, that kind of “use flats instead of shapes” preference would be exactly the kind of notation option that those musicians who write non-tonal music and use MIDI keyboard for input would love to have in Dorico - to save lots of time spent in editing enharmonic spellings.

We spent some time looking into this yesterday, and we have a couple of bits of advice. Firstly, the reason you get peculiar spellings like G natural followed by G sharp is that Dorico would like to write F double sharp instead of G natural, but your custom tonality system doesn’t include any double sharps or double flats, so you might consider including those accidentals. The reason why everything ends up spelled in sharps is that when you’re writing in an atonal/open key signature, Dorico, for better or worse, uses the same approach to spelling as it does in C major. When you play what is in your mind a C flat, Dorico finds this apparent flattened tonic very unlikely, and instead treats it as if it is the leading note, which then pushes spellings sharp instead of flat. Rob is also correct that Dorico spells according to the concert/sounding pitch rather than the transposed pitch.

We have talked in the past about allowing users to influence the spelling that is used in open/atonal keys, or indeed in any key, but there’s no way to do this at the moment. I think you would find that if you add an appropriate key signature, that will give Dorico a clue about how to spell the notes on input, and if you delete the key signature again later, provided you don’t end up with accidentals that are incompatible with the ones in your tonality system, all of thoe existing accidental choices should be retained with no problem.