Eventually I found a way to define playable repeat with volta in RG which are 
exportable to LilyPond easily.

In RG a repeat with volta must be defined as a sequence of segments with linked 
segments for the repeating parts.

Example, writing "lk(MAIN)" to note an segment linked to the segment called 
"MAIN":
   The sequence of segments:
     "MAIN END1 lk(MAIN) END2"
   defines a segment MAIN repeated twice with alternate endings END1 and END2.
  In RG notation, it appears as a linear part without any repeat.
  You only have to export it to LilyPond (with the "Use repeat when possible" 
box checked) to see it as a repeat with volta.

More complex sequences are possible:
   "MAIN END1 lk(MAIN) lk(END1) lk(MAIN) END2 lk(MAIN) END3"
gives MAIN repeated four times with three alterantes endings END1 (twice), 
END2 and END3.

Following rules must be applied to get an export with repeat:
   1 - The main repeating segments must be "plainly" linked together (ie 
without any transformation as transposition between them). That's not difficult 
as I think such transformations are currently not allowed by the GUI.
   2 - The endings must be shorter than the repeating main segment. (Probably 
this rule should not apply to the last ending. we shall see in a next 
release...)
   3 - The segments must touch each other but do not be overlap.
   4 - All the main repeating segments must start on the same beat. (Currently 
the exporter code doesn't enforce this rule. There is a fix to come).
   5 - If the first ending is repeated several times, the linked segments used 
for it have to fullfill the rules 1 and 4.
   6 - Currently only the first ending may be repeated. (That's the way 
LilyPond works without using special tricks. The exporter code doesn't enforce 
this rule.)
   7 - If several tracks are exported together, the repeating parts of the 
different tracks must be synchronous.

If one of these rules enforced in the exporter code is not followed, the 
notation is correctly exported in LilyPond, but without the repeat.

If one of these rules not enforced in the exporter code (ie rules 4 and 6) is 
not followed, the notation is exported in LilyPond with the repeat but the 
result will certainly be incorrect.


I wrote this code a bit in a hurry to have it before the 11/11. So it's 
sometimes not very beautiful nor efficient, but it seems to work (at least with 
the examples I used to test it).

Yves




------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Rosegarden-devel mailing list
[email protected] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel

Reply via email to