[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.
Sticking-Spanner.ly
Description: Text Data
signature.asc
Description: This is a digitally signed message part.
- vertical shift of trill, Jim Cline, 2022/08/05
- Re: vertical shift of trill, Kieren MacMillan, 2022/08/05
- Re: vertical shift of trill,
Valentin Petzel <=
- Re: vertical shift of trill, Jean Abou Samra, 2022/08/06
- Re: vertical shift of trill, Werner LEMBERG, 2022/08/06
- Re: vertical shift of trill, Jean Abou Samra, 2022/08/06
- Re: vertical shift of trill, Valentin Petzel, 2022/08/06
- Re: vertical shift of trill, Jim Cline, 2022/08/06
- Re: vertical shift of trill, Thomas Morley, 2022/08/06
- Re: vertical shift of trill, Carl Sorensen, 2022/08/06
- Re: vertical shift of trill, Jean Abou Samra, 2022/08/06
- Re: vertical shift of trill, Valentin Petzel, 2022/08/06