Making slurs with complex dash structure: Difference between revisions

m New category
Tags: Mobile edit Mobile web edit
Revise description
 
Line 1: Line 1:
Slurs can be made with complex dash patterns by defining the <code>dash-definition</code> property. <code>dash-definition</code> is a list of <code>dash-elements</code>. A <code>dash-element</code> is a list of parameters defining the dash behavior for a segment of the slur.
Slurs can be composed of complex dash patterns by setting the <code>dash-definition</code> property, which is a list of slur segments, which in turn are lists of parameters setting up the dash behavior of the given segment.


The slur is defined in terms of the bezier parameter t which ranges from 0 at the left end of the slur to 1 at the right end of the slur. <code>dash-element</code> is a list <code>(start-t stop-t dash-fraction dash-period)</code>. The region of the slur from <code>start-t</code> to <code>stop-t</code> will have a fraction <code>dash-fraction</code> of each <code>dash-period</code> black. <code>dash-period</code> is defined in terms of staff spaces. <code>dash-fraction</code> is set to 1 for a solid slur.
Slur segments are defined in terms of the Bézier parameter&nbsp;<var>t</var>, which ranges from&nbsp;0 at the left end of the slur to&nbsp;1 at the right end of the slur. A slur segment has the form <code>(<var>start-t</var> <var>stop-t</var> <var>dash-fraction</var> <var>dash-period</var>)</code>. In the segment spanning the range <var>start-t</var> to <var>stop-t</var>, the dash pattern is defined by the values of <var>dash-fraction</var> and <var>dash-period</var>. <var>dash-fraction</var> specifies how much of a dash period is black; if set to&nbsp;1 you get a solid slur segment. The unit for <var>dash-period</var> is staff spaces.  


<lilypond version="2.24">
<lilypond version="2.24">
\relative c' {
\relative c' {
   \once \override
   \once \override
     Slur.dash-definition = #'((0 0.3 0.1 0.75)
     Slur.dash-definition = #'(( 0 0.3 0.1 0.75)
                                (0.3 0.6 1 1)
                              (0.3 0.6 1   1   )
                                (0.65 1.0 0.4 0.75))
                              (0.65 1.0 0.4 0.75))
   c4( d e f)
   c4( d e f)
   \once \override
   \once \override
     Slur.dash-definition = #'((0 0.25 1 1)
     Slur.dash-definition = #'((0   0.25 1   1   )
                                (0.3 0.7 0.4 0.75)
                              (0.3 0.7   0.4 0.75)
                                (0.75 1.0 1 1))
                              (0.75 1.0   1   1   ))
   c4( d e f)
   c4( d e f)
}
}