Playback of supported ornaments incorrect if note is tied
Ubuntu Studio 14.04, GIT commit: 17a2ce0
1) new score, 4/4
2) create a whole note in measure 1 tied to another in measure 2
3) place a mordent on the first whole note
Result: two notes sound together for four beats (should be one note at a time), then note stops when the second measure is reached (whereas it should continue for four more beats
Also, if you place the mordent on the *second* whole note instead of the first, it doesn't play back at all. I'm not entirely positive this is a legitimate thing to do, but consider, a trill over a pair (or more) of tied notes is going to need to continue trilling for the full duration. So we really do need to support NoteEvents attached to tied-into notes.
Looking at the code under debugger, I see that the NoteEvent lists are actually being constructed reasonably in both cases (eg, both when the mordent is attached to the first note and when it is attached to the second note). It's the processing of the tie in collectNote that is the issue. This processing is also creating problems with shredpub's work-in-progress on swing playback.
I propose we fix this as follows:
1) if a tied-into note has only one NoteEvent, we do as we currently do - don't play it, but add its length to that of the main note (see #3 below). However, we should take any length adjustment to that NoteEvent into account (this will be needed for swing).
2) If a tied-into note has multiple NoteEvents, we treat the first as in case #1 above, but actually play the subsequent note events (also honoring any tie forwards as for #3 below).
3) For notes with multiple NoteEvents and a tie forward, add the length of the (first NoteEvent of the) subsequent tied notes to the *last* NoteEvent for this note only.
I think I can manage these changes myself, but since this is new code to me, I figured I would check in first. if someone has a different idea of how to proceed, or wants to take this on themselves, be my guest...