bug-lilypond
[Top][All Lists]
Advanced

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

Re: repeat volta 2


From: tisimst
Subject: Re: repeat volta 2
Date: Thu, 25 Jun 2015 09:57:27 -0700 (MST)

On Thu, Jun 25, 2015 at 3:41 AM, pihentagy [via Lilypond] <
address@hidden> wrote:

>  tisimst wrote
> Gergely,
>
> On Mon, Jun 22, 2015 at 2:55 PM, Gergely [via Lilypond] <
> [hidden email] <http:///user/SendEmail.jtp?type=node&node=178188&i=0>>
> wrote:
>
> > > I'm not top posting.
> >
> > % Should I expect lilypond to understand what's going on?
> > % violin and viola are both 5 bar lenght staff, but see the combined
> > output?
> >
> > violin = \relative c'' {
> > \repeat volta 2 { c4 d e f | }
> > \alternative { { c2 e | } { f2 g | } }
> > c1
> > }
> >
> > viola = \relative c' {
> > \repeat volta 2 { c4 d e f | c2 c }
> > c1
> > }
> >
> > \score {
> >   <<
> >     \new Staff \violin
> >      \new Staff { \clef alto  \viola }
> >   >>
> > }
> >
>
> Not a bug. Actually, they aren't the same length. If we line up the two
> parts I get this:
>
> violin = |: c4 d e f | c2 e :| f2 g | c1 |
> viola =  |: c4 d e f | c2 e :| c1   |
>
> Nope, it is:
>
> violin = | c4 d e f | c2 e | c4 d e f | f2 g | c1 |
> viola =  | c4 d e f | c2 e |c4 d e f  | c2 e | c1 |
>
> Look, I understand what you are saying and, you're right, that is how the
musician *performs* it, but this isn't how LilyPond *engraves* it. If the
two parts are to be engraved in that expanded form, great! They each have
five bars and all questions are answered, but if they are to be engraved
using repeat bars, then we have a different problem if the OP doesn't want
to engrave a 2nd alternate ending in the conductor's score or the viola's
part and that's going to cause rehearsal confusion. I hope we can agree on
that at least.

> tisimst wrote
>
> So, looking at it by the raw musical content, I see 4 bars for violin and
> only 3 for viola. The problem would seem to be the missing 2nd alternative
> ending for the viola. Does this help clarify what's going on? The \repeat
> function won't automatically duplicate the notes for you. You need to do
> that, like you did with the violin part:
>
> viola = \relative c' {
>   \repeat volta 2 { c4 d e f | }
>   \alternative { { c2 e | } { c2 e | }}
>   c1
> }
>
> Note that there are fancier ways of dealing with this situation, but see
> if
> what I've explained works for you.
>
> HTH,
> Abraham
>
> I am interested in the fancier ways. And shouldn't lilypond warn me /
> throw me an error about that inconsistency?
>

I'll get into the fancier ways in a moment, but first about the warnings.
Should there be one? I don't know if there needs to be in this case. The
real confusion is in what we *think* we're telling LilyPond to engrave and
what is *actually* being engraved. We engrave the specifed notes, the staff
lines, the clefs, the barlines, the alternate ending brackets and numbers.
We don't tell LilyPond, "engrave these notes the first time through to the
repeat sign, then go back and engrave the second repeat this way". It
doesn't interpret the music like that. LilyPond's engraving rules are
deep-rooted in classical notation. I've never seen a classical score try to
take this shortcut for repeats, so we shouldn't expect LilyPond to
interpret that intention. It doesn't think of these parts as having 5 bars
each to engrave, it sees the violin with 4 bars and the viola with 3 bars.
We can change that with \unfoldRepeats, but that also changes what we are
really telling LilyPond to engrave.

So, the moral of this story is: Expect LilyPond to more literally engrave
what you give it. It is designed to think like an engraver, not a performer.

Now, what I meant by "fancier ways" really has to do with the practice of
separating music from layout/structure. If you've never done this before,
this is MAJORLY helpful when you need to engrave different editions of the
same music. Here's an example of how this can be done, the benefit is that
you only need to input the notes once and you can reuse it multiple times.
I'll also show how to use the handy \tag function to conditionally include
code:

%<------------------------------ SNIP ------------------------------

\version "2.18.2"

violinMusic = \relative c'' {
  c4 d e f |
  c2 e |
  g2 g |
  c1
}

violaMusic = \relative c' {
  c4 d e f |
  c2 e |
  \tag #'forConductorScore { c2 e } |
  c1
}

conductorScoreStructure = {
  \repeat volta 2 { s1 }
  \alternative { { s1 } { s1 } }
  s1
}

violinPartStructure = \conductorScoreStructure

violaPartStructure = {
  \repeat volta 2 { s1*2 }
  s1
}

% Conductor's Score
\score {
  <<
    \new Staff <<
  \conductorScoreStructure
      \violinMusic
  >>
    \new Staff <<
   \conductorScoreStructure
  { \clef alto \violaMusic }
    >>
  >>
}

% Violin's Part
\score {
  \new Staff <<
    \violinPartStructure
  \violinMusic
  >>
}

% Viola's Part
\score {
  \new Staff <<
    \violaPartStructure
  { \clef alto \removeWithTag #'forConductorScore \violaMusic }
  >>
}

%<------------------------------ SNIP ------------------------------

One thing to take away from this is that if you don't use \removeWithTag,
you don't need to say anything for the tagged music to be engraved. There
are variations on this theme, but this is the general idea that can really
pay of in time savings.

- Abraham




--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/repeat-volta-2-tp178090p178205.html
Sent from the Bugs mailing list archive at Nabble.com.


reply via email to

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