label

topleveltools.label(expr=None)

Labels expr or makes label expression.

Example 1. Labels logical ties with start offsets:

>>> staff = Staff(r"\times 2/3 { c'4 d'4 e'4 ~ } e'4 ef'4")
>>> label(staff).with_start_offsets(direction=Up)
>>> override(staff).text_script.staff_padding = 4
>>> override(staff).tuplet_bracket.staff_padding = 0
>>> show(staff) 

See the LabelAgent API entry for many more examples.

Example 2. Makes label expression:

>>> expression = label()
>>> expression = expression.with_start_offsets()
>>> staff = Staff(r"\times 2/3 { c'4 d'4 e'4 ~ } e'4 ef'4")
>>> expression(staff)
>>> override(staff).text_script.staff_padding = 4
>>> override(staff).tuplet_bracket.staff_padding = 0
>>> show(staff) 

See the LabelExpression API entry for many more examples.

Returns label agent when expr is not none.

Returns label expression when expr is none.