lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Lyric line's vertical position is shifting from one staff system to


From: dfro
Subject: Re: Lyric line's vertical position is shifting from one staff system to the next.
Date: Thu, 14 Jun 2018 12:39:11 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

Dear Harm,
You did it! You solved my problem, and have saved me from countless tweak-recompile-tweak-recompile cycles with the way I was doing things before. I can now set the vertical spacing of the chord/lyric lines in relation to a single-line staff and move on, as I wanted. I am grateful for the help you and others have given me on this issue.

I was experimenting with your solution, and I found a way to attach the fixed chord-staff-chord group to other Staffs/PianoStaffs/ChoirStaffs/StaffGroups, which retain their flexible vertical spacing, and also retain flexible system-system spacing. I can put the fixed-spacing staff group on top, anywhere in the middle, or on the bottom of a grouping of staves.

Below, I have added some code examples. The examples use ChordNames lines, but Lyrics lines work just as well. All of the fixed and flexible vertical spacing can be adjusted in the \Score, \Staff, \ChordNames, or \Lyics of \layout { \context ... }, and in \paper { ... }.

I noticed the following behaviors of the setting: \override NonMusicalPaperColumn.line-break-system-details = #'((alignment-distances . (1 2 3))). If you place this in \layout {\context { \Score ...}}, then LilyPond will go through the list of numbers in 'alignment-distances' creating fixed spacing between staves from the top down until the numbers run out, then LilyPond will return to the default or custom flexible vertical spacing settings for any staves left over. This allows me to attach the chord-staff-chord grouping on top of a staff, as in a leadsheet.

I wanted to see if I could get LilyPond to let me put the fixed chord-staff-chord group in the middle of or at the end of a group of Staffs/PianoStaffs/StaffGroups that have retained their flexible vertical spacing. I tried putting NULL in the list of numbers in 'alignment-distances', and it worked! I think that any token that means nothing to LilyPond can be used. If LilyPond runs into a meaningless token/word, it will skip the fixed spacing for that staff-staff pair and move to the next number/token in the list and the next staff-staff spacing down the page. (I hope that I am using the terminology correctly.) I do not know if the developers intended this or if it is explained somewhere, but I like this behavior of 'alignment-distances' and I hope it remains in future versions of LilyPond!

This tweak/technique is very useful to me, since a chord-staf-chord, chord-lyric-lyric-lyric, chord-chord-chord, or any other grouping with fixed spacing can be added to a score that retains its flexible spacing on all of the other staves. You can also have a score that has a flexible-fixed-flexible-fixed setup, by setting 'alignment-distances' with the proper list of NULL-number-NULL-number tokens/variables that correspond to the staves in the score.

I do not think your solution, nor this way of using 'alignment-distances' and NULL tokens, is readily apparent in the documentation. (Of course, I could be missing something.) Perhaps, this is another area where I could offer some patches to the documentation or some snippets. I may share this in a blog article, eventually.

I can now get back to work on my manuscript projects. Thank you!

Peace,
David Froseth

P.S. I tried LilyPond 2.19.81 and the code worked, but the superscripting in my custom chord symbols disappeared, so I am back to using 2.18.2 for now.


%EXAMPLE 1 START OF CODE
%1. Fixed chord-staff-chord above two flexible staves
\version "2.18.2"

chord-rhythms = \relative b' {
      b2 b b b b b b b b b \break
      b2 b b b b b b b b b \break
}

BirdBlues = \chordmode {
      c1:7 b2:min7.5- e:7 a:min7 d:7 g:min7 c:7 f1:7
      c1:7 b2:min7.5- e:7 a:min7 d:7 g:min7 c:7 f1:7
}

BasicBlues = \chordmode {
      c1:7 f:7 c:7 c:7 f:7
      c1:7 f:7 c:7 c:7 f:7
}

"melody1" = \relative c' {
      c'2 c c c c c c c c c \break
      c''2 c c c c c c c c c \break
}

"melody2" = \relative c {
      c1 f c c f \break
      c1 f c c f \break
}

\score {

      \new StaffGroup
      <<

            \new Staff = "chords"
            \with {
                  \omit Clef
                  \override StaffSymbol.line-count = #1
                  \override BarLine.bar-extent = #' (-3.5 . 3.5)
                  \override StaffSymbol.Y-extent = #'(-3.5 . 3.5)
                  \hideNotes
            }  \chord-rhythms
            \new ChordNames \with {
                  alignAboveContext = "chords"
            } \BirdBlues
            \new ChordNames \BasicBlues
            \new Staff = "rh"  \"melody1"
            \new Staff = "lh" \with {
                  \clef "bass" } \"melody2"
      >>

}

\layout {
      ragged-right = ##t
      indent = 0

      \context {
            \Score
            \override NonMusicalPaperColumn.line-break-system-details =
            #'((alignment-distances . (1 3.4)))
      }
      \context {
            \Staff
            \numericTimeSignature
            \override VerticalAxisGroup.staff-staff-spacing =
            #'((basic-distance . 0) (minimum-distance . 0) (padding . 4) (stretchability . 0))
      }
      \context {
            \ChordNames
            \override VerticalAxisGroup.staff-affinity = ##f
            \override VerticalAxisGroup.staff-staff-spacing =
            #'((basic-distance . 0) (minimum-distance . 0) (padding . 4) (stretchability . 0))
      }
}

\paper {
      indent = 0
      system-system-spacing = #'((basic-distance . 0) (padding . 8))
}
%EXAMPLE 1 END OF CODE



%EXAMPLE 2 START OF CODE
%2. Fixed chord-staff-chord between two flexible staves
\version "2.18.2"

chord-rhythms = \relative b' {
      b2 b b b b b b b b b \break
      b2 b b b b b b b b b \break
}

BirdBlues = \chordmode {
      c1:7 b2:min7.5- e:7 a:min7 d:7 g:min7 c:7 f1:7
      c1:7 b2:min7.5- e:7 a:min7 d:7 g:min7 c:7 f1:7
}

BasicBlues = \chordmode {
      c1:7 f:7 c:7 c:7 f:7
      c1:7 f:7 c:7 c:7 f:7
}

"melody1" = \relative c' {
      c'2 c c c c c c c c c \break
      c,,2 c c c c c c c c c \break
}

"melody2" = \relative c {
      c1 f c c f \break
      c''1 f c c f \break
}

\score {

      \new StaffGroup
      <<

            \new Staff = "rh"  \"melody1"
            \new Staff = "chords"
            \with {
                  \omit Clef
                  \override StaffSymbol.line-count = #1
                  \override BarLine.bar-extent = #' (-3.5 . 3.5)
                  \override StaffSymbol.Y-extent = #'(-3.5 . 3.5)
                  \hideNotes
            }  \chord-rhythms
            \new ChordNames \with {
                  alignAboveContext = "chords"
            } \BirdBlues
            \new ChordNames \BasicBlues
            \new Staff = "lh" \with {
                  \clef "bass" } \"melody2"
      >>

}

\layout {
      ragged-right = ##t
      indent = 0

      \context {
            \Score
            \override NonMusicalPaperColumn.line-break-system-details =
            #'((alignment-distances . (NULL 1 3.4)))
      }
      \context {
            \Staff
            \numericTimeSignature
            \override VerticalAxisGroup.staff-staff-spacing =
            #'((basic-distance . 0) (minimum-distance . 0) (padding . 4) (stretchability . 0))
      }
      \context {
            \ChordNames
            \override VerticalAxisGroup.staff-affinity = ##f
            \override VerticalAxisGroup.staff-staff-spacing =
            #'((basic-distance . 0) (minimum-distance . 0) (padding . 4) (stretchability . 0))
      }
}

\paper {
      indent = 0
      system-system-spacing = #'((basic-distance . 0) (padding . 8))
}
%EXAMPLE 2 END OF CODE



%EXAMPLE 3 START OF CODE
%3. Fixed chord-staff-chord below two flexible staves
\version "2.18.2"

chord-rhythms = \relative b' {
      b2 b b b b b b b b b \break
      b2 b b b b b b b b b \break
}

BirdBlues = \chordmode {
      c1:7 b2:min7.5- e:7 a:min7 d:7 g:min7 c:7 f1:7
      c1:7 b2:min7.5- e:7 a:min7 d:7 g:min7 c:7 f1:7
}

BasicBlues = \chordmode {
      c1:7 f:7 c:7 c:7 f:7
      c1:7 f:7 c:7 c:7 f:7
}

"melody1" = \relative c' {
      c'2 c c c c c c c c c \break
      c2 c c c c c c c c c \break
}

"melody2" = \relative c {
      c1 f c c f \break
      c,,1 f c c f \break
}

\score {

      \new StaffGroup
      <<

            \new Staff = "rh"  \"melody1"
            \new Staff = "lh" \with {
                  \clef "bass" }  \"melody2"
            \new Staff = "chords"
            \with {
                  \omit Clef
                  \override StaffSymbol.line-count = #1
                  \override BarLine.bar-extent = #' (-3.5 . 3.5)
                  \override StaffSymbol.Y-extent = #'(-3.5 . 3.5)
                  \hideNotes
            }  \chord-rhythms
            \new ChordNames \with {
                  alignAboveContext = "chords"
            } \BirdBlues
            \new ChordNames \BasicBlues
      >>

}

\layout {
      ragged-right = ##t
      indent = 0

      \context {
            \Score
            \override NonMusicalPaperColumn.line-break-system-details =
            #'((alignment-distances . (NULL NULL 1 3.4)))
      }
      \context {
            \Staff
            \numericTimeSignature
            \override VerticalAxisGroup.staff-staff-spacing =
            #'((basic-distance . 0) (minimum-distance . 0) (padding . 4) (stretchability . 0))
      }
      \context {
            \ChordNames
            \override VerticalAxisGroup.staff-affinity = ##f
            \override VerticalAxisGroup.staff-staff-spacing =
            #'((basic-distance . 0) (minimum-distance . 0) (padding . 4) (stretchability . 0))
      }
}

\paper {
      indent = 0
      system-system-spacing = #'((basic-distance . 0) (padding . 8))
}
%EXAMPLE 3 END OF CODE



reply via email to

[Prev in Thread] Current Thread [Next in Thread]