lilypond-learning: The transparent property
The ‘transparent’ property
..........................
We see from the properties specified in the ‘grob-interface’ page in the
IR that the ‘transparent’ property is a boolean. This should be set to
‘#t’ to make the grob transparent. In this next example let us make the
time signature invisible rather than the bar lines. To do this we need
to find the grob name for the time signature. Back to the ‘All layout
objects’ page in the IR to find the properties of the ‘TimeSignature’
layout object. This is produced by the ‘Time_signature_engraver’ which
you can check also lives in the ‘Staff’ context and also supports the
‘grob-interface’. So the command to make the time signature transparent
is:
{
\time 12/16
\override Staff.TimeSignature.transparent = ##t
c4 b8 c d16 c d8 |
g,8 a16 b8 c d4 e16 |
e8
}
[image src="" alt="[image of music]" text="image of music" ]
Again, setting the ‘transparent’ property is a rather frequent
operation, so we have a shorthand for it called ‘\hide’:
{
\time 12/16
\hide Staff.TimeSignature
c4 b8 c d16 c d8 |
g,8 a16 b8 c d4 e16 |
e8
}
[image src="" alt="[image of music]" text="image of music" ]
In either case, the time signature is gone, but this command leaves a
gap where the time signature should be. Maybe this is what is wanted
for an exercise for the student to fill it in, but in other
circumstances a gap might be undesirable. To remove it, the stencil for
the time signature should be set to ‘#f’ instead:
{
\time 12/16
\omit Staff.TimeSignature
c4 b8 c d16 c d8 |
g,8 a16 b8 c d4 e16 |
e8
}
[image src="" alt="[image of music]" text="image of music" ]
and the difference is obvious: setting the stencil to ‘#f’ (possibly via
‘\omit’) removes the object entirely; making the object ‘transparent’
(which can be done using ‘\hide’) leaves it where it is, but makes it
invisible.