Hi Jean,
Of course you are right. Let me explain how I got to this to explain my
confusion.
My first attempt was to add it to the next note without using \override
Staff.PianoPedalBracket.to-barline = ##t (as I wasn't aware of it
existence at that point). What I discovered however is that when the
tremolo is the last bar of that system, the bracket is continued on the
next system. Example:
%%%
\score {
\new Staff {
\clef bass
\time 6/8
\relative c' {
c8 b a g e c |
\set Staff.pedalSustainStyle = #'mixed
\repeat tremolo 12 { b,32\sustainOn b' } |
\repeat tremolo 12 { b,32 b' } | \break
c8\sustainOff e f g a
}
}
}
%%
That is confusing because it means for the player that it is not
immediately obvious where to lift the sustain pedal. This lead to me
moving the \sustainOff back to the last note of the tremolo, and trying
to extend it to the end of the barline.
It is indeed the case that if you set it to the next note (the c8 in the
example) AND set \override Staff.PianoPedalBracket.to-barline = ##t, it
works as expected. To me it was not immediately obvious that this is the
correct solution. When trying to find a solution, I was surprised to
only find a reference to this type of solution on the mailing list in a
post of 2015, and it didn't feature the end of system situation. I
expected that this kind of issue would have come up more frequently.
Perhaps this solution might deserve a mention in the Pedal department of
the Lilypond documentation. Happy to contribute that mention.
cheers
Maurits
Op 10-04-2024 om 12:01 schreef Jean Abou Samra:
Le mardi 09 avril 2024 à 23:55 +0200, Maurits Lamers via LilyPond user
discussion a écrit :
Hey all,
I encountered a situation where the PianoPedalBracket setting to-barline
doesn't always do what you'd expect. Given the following code, the pedal
bracket is not extended to the end of the bar:
%%%
\version "2.24.0"
\score {
\new Staff {
\clef bass
\time 6/8
\relative c' {
c8 b a g e c |
\set Staff.pedalSustainStyle = #'mixed
\override Staff.PianoPedalBracket.to-barline = ##t
\repeat tremolo 12 { b,32\sustainOn b' } |
\repeat tremolo 12 { b,32 b'\sustainOff } |
c8 e f g a
}
}
}
Correct syntax is
\version "2.24.0"
\score {
\new Staff {
\clef bass
\time 6/8
\relative c' {
c8 b a g e c |
\set Staff.pedalSustainStyle = #'mixed
\override Staff.PianoPedalBracket.to-barline = ##t
\repeat tremolo 12 { b,32\sustainOn b' } |
\repeat tremolo 12 { b,32 b' } |
c8\sustainOff e f g a
}
}
}
The \sustainOff command is placed on the note where you *release*
the pedal. And because LilyPond uses post-fix syntax, it comes just
*after* that note.
Best,
Jean