Grid lines: changing their appearance: Difference between revisions

Import snippet from LSR
 
mNo edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The appearance of grid lines can be changed by overriding some of their properties.
The appearance of grid lines can be changed by overriding some of their properties.


<lilypond version="2.24.0">
<lilypond version="2.24">
\score {
\new ChoirStaff <<
  \new ChoirStaff <<
  \new Staff {
    \new Staff {
    \relative c'' {
      \relative c'' {
      \stemUp
        \stemUp
      c'4. d8 e8 f g4
        c'4. d8 e8 f g4
      }
     }
     }
    \new Staff {
  }
      \relative c {
  \new Staff {
        % this moves them up one staff space from the default position
    \relative c {
        \override Score.GridLine.extra-offset = #'(0.0 . 1.0)
      % this moves them up one staff space from the default position
        \stemDown
      \override Score.GridLine.extra-offset = #'(0.0 . 1.0)
        \clef bass
      \stemDown
        \once \override Score.GridLine.thickness = 5.0
      \clef bass
        c4
      \once \override Score.GridLine.thickness = 5.0
        \once \override Score.GridLine.thickness = 1.0
      c4
        g'4
      \once \override Score.GridLine.thickness = 1.0
        \once \override Score.GridLine.thickness = 3.0
      g'4
        f4
      \once \override Score.GridLine.thickness = 3.0
        \once \override Score.GridLine.thickness = 5.0
      f4
        e4
      \once \override Score.GridLine.thickness = 5.0
      }
      e4
     }
     }
   >>
   }
  \layout {
>>
    \context {
 
      \Staff
\layout {
      % set up grids
  \context {
      \consists "Grid_point_engraver"
    \Staff
      % set the grid interval to one quarter note
    % set up grids
      gridInterval = #(ly:make-moment 1/4)
    \consists "Grid_point_engraver"
    }
    % set the grid interval to one quarter note
    \context {
    gridInterval = #(ly:make-moment 1/4)
      \Score
      \consists "Grid_line_span_engraver"
      % this moves them to the right half a staff space
      \override NoteColumn.X-offset = -0.5
     }
     }
  \context {
    \Score
    \consists "Grid_line_span_engraver"
    % this moves them to the right half a staff space
    \override NoteColumn.X-offset = -0.5
   }
   }
}
}
</lilypond>
</lilypond>


[[Category:Contexts and engravers]]
[[Category:Editorial annotations]]
[[Category:Editorial annotations]]
[[Category:Included in the official documentation]]
[[Category:Included in the official documentation]]
[[Category:Snippet]]