attach

topleveltools.attach(indicator, component_expression, scope=None, is_annotation=None, name=None, synthetic_offset=None)

Attaches indicator to component_expression.

Attaches clef to first note in staff:

>>> staff = Staff("c'4 d' e' f'")
>>> attach(Clef('alto'), staff[0])
>>> show(staff) 

Attaches accent to last two notes in staff:

>>> staff = Staff("c'4 d' e' f'")
>>> attach(Articulation('>'), staff[-2])
>>> attach(Articulation('>'), staff[-1])
>>> show(staff) 

Derives scope from the default scope of indicator when scope is none.

Treats indicator as annotation when is_annotation is true.

Returns none.