Hi Kieren,
Am 26.12.21 um 16:48 schrieb Kieren MacMillan:
Hi all,
Given
\version "2.21"
{ \omit Script c''1^\fermata_\espressivo }
obviously both Script grobs will be omitted; same, of course, with
\version "2.21"
\layout { \context { \Score \omit Script } }
{ c''1^\fermata_\espressivo }
Is there a way (e.g., via callback or improved \omit function definition) to
make \omit more surgical? For example, can one effectively say
\omit #'(fermata) Script
so that only fermatas get omitted?
Perhaps something like:
\version "2.22"
omitScriptTypes =
#(define-music-function (types) (list?)
(let ((stencil
(lambda (grob)
(if (member (ly:event-property
(ly:grob-property grob 'cause)
'articulation-type)
types)
#f
ly:script-interface::print))))
#{
\override Script.stencil = #stencil
#}))
{
\omitScriptTypes #'("fermata")
a'2\fermata a\tenuto
\omitScriptTypes #'("tenuto")
a'\fermata a\tenuto
\omitScriptTypes #'("fermata" "tenuto")
a'\fermata a\tenuto
\omitScriptTypes #'()
a'\fermata a\tenuto
}
The more general syntax you suggested - making "Script" one of various
possibilities - does not convince me, as the type of a script is in a
special property ('articulation-type) that won't be of much use for
other grob types, I expect.
Lukas