lilypond-user
[Top][All Lists]
Advanced

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

Re: Simile/Percent Repeat + Volta with Alternative


From: Lucas Cavalcanti
Subject: Re: Simile/Percent Repeat + Volta with Alternative
Date: Wed, 7 Aug 2024 14:50:37 -0300

Valentin, my friend, thank you so much.
If I may trouble you again, I've encountered a problem while trying to use your method. I've applied it to a 5/4 two bar theme (similar to the case I presented before); however, by removing the "superfluous" time signatures the engraving breaks. I'm trying to remove those unnecessary time signatures because they stand out.
image.png
\version "2.24.4"

makeDPercent =
#(define-music-function (duration) (ly:duration?)
   "Make a double percent repeat of given duration."
   (make-music 'DoublePercentEvent
               'length (ly:duration-length duration)))

music = {
\new TabStaff \with {
  \tabFullNotation}
  \relative { \time 5/4
  \repeat volta 4 {
      \repeat unfold 2 {c16 c d8\5 d\5} \repeat unfold 2 {c16 c d8\5}
      \repeat unfold 2 {c16 c d8\5 d\5} c16 c d8\5 <c f>4
      \alternative {
        {\after 4*5
         \time 5/4 % if I remove this time signature the project won't engrave.
         \makeDPercent 4*10 }
        {\repeat unfold 2 {c16 c d8\5 d\5} \repeat unfold 2 {c16 c d8\5}
         <a d>2.~ <a d>2}
      } % end alternative
  } % end ritornelo\volta
} % end relative
} % end variable

\score { \music }
%\score { \unfoldRepeats \music }

Best regards,
Lucas


Em qua., 7 de ago. de 2024 às 07:05, Valentin Petzel <valentin@petzel.at> escreveu:
Am Mittwoch, 7. August 2024, 06:53:02 MESZ schrieb Lucas Cavalcanti:
> Hello. I'm migrating from Guitar Pro to Lilypond and I'm trying to
> replicate something that I've always done in my scores and lead sheets:
> [image: image.png]
> I'm having a bit of a pickle while trying to recreate this score,
> especially because of two factors:
> 1. Lilypond's way of writing percent repeats.
> 2. The frequent/periodical time signature changes (6/4 to 5/4).
>
> Is there a way to make a score that looks like this?
>
> Best regards,
> Lucas

Hello Lucas,

first let’s write out your score:

\new TabStaff \with {
  \tabFullNotation
} \relative {
  \time 6/4
  e,8 e e d'\5 e, e c' d\5 f d c d\5
  \time 5/4
  e, e e d'\5 e, e f' d f g\4
}

Now how do we get percent repeats? We can simply do \repeat percent count ...:

\new TabStaff \with {
  \tabFullNotation
} \relative {
  \repeat percent 2 {
    \time 6/4
    e,8 e e d'\5 e, e c' d\5 f d c d\5
    \time 5/4
    e, e e d'\5 e, e f' d f g\4
  }
}

But note how this does not apply the time changes. So we need to specify them
ourselves:

\new TabStaff \with {
  \tabFullNotation
} \relative {
  \after 4*11 \time 6/4
  \after 4*17 \time 5/4
  \repeat percent 2 {
    \time 6/4
    e,8 e e d'\5 e, e c' d\5 f d c d\5
    \time 5/4
    e, e e d'\5 e, e f' d f g\4
  }
}

So how do we get repeats? In simple cases we can use \repeat volta count ...
and \alternative for the voltas. Now here this is a bit complicated, as
essentially the first alternative is actually a repeat.

So instead of using \repeat percent we’ll need to manually place the Percent
repeat signs:

makeDPercent =
#(define-music-function (duration) (ly:duration?)
   "Make a double percent repeat of given duration."
   (make-music 'DoublePercentEvent
               'length (ly:duration-length duration)))

\new TabStaff \with {
  \tabFullNotation
} \relative {
  \repeat volta 4 {
    \time 6/4
    e,8 e e d'\5 e, e c' d\5 f d c d\5 |
    \time 5/4
    e, e e d'\5 e, e f' d f g\4 |
    \alternative {
      {
        \time 6/4
        \after 1. \time 5/4
        \makeDPercent 4*11
      }
      {
        \time 6/4
        e, e e d'\5 e, e c' d\5 f d c d\5~ |
        \time 5/4
        d1*5/4\5
      }
    }
  }
  \section
}

Cheers,
Valentin

reply via email to

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