| [ << Changing defaults ] | [Top][Contents][Index] | [ Markup commands >> ] |
| [ < Painting objects white ] | [ Up : Visibility of objects ] | [ Special considerations > ] |
Using break-visibility
Most layout objects are printed only once, but some like
bar lines, clefs, time signatures and key signatures, may need
to be printed twice when a line break occurs – once at the end
of the line and again at the start of the next line. Such
objects are called breakable, and have a property, the
break-visibility property to control their visibility
at the three positions in which they may appear – at the
start of a line, within a line if they are changed, and at the
end of a line if a change takes place there.
For example, the time signature by default will be printed at the start of the first line, but nowhere else unless it changes, when it will be printed at the point at which the change occurs. If this change occurs at the end of a line the new time signature will be printed at the start of the next line and a cautionary time signature will be printed at the end of the previous line as well.
This behavior is controlled by the break-visibility
property, which is explained in
Visibility and color of objects. This property takes
a vector of three Booleans which, in order, determine whether the
object is printed at the end of, within the body of, or at the
beginning of a line. Or to be more precise, before a line break,
where there is no line break, or after a line break.
Alternatively, these eight combinations may be specified by predefined functions, defined in scm/output-lib.scm, where the last three columns indicate whether the layout objects will be visible in the positions shown at the head of the columns:
Function Vector Before At no After form form break break break all-visible#(#t #t #t)yes yes yes begin-of-line-visible#(#f #f #t)no no yes center-visible#(#f #t #f)no yes no end-of-line-visible#(#t #f #f)yes no no begin-of-line-invisible#(#t #t #f)yes yes no center-invisible#(#t #f #t)yes no yes end-of-line-invisible#(#f #t #t)no yes yes all-invisible#(#f #f #f)no no no
The default settings of break-visibility depend on the
layout object. The following table shows all the layout objects
of interest which are affected by break-visibility and the
default setting of this property:
Layout object Usual context Default setting BarLineScorecalculated BarNumberScorebegin-of-line-visibleBreathingSignVoicebegin-of-line-invisibleClefStaffbegin-of-line-visibleCustosStaffend-of-line-visibleDivisioStaffbegin-of-line-invisibleDoublePercentRepeatVoicebegin-of-line-invisibleKeyCancellationStaffbegin-of-line-invisibleKeySignatureStaffbegin-of-line-visibleClefModifierStaffbegin-of-line-visibleRehearsalMarkScoreend-of-line-invisibleTimeSignatureStaffall-visible
The example below shows the use of the vector form to control the visibility of bar lines:
\relative { f'4 g a b f4 g a b % Remove bar line at the end of the current line \once \override Score.BarLine.break-visibility = ##(#f #t #t) \break f4 g a b f4 g a b }![]()
Although all three components of the vector used to override
break-visibility must be present, not all of them are
effective with every layout object, and some combinations may
even give errors. The following limitations apply:
- Bar lines cannot be printed at the start of line.
- A bar number cannot be printed at the start of the first
line unless it is set to be different from
1. - Clef – see the next section.
- Double percent repeats are either all printed or
all suppressed. Use
begin-of-line-invisibleto print them andall-invisibleto suppress them. - Key signature – see the next section.
- ClefModifier – see the next section.
| [ << Changing defaults ] | [Top][Contents][Index] | [ Markup commands >> ] |
| [ < Painting objects white ] | [ Up : Visibility of objects ] | [ Special considerations > ] |
![[image of music]](../f4/lily-f01edfa4.png)