lilypond-user
[Top][All Lists]
Advanced

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

Re: vertical shift of trill


From: Valentin Petzel
Subject: Re: vertical shift of trill
Date: Sat, 06 Aug 2022 15:05:37 +0200

Hi Jim, hi Kieren,

I would strongly suggest to be careful with using extra-offset. Extra-offset is 
applied *after* the spacing is resolved, and will this not affect spacing! This 
means that that collisions with the new position are not avoided, but instead 
collisions with the old positions are avoided.

Consider this:

\relative c'' {
  \clef treble
  <<
    {
      \pitchedTrill c'1~\startTrillSpan des c1*7/8 s8 \stopTrillSpan
    }
    \\
    {
      \pitchedTrill a1~\f -\tweak TrillSpanner.extra-offset #'(0 . 3.5) 
\startTrillSpan bes a1*7/8 s8 \stopTrillSpan
    }
  >>
}

This is Kieren’s code with a simple dynamic marking added. Notice how this 
marking is absolutely off, because Lilypond places it under the position where 
the trill span would have been.

Rather the more sensible approach would be to tweak the TrillSpan.Y-offset. 
This will not allow the trill spanner to be placed within the staff, as trill 
spanners are outside staff grobs, so Lilypond will never place them inside the 
staff. So to get this to work we simply need to tell Lilypond that this thing 
is not to be handled as outside staff by tweaking TrillSpan.outside-staff-
priority to #f.

This still poses a bit of a problem if for example we transpose the music or 
if we change the clef:

mus = \relative c'' {
  <<
    {
      \pitchedTrill c'1~\startTrillSpan des c1*7/8 s8 \stopTrillSpan
    }
    \\
    {
      \pitchedTrill a1~\f
      -\tweak TrillSpanner.Y-offset
      #0.2 -\tweak TrillSpanner.outside-staff-priority ##f
      \startTrillSpan bes a1*7/8 s8 \stopTrillSpan
    }
  >>
}

{
  \clef treble \mus \clef "treble^8" \mus
}

But we can in fact implement a simple function that tries to fit the 
TrillSpanner  (or in fact any spanner) to the notes. Consult the appended file 
for details.

Cheers,
Valentin

Am Freitag, 5. August 2022, 18:14:54 CEST schrieb Kieren MacMillan:
> Hi Jim,
> 
> There are many ways to do this, but the easies would probably be to tweak
> the extra-offset:
> 
> \version "2.20.0"
> 
> \relative c'' {
>   \clef treble
>   <<
>     {
>       \pitchedTrill c'1~\startTrillSpan des c1*7/8 s8 \stopTrillSpan
>     }
>     \\
>     {
>       \pitchedTrill a1~ -\tweak TrillSpanner.extra-offset #'(0 . 3.5)
> \startTrillSpan bes a1*7/8 s8 \stopTrillSpan }
> 
> }
> 
> You might also want to use whiteout?
> 
> Hope that helps!
> Kieren.

Attachment: Sticking-Spanner.ly
Description: Text Data

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

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