lilypond-user
[Top][All Lists]
Advanced

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

Re: adding a markup ("sim.") to the end of a SustainPedalBracket


From: Thomas Morley
Subject: Re: adding a markup ("sim.") to the end of a SustainPedalBracket
Date: Fri, 14 Jun 2013 01:08:36 +0200

2013/6/13 Kieren MacMillan <address@hidden>:
> Hello all!
>
> I would like to explicitly indicate piano pedalling (using brackets) in the 
> first measure of my score, and then put a "sim." (or similar ;) right after 
> the /\ (i.e., "up+down") marking on the downbeat of the second measure.
>
> I was hoping to do one of the two following things:
> 1. Best Option = adjust the stencil of the bracket so that \sustainOff would 
> print the entire grouping  "/\_  sim."
> 2. Acceptable = adjust the text of the \sustainOff so that it says "sim.", 
> and space it out a few skips beyond the downbeat.
>
> The docs (e.g., 
> http://www.lilypond.org/doc/v2.17/Documentation/snippets/keyboards#keyboards-changing-the-text-for-sustain-markings)
>  seem to indicate that neither is possible (e.g., "the only valid strings are 
> those found in the list of pedal glyphs").
>
> Any assistance would be appreciated.
>
> Thanks!
> Kieren.
>
> p.s. I always use the latest development version.
> _______________________________________________
> lilypond-user mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/lilypond-user

Hi Kieran,

you can always modify the stencil.
Though, it's not completely clear to me what you want to achieve.
Please look at the output from the code below and tell what's good/wrong.

\version "2.17.20"

\paper { ragged-right = ##f }

pedalSim =
\once \override Staff.PianoPedalBracket #'stencil =
  #(lambda (grob)
    (let* ((sim-stil (grob-interpret-markup grob " sim"))
           (sim-stil-x-length
             (interval-length
               (ly:stencil-extent sim-stil X)))
           )

      (ly:grob-set-property! grob 'shorten-pair (cons 0 (+ 2
sim-stil-x-length)))

      (let ((stil (ly:piano-pedal-bracket::print grob)))
        (ly:stencil-combine-at-edge
          stil
          X
          RIGHT
          sim-stil
          0))))

\relative c' {
        \set Staff.pedalSustainStyle = #'bracket
        \pedalSim
        c4\sustainOn d e\sustainOff\sustainOn f\sustainOff
}


Cheers,
  Harm



reply via email to

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