lilypond-user
[Top][All Lists]
Advanced

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

Re: define \header


From: address@hidden
Subject: Re: define \header
Date: Sat, 6 Apr 2013 19:49:21 +0000 (GMT)

Ok, I'll try to clarify:

First off, Marek is correct, \header can appear within \score{} and is useful 
especially when printing all headers as I'm doing.

My initial music input files essentially look like this:


one-global = \relative {
  <key/clef/repeats/etc>
}

one-first = \relative c' {
   <top part music>
}

one-second = \relative c' {
  <second part music>
}

one-third = \relative c' {
  <third part music>
}

one-fourth = \relative c {
  <bottom part music>
}

The second chorale is in the same file.  The above blocks are the same except 
that they start with 'two-'

My score definitions are in another file:

chor-one = {
  \context StaffGroup <<
    \new Staff <<
      \one-global
      \context Voice = "first"  <<
        \voiceOne \one-first
      >>
      \new Voice = "second" <<
        \voiceTwo \one-second
      >>
    >>
    \new Staff <<
      \one-global
      \context Voice = "third"  <<
        \voiceOne \one-third
      >>
      \new Voice = "fourth" <<
        \voiceTwo \one-fourth
      >>
    >>
  >>
}

Again, the next chorale's score block has 'one-' replaced with 'two-' (except 
at the top of the block where it's '-two' instead of '-one')

So far, so good.

Now, the file which is actually going to produce the PDF:

\book {
  \paper {
    print-all-headers = ##t
  }
  \bookpart {
    \score{
      \chor-one
      \header {
        title = "Title 1"
        subtitle = "Subtitle 1"
        composer = "Composer 1"
        }
    }
    \score{
      \chor-two
      \header {
        title = "Title 2"
        subtitle= "Subtitle 2"
        composer = "Composer 2"
      }
    }
    \paper {
      page-count = #1
    }
  } %% end bookpart
}


The above series of files work just fine but I would like to move the actual 
header information out of this file.  If I put it in the score blocks in the 
second file I get syntax errors.  I had thought that since I could have the 
\header block inside a score block I could simply keep it with the defined 
score block.  Evidently I was wrong.

Is there a way of doing this?

-David


----- Original Message -----
From: "Urs Liska" <address@hidden>
To: "Urs Liska" <address@hidden>
Cc: address@hidden
Sent: Saturday, April 6, 2013 6:44:11 PM
Subject: Re: define \header

I still don't have a sufficient picture of your material,
but you may try another approach:

If your initial concern was to clean up the 'master' .ly file you may:
- define each chorale in one file:
  - write your music definitions
  - write a \header block
  - write a \score block
- In the master file you can \include the individual chorale files so you have 
only one line per chorale.

Of course the included chorale doesn't have to be completely defined in one 
single file but can also use includes.

One question that isn't clear from your initial post:
Do you write the \score blocks manually for each chorale?
Or do you have a default block that you include?

Urs



On Sat, 06 Apr 2013 20:08:05 +0200
Urs Liska <address@hidden> wrote:

> Sorry,
> 
> a closer look showed me that your request was quite the opposite of what 
> my suggestion could provide :-(
> 
> Really a \header block is a top-level expression that can't be written 
> inside a \score:
> http://www.lilypond.org/doc/v2.17/Documentation/notation/file-structure
> 
> Sorry again, I don't see an easy solution for your question (although it 
> should be possible with Scheme ...)
> 
> Urs
> 
> Am 06.04.2013 18:30, schrieb address@hidden:
> > Two things:
> >
> > One; This looks like I would need to create a separate header file for each 
> > chorale.  This might not be quite what I'd prefer.
> >
> > Two; I couldn't make it work anyway.
> >
> > When you say:
> >
> > "You may put your \header in a separate file and \include it where you
> > want it to appear."
> >
> > Do you mean:
> >
> > \score {
> >      \definedScoreStuff
> >      \header {
> >            \include "headerFile.ly"
> >       }
> > }
> >
> > -David
> >
> > ----- Original Message -----
> > From: "Urs Liska" <address@hidden>
> > To: address@hidden
> > Sent: Saturday, April 6, 2013 3:07:51 PM
> > Subject: Re: define \header
> >
> > You may put your \header in a separate file and \include it where you
> > want it to appear.
> > Does that help you?
> >
> > Urs
> >
> > Am 06.04.2013 17:02, schrieb address@hidden:
> >> I think I've probably answered my own question already.
> >>
> >> I want to define a header block and then use the definition later.
> >>
> >> What I'm trying to do and why:
> >>
> >> I'm putting together a book of chorales for trombone quartet.  I have the 
> >> music for each part defined.  Then I create \score blocks containing the 
> >> '\definitions'.  With a whole book of these the \book{} block was getting 
> >> a bit blinding to read.  I figured out how to define my \score blocks and 
> >> then use my '\scoreDefinitions' to greatly reduce the complex look of the 
> >> \book{} file.
> >>
> >> The \header, however, seems to require being in the final \book{} block.  
> >> That is, I can't do:
> >>
> >> headerOne = {
> >>        title = "Title"
> >>        composer = "Composer"
> >>        }
> >>
> >> ...and then use:
> >>
> >> \headerOne
> >>
> >> ...inside a \score block.  I'm using; print-all-headers = ##t, so I can 
> >> print all the title/subtitle info for each chorale.
> >>
> >> Depending on how I try, LilyPond throws errors like "unexpected \header" 
> >> or something about a problem with a music definition.  This has led me to 
> >> conclude that pre-defining things works with musical information, but not 
> >> otherwise.  Headers are not musical information.
> >>
> >> Is there a way to do this, or am I stuck with putting the header blocks in 
> >> the \book{} block?
> >>
> >> -David
> >>
> >> _______________________________________________
> >> lilypond-user mailing list
> >> address@hidden
> >> https://lists.gnu.org/mailman/listinfo/lilypond-user
> >
> > _______________________________________________
> > lilypond-user mailing list
> > address@hidden
> > https://lists.gnu.org/mailman/listinfo/lilypond-user
> >
> > _______________________________________________
> > lilypond-user mailing list
> > address@hidden
> > https://lists.gnu.org/mailman/listinfo/lilypond-user
> 
> 
> _______________________________________________
> lilypond-user mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/lilypond-user

_______________________________________________
lilypond-user mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user



reply via email to

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