Am 11.11.2016 um 15:28 schrieb Federico Bruni: > Il giorno ven 11 nov 2016 alle 14:40, Federico Bruni > <[email protected]> ha scritto: >> Il giorno ven 11 nov 2016 alle 13:50, Bernhard Kleine >> <[email protected]> ha scritto: >>> I have for the sake a MWE a main file and a included file. When this >>> file was compiled alone with a header and language it compiled well. >>> Now, given I want to get a book with several songs, I encounter errors >>> since the variables disturb the compilation. >>> >>> The files are attached. Please let me know how to change the input >>> that >>> correct compilation occurs. >> >> Hi Bernard >> >> 2test.ly file contains a variable which is defined after it's called. >> This cannot work, because lilypond parses the file from top to >> bottom, IIUC. >> >> If you want to compile a single piece independently from a book >> (collection of pieces), the best approach is probably using a .ily >> file for music definitions and variables. Basic example: >> >> % File score1.ily >> % The point here is: just define variables, do not print anything. >> global = { >> ... >> } >> ScoreOneMusic = \score { >> \global >> ... >> \layout {} >> } > > The other point that I should have highlighted is: you must use > different variable names in each score, otherwise the latest > definition will override the previous ones. So instead of "global" you > should rather use e.g. "ScoreOneGlobal". > >> >> >> % File score1.ly >> \include "score1.ily" >> \ScoreOneMusic >> >> >> % File book.ly >> \include "score1.ily" >> \include "score2.ily" >> >> \book { >> \bookpart { >> \ScoreOneMusic >> } >> \bookpart { >> \ScoreTwoMusic >> } >> } First of all: I look through the Lilypond Notation Reference and there was not a single occurence of .ily. Maybe you will explain more.
However when the global variable to the top of 2test.ly, the file could
be compiled. I tried then the same on my full piece and I failed while
parsing with
F:/Meine Noten/EigeneNoten/WeihnachtsLieder/2test.ly:2:1 <0>: error:
syntax error, unexpected STRING
global = {
To make this evident I include the files once more. I do not understand
this.
Regards Bernhard
global = {
\set fontSize = #0.8
\key d \major
% \numericTimeSignature
\time 4/4
\mergeDifferentlyHeadedOn
\partial 4
}
stimme = \relative c'' {
\global
%Melodie
\repeat volta 2 {
a4 | d a8[ a] g4 fis8[ e] |
}
}
verseOne = \lyricmode {
Auf! Chris -- ten singt fest -- li -- che
}
repeatFirst = \lyricmode {
Es schal -- le auf Er -- den laut
}
\score {
\new StaffGroup
<<
\new Staff
<<
\new Voice = "stimme" \stimme
>>
\new Lyrics \lyricsto "stimme" \verseOne
\new Lyrics \lyricsto "stimme" \repeatFirst
>>
\layout {
indent = 0
\context {
\Voice
\consists "Melody_engraver"
\override Stem #'neutral-direction = #'()
}
}
\header {
title = "Auf! Christen singt festliche Lieder"
composer = "Text und Melodie: Fulda, 1778"
}
}
\version "2.19.5"
\language "deutsch"
#(set-global-staff-size 17)
\paper {
#(set-paper-size "a4")
}
\header {
title = "main"
tagline = \markup {
Gesetzt durch Bernhard Kleine mit
\line { LilyPond \simple #(lilypond-version) (http://lilypond.org/) }
}
}
\book {
\bookpart {
\include "2test.ly"
}
}
signature.asc
Description: OpenPGP digital signature
_______________________________________________ lilypond-user mailing list [email protected] https://lists.gnu.org/mailman/listinfo/lilypond-user
