Discussion:
Score and parts with global variable
Andrew Bernard
2018-11-04 10:37:17 UTC
Permalink
After a long time using lilypond, for solo instrumental music exclusively,
now setting a string quartet for the first time and needing score and
parts. I confess that I am confused about using a global variable for tempo
indications and so on and so forth. Two newbie questions.

1.

In the NR template for a SQ with part this is given:

music = {
<<
\tag #'score \tag #'vn1
\new Staff \with { instrumentName = "Violin 1" }
<< \global \Violinone >>

\tag #'score \tag #'vn2
\new Staff \with { instrumentName = "Violin 2" }
<< \global \Violintwo>>

\tag #'score \tag #'vla
\new Staff \with { instrumentName = "Viola" }
<< \global \Viola>>

\tag #'score \tag #'vlc
\new Staff \with { instrumentName = "Cello" }
<< \global \Cello >>
}

I am unable to understand why the \global information does not print four
times. How does this work? The template by the way does not give example
code for the \global variable.

2.

I want to have parts that also contain all the tempo indications and markup
in the \global variable. It's beyond me how to make this happen. When I
add \global to the parts I get an extra unwanted staff.

I have not provided an MWE because all my code is simply rubbish at this
stage and I don't want to waste people's time looking at it. I just need
some conceptual guidance I think. I searched the user archives to the best
of my ability and there are threads that partially touch on this but I am
none the wiser.

For now I want to stick with the tag approach rather than the edition
engraver, unless what I want can't be done that way.

Andrew
Andrew Bernard
2018-11-04 10:51:30 UTC
Permalink
Pardon me. Ignore question 2. I had failed to write the correct code as per
the template example. Apologies for that particular noise.

Andrew
Mark Knoop
2018-11-04 11:06:29 UTC
Permalink
Post by Andrew Bernard
After a long time using lilypond, for solo instrumental music
exclusively, now setting a string quartet for the first time and
needing score and parts. I confess that I am confused about using a
global variable for tempo indications and so on and so forth. Two
newbie questions.
1.
music = {
<<
\tag #'score \tag #'vn1
\new Staff \with { instrumentName = "Violin 1" }
<< \global \Violinone >>
\tag #'score \tag #'vn2
\new Staff \with { instrumentName = "Violin 2" }
<< \global \Violintwo>>
\tag #'score \tag #'vla
\new Staff \with { instrumentName = "Viola" }
<< \global \Viola>>
\tag #'score \tag #'vlc
\new Staff \with { instrumentName = "Cello" }
<< \global \Cello >>
}
I am unable to understand why the \global information does not print
four times. How does this work? The template by the way does not give
example code for the \global variable.
Yes, it does somewhat depend on what you put in global. I do something like this:

global = {
\time 4/4
\tempo 4=72
s1*4
\bar "||"
\time 3/4
\tempo 4=96
s1*3/4*12
\bar "|."
}

% define violinone. violintwo, viola, cello

\book {
\bookOutputName "score"
\score {
\new Score {
<<
\new Dynamics \global
\new Staff \violinone
\new Staff \violintwo
\new Staff \viola
\new Staff \cello
}
}
}

\book {
\bookOutputName "violinone"
\score {
\new Score {
<<
\new Dynamics \global
\new Staff \violinone
}
}
}
--
Mark Knoop
Torsten Hämmerle
2018-11-04 11:11:12 UTC
Permalink
Post by Andrew Bernard
I am unable to understand why the \global information does not print four
times. How does this work? The template by the way does not give example
code for the \global variable.
Hi Andrew,

Whether the \global information is printed four times or not solely depends
on the actual contents of the \global variable. Being used to
single-instrument music, you might not be fully aware of the difference
between \Score and \Staff level (if you only have one \Staff, you won't
notice a difference).

TimeSignature, MetronomeMark, RehearsalMark, etc., are defined on \Score
level and that's the reason why they are not being printed four times: they
just go on top of the score.
Nevertheless they should be included in all the staves because they are
needed in the individual parts and it is easy to find errors (if these
events do not happen simultaneously, you will be able to immediately
recognize it in the score).

If, however, the \global variable contains TextScripts, just to name an
example, these TextScripts will actually be printed four times, because
TextScript is defined on \Staff level.


BTW: I usually specify instrumentName/shortInstrumentName in the \score
block. They often need some markup tweaking, the appropriate indent value of
the score plays a role, I don't have to hassle with too many \tags and,
finally, they are not needed at all in the parts.
In the parts, the instrument will go into the instrument header property
instead.
But, as always, there are many ways to go...

HTH,
Torsten





--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html

Loading...