[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to reuse common header attributes
From: |
Thomas Morley |
Subject: |
Re: how to reuse common header attributes |
Date: |
Sun, 9 Dec 2012 21:27:48 +0100 |
2012/12/9 Xavier Noria <address@hidden>:
> Hi,
>
> I am getting familiar with the docs, but can't yet figure this out by myself.
>
> I am transcribing a song in C, and would like the same document to
> include its transposition in E flat. The file structure I have come
> with so far is:
>
> \version "2.16.1"
>
> \include "english.ly"
>
> melody = \relative c'' { ... }
> \addlyrics { ... }
>
> \bookpart {
> \header {
> title = "title"
> subtitle = "(Transcription in C)"
> composer = "composer"
> tagline = "tagline"
> }
>
> \score {
> { \melody }
> }
> }
>
> \bookpart {
> \header {
> title = "title"
> subtitle = "(Transcription in E flat)"
> composer = "composer"
> tagline = "tagline"
> }
>
> \score {
> { \transpose ds c \melody } % "ds" because "ef" yields a weird key
> }
> }
>
> As you see some data repetition remains in the headers (title,
> composer, and tagline, subtitle differs).
>
> Questions:
>
> 1) The structure and variable usage are idiomatic?
>
> 2) Is there a clean way to factor those common header attributes out somehow?
Depends on what you want. For your example you could use:
\version "2.16.1"
\include "english.ly"
melody = \relative c'' { \key c\major c1 }
\addlyrics { word }
\header {
title = "title"
composer = "composer"
tagline = "tagline"
}
\bookpart {
\header {
subtitle = "(Transcription in C)"
}
\score {
{ \melody }
}
}
\bookpart {
\header {
subtitle = "(Transcription in E flat)"
}
\score {
{ \transpose c ef \melody }
}
}
HTH,
Harm
Re: how to reuse common header attributes, Keith OHara, 2012/12/09