Correct way to hide/suppress the sustainOff symbol?
In Lilypond, I'm engraving a chunk of piano music which uses the Ped. symbol, but does not use the corresponding * to end the pedalling.
Here's a chunk of code which gets the right visual result:
version "2.18.2"
upper = relative c'' {
clef treble
a4 b c d
}
lower = relative c {
clef bass
a2 c
}
pedal = {
s4sustainOn s s ssustainOff
}
score {
new PianoStaff <<
new Staff = "upper" upper
new Staff = "lower" lower
new Dynamics = "pedal" with {
pedalSustainStrings = #'("Ped." "*Ped." "")
} pedal
>>
layout { }
}
Note the #'("Ped." "*Ped." "") bit.
But that also produces a warning:
warning: SustainPedal has empty extent and non-empty stencil.
I've got 7 pages of music with pedaling every 2-3 measures. I'm not going to make it to the end with that many warnings popping out every time. Is there some better/more correct way of suppressing that symbol?
3 Comments
Sorted by latest first Latest Oldest Best
This is not an answer to the OP, but a reply to a comment that's too big to post there.
If you are in a situation when you need to suppress several warnings that you know aren't important but that obfuscate other warnings and errors, you can use this function.
% ly:expect-warning only works to suppress once. This function allows
% you to specify the number of times a warning appears.
#(define ly:expect-warning-times (lambda args
(for-each (lambda _ (apply ly:expect-warning (cdr args)))
(iota (car args)))))
#(ly:expect-warning-times 33 "omitting tuplet bracket")
If you want the to release the sustain pedal, but to not display a symbol for it:
Instead of typing sustainOff, use hidesustainOff.
NB: you won't need that with ... statement
I poked at it some more, and did some wild guessing in conjunction with my Scheme knowledge, and I tried:
pedalSustainStrings = #'("Ped." "*Ped." #f )
That is, a #f for "false" instead of the zero-length string "". That seems to still produce the visual result that I want, without any warnings being emitted. I've got no idea if this is expected behavior from Lilypond though.
Terms of Use Privacy policy Contact About Cancellation policy © freshhoot.com2026 All Rights reserved.