lilypond-user
[Top][All Lists]
Advanced

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

RE: headers, and what include doesn't do


From: Mark Stephen Mrotek
Subject: RE: headers, and what include doesn't do
Date: Fri, 16 Oct 2020 12:41:10 -0700

Jean,

 

With respect, I disagree.

See my attached code for a Mozart Sonata.

 

Mark

 

From: lilypond-user [mailto:lilypond-user-bounces+carsonmark=ca.rr.com@gnu.org] On Behalf Of Jean Abou Samra
Sent: Friday, October 16, 2020 6:51 AM
To: lilylis@lionunicorn.co.uk; Lilypond-User Mailing List <lilypond-user@gnu.org>
Subject: Re: headers, and what include doesn't do

 

 

 

Hello,

(Sorry if this message appears in another thread; this will be fixed soon.)

Thank you guys. I tried the way Mark suggested before and I get the same result of III. being shown on the first page. So still not seeming to understand. 

 

I have also tried the include-all-headings=##t which doesn't seem to change anything. What I have is:

\version "2.20.0"

 

\paper {

 %system-system-spacing,  #' basic-distance = #25

 systems-per-page =  6

 print-all-headers = ##f

}

 

\header {

  title = "Circle"

   subtitle = \markup { "I."  }

  composer = \markup {

   \center-column {  

    

    "Molly Preston"

    (2020)

     }

  }

    tagline = ##f

}

 

 

\include "Circle_mvt1.ly"

\pageBreak

 

 

 

\include "Circle_mvt2.ly"

\pageBreak

\include "Circle_mvt3.ly"

 

  

My ly files are set up as :

 

\header {

}

upper =

lower =


This is the problem. As David said, there is no scoping inside
each LilyPond file. The scoping is done through \score blocks.

In other words, the file resulting from \include statements that
is finally processed by LilyPond (roughly, see below) looks like:

\header {
  title = "Title"
}

\header {
  piece = "Piece 1"
}
\score { c'1 }

\header {
  piece = "Piece 2"
}
\score { c'1 }

And when the third \paper block is processed, its contents override the
second block, because both are at the top level.

The solution to have per-score headings is to put your individual headers
inside the score block.

\header {
  title = "Title"
}

\score {
  { c'1 }
  \header {
    piece = "Piece 1"
  }
}

\score {
  { c'1 }
  \header {
    piece = "Piece 2"
  }
}

(For technical reasons, \header should come after the music inside \score.)

It's seems very likely from the way you've expressed your problem that
you think LP attaches some meaning to \include. It doesn't. Writing
\include "foo.ly"   just pastes the contents of foo.ly into the source
at that point. After all the \include files have been copied in, then
LP processes the resulting big/gigantic file that results. (You could
perfectly well do the same assembly job with cut&paste in an editor.)


Kind of, but not exactly. For example, LilyPond will still warn you about
a missing \version statement in your main file even if an \included file
contains one.

In practice, this is the only difference from copy-pasting that I'm aware
of, though.

Best,
Jean

Attachment: K 310.ly
Description: Text Data


reply via email to

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