On Saturday 26 July 2003 09:15, Guillaume Laurent wrote: > On Saturday 26 July 2003 02:05, Silvan wrote: > > [ order of note/lyrics events ] > > > > or can I make an assumption at all? > > You can't.
That's basically true, but... well, the assumptions you can make are certainly pretty complicated. A lyric has an absolute time just like everything else. If it has the same absolute time as a note, then it is "attached to" that note. If that is the case, then it will always appear _before_ the note in the segment, because lyrics have a smaller subordering value than notes. Unfortunately it might not be immediately before, because indications (slurs, dynamics etc) have a subordering that places them between the two. However, all this is a little bit moot anyway, because of quantization. In reality a lyric is "attached to" any note than happens to have the same notation absolute time as it, not just any note with the same raw absolute time. Since the segment is not ordered on notation absolute time, this means that you have no guarantee for where the lyric will appear in relation to the note. What you really want to do is use the Chord class. If you construct a Chord, passing in the iterator pointing to your lyric event as a sample element of the chord, then that chord will find and contain all of the notes that have the same quantized absolute time as your lyric. You can then simply query getLongestElement from the Chord and use the duration of whatever you get back. Chris ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ Rosegarden-devel mailing list [EMAIL PROTECTED] - use the link below to unsubscribe https://lists.sourceforge.net/lists/listinfo/rosegarden-devel
