bug-lilypond
[Top][All Lists]
Advanced

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

Re: \alternative behaving incorrectly, and causing unending loop


From: Leo Adamson
Subject: Re: \alternative behaving incorrectly, and causing unending loop
Date: Tue, 24 Apr 2012 17:14:04 +0100

Dear Colin

Your reply came in as I was replying to Marek. I'm impressed!

You said:
> Doesn't this create a conflict with more conventional uses of \alternative?

I'm fairly confident that my use of \alternative is conventional, and
absolutely confident that there would be no conflict with any other
conventional use. The whole point of alternatives is that they are
alternative continuations _from the same point_. Odd combinations of
alternatives and up-beats are not even all that unusual, especially in
17th century dance music. However, because there is a practical
workaround, I do agree that it's not a high priority request at all.

Here are samples and comments I also sent to Marek, who slightly
misunderstood the problem (I think you have understood it, but I'm not
completely sure):

For demonstration purposes, pad original sample to:
   \relative c'' {
    \partial 8
    \repeat volta 2 { c8 c1 c2~c4. }
    \repeat volta 2 { b8 b1 }
    \alternative { { b2~b4. } { b1 } }
    \repeat volta 2 { \time 3/4 c2. }
   }
(This generates nonsense output, or an endless loop with
Completion_heads_engraver.)

And here is a sample that is semantically equivalent to what I am
after, making what I guess you mean by 'conventional' use  of
alternatives:
\relative c'' {
 \partial 8 c8
 \repeat volta 2 { c1 }
 \alternative { { c2~c4. c8 } { c2~c4. b8 } }
 \repeat volta 2 { b1 }
 \alternative { { b2~b4. b8 } { b1 } }
 \repeat volta 2 { \time 3/4 c2. }
}

But that is a little ugly because it has an unnecessary \alternative
set at the end of the first strain.

Finally, the version using my workaround that gives the exact output required:
   \relative c'' {
    \partial 8
    \repeat volta 2 { c8 c1 c2~c4. }
    \repeat volta 2 { b8 b1 }
    \alternative { { b2~b4. } { \cadenzaOn b1 \cadenzaOff } }
    \repeat volta 2 { \time 3/4 c2. }
   }

The \cadenzaOn is needed because Lilypond thinks the second
alternative starts on the last quaver of the bar. But that is
incorrect. The second alternative starts on the first beat of the bar
because the first alternative does. The count within the bar should
really be reset on entering the second alternative (to whatever it was
at the start of the first alternative).

I'm at the limit of my articulateness, so I hope that makes sense!

Kindest regards
Leo



reply via email to

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