bug-lilypond
[Top][All Lists]
Advanced

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

Re: Percent repeats in lyrics causes error in 2.18.2


From: Thomas Morley
Subject: Re: Percent repeats in lyrics causes error in 2.18.2
Date: Tue, 7 May 2019 22:40:50 +0200

Am Di., 7. Mai 2019 um 14:15 Uhr schrieb <address@hidden>:
>
> I've entered some repeated music and folded it with 'repeat percent' in
> the score.
> However, lyrics doesn't understand the repetition, so adding
> \unfoldRepeats caused messing between music and lyrics.
> I've added same 'repeat percent' to the lyrics pieces then. It works
> perfectly when unfoldRepeats is active!
>
> But happend when I removed 'unfoldRepeats'. Piece of percents
> immediately crashed lilypond internals with error:
>
> Interpreting
> music...[8][16][24][32][40][48][56][64]/usr/share/lilypond/2.18.2/scm/m
> usic-functions.scm:319:21: In procedure car in expression (car durs):
> /usr/share/lilypond/2.18.2/scm/music-functions.scm:319:21: Wrong type
> (expecting pair): ()
>
> Wrong fragment caused error looks like:
> %\lyricmode {
> ...
> \repeat percent 2 { Di -- es, di -- es i -- ræ. }
> ...
> %}
>
> The objective here is that it would be good to have a kind of repeat
> (for lyrics) which just show the content once being 'compressed', but
> repeat it when being unfolded, without any other side effects.
> Volta repeat doesn't work, because it causes repetition marks to be
> injected into the score (yes, even being applied just to the lyrics; it
> is maybe another bug).
> Percent repeat also doesn't work, but causes even worse stopper error,
> then just unusual output.

Hi,

thanks for your report.
Though, it's the first time ever I've heard somebody wants to use
\repeat percent in Lyrics...

Anyway, the error occurs, because `calc-repeat-slash-count´ from
music-functions.scm doesn't listen to LyricEvent.
`calc-repeat-slash-count´ is read then in `lily-imports.cc´.

A fix for the crash would be to add LyricEvent in `calc-repeat-slash-count´.
Ofcourse, the slash wouldn't be printed without consisting the
relevant engravers to Lyrics.

No idea whether we should go for it.
Opinions?

For now a brute-force workaround:

#(define (my-calc-repeat-slash-count music)
  "Given the child-list @var{music} in @code{PercentRepeatMusic},
calculate the number of slashes based on the durations.  Returns @code{0}
if durations in @var{music} vary, allowing slash beats and double-percent
beats to be distinguished."
  (let* ((durs (map duration-of-note
                    (extract-named-music
                      music
                      '(EventChord NoteEvent LyricEvent RestEvent SkipEvent))))
         (first-dur (car durs)))

    (if (every (lambda (d) (equal? d first-dur)) durs)
        (max (- (ly:duration-log first-dur) 2) 1)
        0)))

#(module-set!
  (resolve-module '(lily))
  'calc-repeat-slash-count
  (module-ref (current-module) 'my-calc-repeat-slash-count))

%\unfoldRepeats
<<
  \new Staff { \repeat percent 6 b2 c' }
  \new Lyrics
    \with {
      \consists "Percent_repeat_engraver"
      \consists "Double_percent_repeat_engraver"
      \consists "Slash_repeat_engraver"
      \override RepeatSlash.Y-offset = 0.8
    }
    \lyricmode {
      \repeat percent 6 foo2
      bar
    }
>>

Cheers,
  Harm



reply via email to

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