Score.add_final_bar_line

Score.add_final_bar_line(bar_line: Union[str, abjad.indicators.BarLine.BarLine] = '|.', *, to_each_voice: bool = False)None[source]
Adds a final bar line to all components of abjad.Score. Note that

Auxjad adds this function as an extension method to abjad.Score (see usage below).

Basic usage:
>>> staff = abjad.Staff(r"c'4 d'4 e'4 f'4")
>>> score = abjad.Score([staff])
>>> abjad.show(score)
../_images/Score-fdO5TP6ff9.png
>>> score.add_final_bar_line()
>>> abjad.show(score)
../_images/Score-SHok9MqNVh.png
Multiple staves:

Works with multiple staves:

>>> staff_1 = abjad.Staff(r"c''1 d''1 e''1 f''1")
>>> staff_2 = abjad.Staff(r"c'1 d'1 e'1 f'1")
>>> score = abjad.Score([staff_1, staff_2])
>>> score.add_final_bar_line()
>>> abjad.show(score)
../_images/Score-oCR5QGUz6W.png

Each stave will receive their own final bar line, which can be useful when part extracting:

>>> abjad.show(staff_1)
../_images/Score-tTXh7GOAop.png
>>> abjad.show(staff_2)
../_images/Score-MRWgOyiqt3.png
to_each_voice

When multiple voices are present in a staff, the final bar line is added to the last voice only:

>>> voice_1 = abjad.Voice(r"c''1 d''1 e''1 f''1")
>>> voice_2 = abjad.Voice(r"c'2 d'2 e'2 f'2 g'2 a'2 b'2 c''2")
>>> staff = abjad.Staff([voice_1, voice_2], simultaneous=True)
>>> abjad.attach(abjad.LilyPondLiteral(r'\voiceOne'), voice_1)
>>> abjad.attach(abjad.LilyPondLiteral(r'\voiceTwo'), voice_2)
>>> score = auxjad.Score([staff])
>>> score.add_final_bar_line()
>>> abjad.show(score)
../_images/Score-8mnllVCEoL.png
>>> abjad.show(voice_1)
../_images/Score-DPW54DDeyM.png
>>> abjad.show(voice_2)
../_images/Score-ua8cZAITB5.png

Setting to_each_voice to True will add a bar line to each voice in a staff:

>>> voice_1 = abjad.Voice(r"c''1 d''1 e''1 f''1")
>>> voice_2 = abjad.Voice(r"c'2 d'2 e'2 f'2 g'2 a'2 b'2 c''2")
>>> staff = abjad.Staff([voice_1, voice_2], simultaneous=True)
>>> abjad.attach(abjad.LilyPondLiteral(r'\voiceOne'), voice_1)
>>> abjad.attach(abjad.LilyPondLiteral(r'\voiceTwo'), voice_2)
>>> score = auxjad.Score([staff])
>>> score.add_final_bar_line(to_each_voice=True)
>>> abjad.show(voice_1)
../_images/Score-adtLRR3v1W.png
>>> abjad.show(voice_2)
../_images/Score-DqhspXgvIJ.png

Warning

If voices do not end together then manually adding bar lines will be required:

>>> voice_1 = abjad.Voice(r"c''1 d''1 e''1 f''1")
>>> voice_2 = abjad.Voice(r"c'1 d'1 e'1")
>>> staff = abjad.Staff([voice_1, voice_2], simultaneous=True)
>>> abjad.attach(abjad.LilyPondLiteral(r'\voiceOne'), voice_1)
>>> abjad.attach(abjad.LilyPondLiteral(r'\voiceTwo'), voice_2)
>>> score = auxjad.Score([staff])
>>> score.add_final_bar_line(to_each_voice=True)
>>> abjad.show(score)
../_images/Score-duPkS4pJGc.png
argument:

The default bar line is of type '|.'. To change this behaviour, call this method with an argument of type str or abjad.BarLine with the desired bar line type:

>>> staff_1 = abjad.Staff(r"c''1 d''1 e''1 f''1")
>>> staff_2 = abjad.Staff(r"c'1 d'1 e'1 f'1")
>>> score = auxjad.Score([staff_1, staff_2])
>>> score.add_final_bar_line(abjad.BarLine(":|."))
>>> abjad.show(score)
../_images/Score-3JvhD9DKvE.png