BurnishSpecifier

class rhythmmakertools.BurnishSpecifier(left_classes=None, middle_classes=None, right_classes=None, left_counts=None, right_counts=None, outer_divisions_only=False)

Burnish specifier.

>>> import abjad
>>> from abjad.tools import rhythmmakertools

Forces first leaf of each division to be a rest:

>>> burnish_specifier = rhythmmakertools.BurnishSpecifier(
...     left_classes=[abjad.Rest],
...     left_counts=[1],
...     )

Forces the first three leaves of each division to be rests:

>>> burnish_specifier = rhythmmakertools.BurnishSpecifier(
...     left_classes=[abjad.Rest],
...     left_counts=[3],
...     )

Forces last leaf of each division to be a rest:

>>> burnish_specifier = rhythmmakertools.BurnishSpecifier(
...     right_classes=[abjad.Rest],
...     right_counts=[1],
...     )

Forces the last three leaves of each division to be rests:

>>> burnish_specifier = rhythmmakertools.BurnishSpecifier(
...     right_classes=[abjad.Rest],
...     right_counts=[3],
...     )

Forces the first leaf of every even-numbered division to be a rest; forces the first leaf of every odd-numbered division to be a note.

>>> burnish_specifier = rhythmmakertools.BurnishSpecifier(
...     left_classes=[abjad.Rest, abjad.Note],
...     left_counts=[1],
...     )

Forces the last leaf of every even-numbered division to be a rest; forces the last leaf of every odd-numbered division to be a note.

>>> burnish_specifier = rhythmmakertools.BurnishSpecifier(
...     right_classes=[abjad.Rest, abjad.Note],
...     right_counts=[1],
...     )

Forces the first leaf of every even-numbered division to be a rest; leave the first leaf of every odd-numbered division unchanged.

>>> burnish_specifier = rhythmmakertools.BurnishSpecifier(
...     left_classes=[abjad.Rest, 0],
...     left_counts=[1],
...     )

Forces the last leaf of every even-numbered division to be a rest; leave the last leaf of every odd-numbered division unchanged.

>>> burnish_specifier = rhythmmakertools.BurnishSpecifier(
...     right_classes=[abjad.Rest, 0],
...     right_counts=[1],
...     )

Burnish specifiers are immutable.

Lineage

digraph InheritanceGraph { graph [background=transparent, bgcolor=transparent, color=lightslategrey, fontname=Arial, outputorder=edgesfirst, overlap=prism, penwidth=2, rankdir=LR, root="__builtin__.object", splines=spline, style="dotted, rounded", truecolor=true]; node [colorscheme=pastel19, fontname=Arial, fontsize=12, penwidth=2, style="filled, rounded"]; edge [color=lightsteelblue2, penwidth=2]; subgraph cluster_abctools { graph [label=abctools]; "abjad.tools.abctools.AbjadObject.AbjadObject" [color=1, group=0, label=AbjadObject, shape=box]; "abjad.tools.abctools.AbjadObject.AbstractBase" [color=1, group=0, label=AbstractBase, shape=box]; "abjad.tools.abctools.AbjadValueObject.AbjadValueObject" [color=1, group=0, label=AbjadValueObject, shape=box]; "abjad.tools.abctools.AbjadObject.AbjadObject" -> "abjad.tools.abctools.AbjadValueObject.AbjadValueObject"; "abjad.tools.abctools.AbjadObject.AbstractBase" -> "abjad.tools.abctools.AbjadObject.AbjadObject"; } subgraph cluster_rhythmmakertools { graph [label=rhythmmakertools]; "abjad.tools.rhythmmakertools.BurnishSpecifier.BurnishSpecifier" [color=black, fontcolor=white, group=2, label=<<B>BurnishSpecifier</B>>, shape=box, style="filled, rounded"]; } subgraph cluster_builtins { graph [label=builtins]; "builtins.object" [color=2, group=1, label=object, shape=box]; } "abjad.tools.abctools.AbjadValueObject.AbjadValueObject" -> "abjad.tools.rhythmmakertools.BurnishSpecifier.BurnishSpecifier"; "builtins.object" -> "abjad.tools.abctools.AbjadObject.AbstractBase"; }

Bases

Attribute summary

left_classes Gets left classes.
left_counts Gets left counts.
middle_classes Gets middle_classes.
outer_divisions_only Is true when rhythm-maker should burnish only first and last division in output.
right_classes Gets right classes.
right_counts Gets right counts.
__call__(divisions[, helper_functions, rotation]) Calls burnish specifier on divisions.
__copy__(*arguments) Copies Abjad value object.
__eq__(argument) Is true when all initialization values of Abjad value object equal the initialization values of argument.
__format__([format_specification]) Formats burnish specifier.
__hash__() Hashes Abjad value object.
__ne__(argument) Is true when Abjad object does not equal argument.
__repr__() Gets interpreter representation.

Read-only properties

BurnishSpecifier.left_classes

Gets left classes.

>>> burnish_specifier = rhythmmakertools.BurnishSpecifier(
...     left_classes=[abjad.Rest, 0],
...     right_classes=[abjad.Rest, abjad.Rest, 0],
...     left_counts=[2],
...     right_counts=[1],
...     )
>>> burnish_specifier.left_classes
[<class 'abjad.tools.scoretools.Rest.Rest'>, 0]

Returns tuple or none.

BurnishSpecifier.left_counts

Gets left counts.

>>> burnish_specifier = rhythmmakertools.BurnishSpecifier(
...     left_classes=[abjad.Rest, 0],
...     right_classes=[abjad.Rest, abjad.Rest, 0],
...     left_counts=[2],
...     right_counts=[1],
...     )
>>> burnish_specifier.left_counts
[2]

Returns tuple or none.

BurnishSpecifier.middle_classes

Gets middle_classes.

>>> burnish_specifier = rhythmmakertools.BurnishSpecifier(
...     left_classes=[abjad.Rest, 0],
...     right_classes=[abjad.Rest, abjad.Rest, 0],
...     left_counts=[2],
...     right_counts=[1],
...     )
>>> burnish_specifier.middle_classes is None
True

Returns tuple or none.

BurnishSpecifier.outer_divisions_only

Is true when rhythm-maker should burnish only first and last division in output.

Is false when rhythm-maker should burnish all divisions.

Defaults to false.

Set to true or false.

BurnishSpecifier.right_classes

Gets right classes.

>>> burnish_specifier = rhythmmakertools.BurnishSpecifier(
...     left_classes=[abjad.Rest, 0],
...     right_classes=[abjad.Rest, abjad.Rest, 0],
...     left_counts=[2],
...     right_counts=[1],
...     )
>>> burnish_specifier.right_classes
[<class 'abjad.tools.scoretools.Rest.Rest'>, <class 'abjad.tools.scoretools.Rest.Rest'>, 0]

Returns tuple or none.

BurnishSpecifier.right_counts

Gets right counts.

>>> burnish_specifier = rhythmmakertools.BurnishSpecifier(
...     left_classes=[abjad.Rest, 0],
...     right_classes=[abjad.Rest, abjad.Rest, 0],
...     left_counts=[2],
...     right_counts=[1],
...     )
>>> burnish_specifier.right_counts
[1]

Returns tuple or none.

Special methods

BurnishSpecifier.__call__(divisions, helper_functions=None, rotation=None)

Calls burnish specifier on divisions.

Returns list of burnished divisions.

(AbjadValueObject).__copy__(*arguments)

Copies Abjad value object.

Returns new Abjad value object.

(AbjadValueObject).__eq__(argument)

Is true when all initialization values of Abjad value object equal the initialization values of argument.

Returns true or false.

BurnishSpecifier.__format__(format_specification='')

Formats burnish specifier.

>>> burnish_specifier = rhythmmakertools.BurnishSpecifier(
...     left_classes=[abjad.Rest, 0],
...     left_counts=[1],
...     )
>>> f(burnish_specifier)
rhythmmakertools.BurnishSpecifier(
    left_classes=[
        abjad.Rest,
        0,
        ],
    left_counts=[1],
    )

Returns string.

(AbjadValueObject).__hash__()

Hashes Abjad value object.

Returns integer.

(AbjadObject).__ne__(argument)

Is true when Abjad object does not equal argument. Otherwise false.

Returns true or false.

BurnishSpecifier.__repr__()

Gets interpreter representation.

>>> burnish_specifier = rhythmmakertools.BurnishSpecifier(
...     left_classes=[abjad.Rest, 0],
...     left_counts=[1],
...     )
>>> burnish_specifier
BurnishSpecifier(left_classes=[Rest, 0], left_counts=[1])

Returns string.