[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: repeats, nested repeats and alternatives
From: |
Mats Bengtsson |
Subject: |
Re: repeats, nested repeats and alternatives |
Date: |
Fri, 07 Sep 2007 09:41:13 +0200 |
User-agent: |
Thunderbird 2.0.0.5 (X11/20070716) |
Neil Puttock wrote:
Hi Yota,
On 9/6/07, *yota moteuchi* <address@hidden
<mailto:address@hidden>> wrote:
Here, magically, the second alternative bar vanished... why ?!
You can't put overrides (or anything else) between the bracketed
sections of \alternative; just put the bar number override inside the
second alternative.
Well, you can, but what your code
\alternative {
{ e f e f }
\set Score.currentBarNumber = #2
{ e f e b}
means is that the first alternative is { e f e f }, your second
alternative is
\set Score.currentBarNumber = #2 and your third alternative is { e f e b}.
Read section "Music expressions explained" to understand why.
Also, regarding the bar numbering, the typesetting practice varies from
score to
score. I've seen many scores where the two alternatives are counted as
separate
measures.
3) Collapsing alternatives
>This is more a suggestion than a question but when dealing with big
orchestral parts, the >\alternative tag is very painful to maintain.
Indeed, in some case, trumpets have the same >alternatives bars ( i.e.
alternative 1. and 2. are duplicates) and should/might be collapsed into
>one bar. While in the conductor it have to remain expanded (because
flutes have different >altenatives).
>Could this automatic collapsing (and numbering) be implemeted easily
or obtained via a
>tweak?
One solution is to define your own music function (or rather use two
alternative
implementations of the same function), which takes two arguments, the
main part
of the repeat and the alternative. Here's an example. Note that both
\score blocks
are identical.
\version "2.10.0"
% Definition to use in the individual parts:
repeatSameAlt =
#(define-music-function (parser location repeatbody alternative)
(ly:music? ly:music?)
#{
\repeat volta 2 {$repeatbody $alternative }
#})
\score{
\relative c''{
\time 3/4
c c c
\repeatSameAlt { d d d } { g g g }
}
}
% Definition to use in the conductors score:
repeatSameAlt =
#(define-music-function (parser location repeatbody alternative)
(ly:music? ly:music?)
#{
\repeat volta 2 $repeatbody \alternative{{ $alternative }{ $alternative }}
#})
\score{
\relative c''{
\time 3/4
c c c
\repeatSameAlt { d d d } { g g g }
}
}
/Mats