grame-cncm / guidolib

Guido project - music score layout engine - music description language
http://guido.grame.fr
Mozilla Public License 2.0
152 stars 34 forks source link

Slur Collision when the slur spams more than one system #168

Closed arshiacont closed 1 year ago

arshiacont commented 1 year ago

Slurs can collide with score elements in relatively simple scores, if the slur begin and end are not on the same system.

Example (simplified from Fauré's Sicilien):

{[ \staff<1> 
    \key<-1> \meter<"6/8">  _/4 _/8 _/4 \stemsUp a0/8   
   \slurBegin:1<curve="down"> \beamBegin:1 b&1/8. a1/16 g1/8 \beamEnd:1 \beamBegin:1 f1/8. e&1/16 d1/8 \beamEnd:1 
    \beamBegin:1 c1/8. d1/16 b0/8 \beamEnd:1 \beamBegin:1 c1/8. a&0/16 a0/8 \beamEnd:1 
     \beamBegin:1  b&0/8. c1/16 a0/8 \beamEnd:1 \beamBegin:1 b&0/8. g&0/16 a&0/8
 \beamEnd:1 
     \beamsOff b&0/4. \beamsOff f0/8 \slurEnd:1 _/8 _/8  
     _*3/4
    ]
  }

Generated on online guidoeditor: image

Note also that the continuing slur on the 2nd system can eventually collide with a 3rd system at its starting point if there is a 3rd system.

dfober commented 1 year ago

Quite tricky to find a general solution but it's fixed for this issue and also improves all the existing cases. Only slurs over several lines are concerned.