Hi Joseph,

On Mon, Aug 21, 2023 at 8:08 PM Joseph Srednicki <[email protected]>
wrote:

> Hello:
>
> When coding organ pieces, I want the registration to appear following the
> header.
>
> In the following example, I inserted the registration in a markup block
> before the score block. When Lilypond renders the music, there is a large
> gap between the lines containing the composer's name and the opus number.
> The markup block containing the registration seems to "interrupt" the
> header.
>
> What is the recommended best way to code what I am trying to accomplish so
> that the markup block does not interrupt the header?
>
> I searched for an example but did not find appropriate results. If I
> missed something in the documentation or Lilypond snippets that will
> address this situation, please feel free to send me the link.
>

Short version: check
http://lilypond.org/doc/v2.24/Documentation/notation/custom-titles-headers-and-footers

Longer version:

One option that you might consider would be to define your own custom
header field for the registration. This can then be placed as desired in
the order of the various header fields. The page I linked above gives more
details on how to do that - it can be done at either the book level or for
each individual score. I modified your example to do this at the score
level, as such:

\version "2.24.0"
\language "english"

\paper {
  scoreTitleMarkup = \markup {
    \column {
      \if \should-print-all-headers { \bookTitleMarkup \hspace #1 }
      \fill-line {
        \fromproperty #'header:piece
        \fromproperty #'header:opus
      }
      \fromproperty #'header:myRegistration  % By placing the definition
here it follows along below the Opus entry, so as to not displace it
    }
  }
}

\header {
  title = \markup {\fontsize # -3 "Organ Piece"}
  subtitle = \markup {II.}
  composer = \markup {\fontsize # -3 "Composer Name (1685-1759)"}
  opus = \markup {\fontsize # -3 "Opus 3, No. 2"}
  tagline = ##f
  myRegistration = \markup {  % And here we give the info for the new
myRegistration header field, in the same way as any other header
    \tiny {
      \left-column {
        \line { "Registration:" }
        \line { "I-II-III: Fonds 8, 4, Mixtures" }
        \line { "Pd.: Fonds 16, 8, I-II-III" }
      } % end left-column
    } % end tin
  } % end markup
}

global = {
  \key f \major
  \numericTimeSignature
  \time 4/4
}

tu = \markup {"Tutti"}

rightOne = \relative c'' {
  \global
  \once \override Score.MetronomeMark.Y-offset = #+10
  \tempo \markup {"Allegro"} 4=100
  \partial 8 c8^\markup \raise #2.5 {"Tutti"} | % pickup
}

rightTwo = \relative c' {
  \global
  \partial 8 s8 | % pickup
}

leftOne = \relative c'' {
  \global
  \clef treble
  \partial 8 r8 | % pickup
}

leftTwo = \relative c'' {
  \global
  \partial 8 s8 | % pickup
}

pedal = \relative c {
  \global
  \partial 8 r8 | % pickup
}


\score {
  <<
    \new PianoStaff <<
      \new Staff = "right" << \rightOne \\ \rightTwo >>
      \new Staff = "left" { \clef bass << \leftOne \\ \leftTwo >> }
    >>
    \new Staff = "pedal" { \clef bass \pedal }
  >>
}

The custom headers can also be done at the book level, but all the gory
details can be found in the docs, starting with the page I linked above.
Hope that's enough to at least get you started. There's likely better
and/or more elegant ways to do this - I'm certainly no expert. But this
does at least seem to work, so may at least serve as a starting point.

One other point - if this solution works well enough for you, might
consider splitting the \paper block with the custom headers definitions out
into an include file of some kind. That may help keep things consistent.

-- 
Michael

Reply via email to