Sorry, that was not meant that way. This was intended to demonstrate the usefulness of having such an id for the line, no matter if it is a separate property or a value of details. (Having one id property for all grobs does seem reasonable.)
About the other thing: It gets more complicated for both the implementation and the user. For example in a situation where the number of encompassed Staves is not fixed, e.g. when Staves are added or removed during the music (as shown in the appendend very bad example) the context name based approach is rather complicated, as for each change to the staves we’d need to create a new grid. Instead with an id based approach it is sufficient to do something like \startGrid id moment for each staff in the place it is needed and \stopGrid id once we want to take the staff out of the grid. Cheers, Valentin
<< \new Staff { \set Staff.gridInterval = #(ly:make-moment 1/2) \repeat unfold 10 { c''16 d'' e'' b' } \unset Staff.gridInterval c''2~ c''1 } \new Staff { b'2 \set Staff.gridInterval = #(ly:make-moment 1/2) \repeat unfold 10 { \tuplet 3/2 { b'16 d'' c'' d'' f'' e'' } } \unset Staff.gridInterval b'1 } \new Staff { a'1 \set Staff.gridInterval = #(ly:make-moment 1/2) \repeat unfold 5 { \tuplet 5/4 { a'8 c'' f'' g'' d'' } } \unset Staff.gridInterval a'2 } \new Staff { g'1~ g'2 \set Staff.gridInterval = #(ly:make-moment 1/2) \repeat unfold 5 { \tuplet 7/8 { g'16 f' d' d'' c'' b' a' } } } >> \layout { \context { \Staff \consists "Grid_point_engraver" } \context { \Score \consists "Grid_line_span_engraver" } }
signature.asc
Description: This is a digitally signed message part.