bell notificationshomepageloginNewPostedit profiledmBox

Hoots : 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 - freshhoot.com

10% popularity   0 Reactions

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?


Load Full (3)

Login to follow hoots

3 Comments

Sorted by latest first Latest Oldest Best

10% popularity   0 Reactions

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")


10% popularity   0 Reactions

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


10% popularity   0 Reactions

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.


Back to top Use Dark theme