lilypond-user
[Top][All Lists]
Advanced

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

Re: how to reuse common header attributes


From: Keith OHara
Subject: Re: how to reuse common header attributes
Date: Sun, 9 Dec 2012 23:13:11 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Xavier Noria <fxn <at> hashref.com> writes:

> I am transcribing a song in C, and would like the same document to
> include its transposition in E flat. 
[...]
> 1) The structure and variable usage are idiomatic?
>
I think so, mostly. Maybe put an extra set of {} around \addlyrics,
just in case you forget how \addlyrics works (like I often do).
 
> 2) Is there a clean way to factor those common header attributes out somehow?
> 
You can put a \header{} at the beginning, see below, and those items are 
repeated for each book part.  (But if someday you *don't* want the title 
repeated, you need  \paper { bookTitleMarkup = "" } in each \bookpart after 
the first.)

> I store one melody in concert pitch in
> a variable, and then reuse that variable for the original and
> transposed scores. But the docs of \transposition say " \transposition
> should only be used if the pitches are not being entered in concert
> pitch.", so apparently it is not intended for my use case.
> 

"\transposition bes" would tell LilyPond: "in the following music, what 
is written as concert C sounds as concert B-flat."  LilyPond uses the 
distinction between written and sounding pitches for midi, and for writing 
"cue notes" when one instrument listens for cues from another.

In your case, you *could* tell LilyPond the truth by writing
"\transposition c" but that will probably not help anything in your score.
(It would make midi pitches come out in concert pitch, even if you
use "\transpose es, c \melody" in the score with midi output.)

\version "2.16.1"
\include "english.ly"
melody = {
  \relative c' {
  \transposition c % probably not needed
  \key fs\major fs gs as b }
  \addlyrics { do re mi fa } 
}
\header {
  title    = "title"
  composer = "composer"
  tagline  = "tagline"
}
\bookpart {
  \header {
    subtitle = "Score in C"
  }
  \score {
    \melody
  }
}
\bookpart {
  \header {
    subtitle = \markup { "Part for" \concat{"E"\flat} "saxaphone"}
  }
  \score { % enharmonic transposition, due to the key of f-sharp
    \transpose ds, c \melody
  }
}





reply via email to

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