lilypond-user
[Top][All Lists]
Advanced

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

Re: \repeat with upbeat (partial) and alternatives


From: Mats Bengtsson
Subject: Re: \repeat with upbeat (partial) and alternatives
Date: Mon, 02 Mar 2009 22:58:18 +0100
User-agent: Thunderbird 2.0.0.19 (X11/20090105)

Why not simply include the following setting at the top of your
score
   \set Timing.barCheckSynchronize = ##t
and insert a bar check | at the end of the measure you want to
end prematurely? OK, you will still get a warning printout, but
otherwise it solves all the problems.

  /Mats

Dan Eble wrote:
 <E.Weehaeli> writes:
it is only after a long search that I found an easy way to repeat a part of a melody - with an upbeat - ending before the end of a measure - having different durations in the alternatives
- without producing warnings in the log

\version "2.11.49"
{ \repeat volta 2 { \partial 8 c'8 | c'2.}
 \alternative {{ f'8 } { \partial 4 f'4 | }}
 d'1 |
 }


I'm sorry to be the bearer of bad tidings, but this trick is not
generally useful. \partial moves the timing counter backwards, which effectively
combines the last measure of the first alternative with the
first measure of the second alternative, forming one longer-than-usual
measure that is split visually by a repeat sign.

From your example, it doesn't seem like a big deal, but change your
"f" to "fis" and see what happens.  The sharp sign will be missing from
the second alternative.  Another thing you can do is turn on bar numbers
and add enough measures to the example to make lilypond print one.  You
will see that the first alternative is not counted as a measure.

Try using the following "\measure" function instead of "\partial 4" in
your example.  It should be used in the same place, at the beginning of
the second alternative, otherwise it will cause problems if you ever
unfold the repeat.

% End a measure prematurely.  For example, when an alternate ending
% ends in a partial measure.
measure =
#(define-music-function
   (parser location) ()
   (let ((m (make-music 'ApplyContext)))

     (define (do-it context)
       (let* ((measurePos (ly:context-property context 'measurePosition))
              (measureLen (ly:context-property context 'measureLength)))

         (if (and (ly:moment<? ZERO-MOMENT measurePos)
                  (ly:moment<? measurePos measureLen))
             (ly:context-set-property! context 'measurePosition measureLen))))

     (set! (ly:music-property m 'procedure) do-it)

     (context-spec-music m 'Timing)))

If there are any scheme gurus in the audience, I don't mind criticism.



_______________________________________________
lilypond-user mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/lilypond-user


--
=============================================
        Mats Bengtsson
        Signal Processing
        School of Electrical Engineering
        Royal Institute of Technology (KTH)
        SE-100 44  STOCKHOLM
        Sweden
        Phone: (+46) 8 790 8463                         
       Fax:   (+46) 8 790 7260
        Email: address@hidden
        WWW: http://www.s3.kth.se/~mabe
=============================================





reply via email to

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