8

I have used repeats with alternatives before without any problem, but now (all of a sudden?) I am seeing some very odd behavior, where the first alternative only has one note regardless of duration. Here is a very simple example:

This:

\relative c' {
  \repeat volta 2 { c4 c c c |}
  \alternative { d d d d |} {e e e e |}
}

Renders this:

score snippet

And, incidently, I get a barcheck error at the end of the second alternative.

This is with version 2.18.2.

Thank you in advance for any suggestions. I am baffled!

12

Doh.

I omitted the outer curly braces around the two alternatives. The corrected version should be:

\relative c' {
  \key f \major
  \repeat volta 2 { c4 c c c |}
  \alternative { { d d d d |} {e e e e |} }
}
  • Is this intended as "edit" to the question above? It is different from the graphics at least... – guidot Mar 27 '17 at 15:12
  • 8
    @guidot it's not an "edit" to the question, it's the answer to the question. The OP forgot that you need a set of curly braces round all the "alternative" options. The incorrect input in the question gives the warning message "More alternatives than repeats. Junking excess alternatives." It is actually defining four alternative endings, each one note long (the four d's), and the curly braces round the four e's are just irrelevant noise (but not an error, as such). – user19146 Mar 27 '17 at 16:02
  • 2
    Tomorrow, you can accept your own answer so the system marks this as resolved. – OldBunny2800 Mar 28 '17 at 0:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.