Dorico Pro 18.104.22.1686 (Apr 18 2019), Windows 10 x86_64.
When doing MIDI export, notes with a negative “playback end offset” property that would put the end time before the start time, instead underflow and put the end time at some arbitrary future time, either the end of the score, before the next time the same note appears, or some unknown time between them. This causes corrupted MIDI output. Perhaps this issue also occurs if the “playback start offset” is set to a large enough positive number that the note has negative length, I haven’t tried this.
Input the pictured score.
Select the first eight notes and set their “playback end offset” to -1000.
Export as MIDI (also attached) and import into your favorite DAW or MIDI editor.
Obtain the following result:
I’m not sure what should be the expected behavior for notes with negative length–probably they should just be omitted, but since this is most likely a situation the user does not want to exist, perhaps a warning to the user would be helpful. Alternatively, the warning could ask the user whether they want to omit notes with negative length, or to ignore the playback start and end offsets for those notes and just export them as written visually. Another alternative would be to prohibit notes from having offset values which would lead to negative lengths–this might be more difficult to implement because there are many edit operations which could change the note’s value, and hence change a legal set of offsets into an illegal one.
I wrote the majority of a score as MIDI in a DAW, then imported it into Dorico for fixes and cleanup as well as engraving. I did not pay any attention to the playback start and end offsets which had been set upon MIDI import, because they didn’t affect the appearance in Dorico. However, evidently I edited the length of some of these notes in such a way that resulted in negative lengths when taking into account their end offsets. Then, when exporting MIDI back to my DAW, there were mysterious very long notes that stretched across long lengths of time.
The resulting MIDI file (forum does not allow upload of .mid, so I had to zip it):
underflow.zip (342 Bytes)