NoteRhythmMaker

digraph InheritanceGraph { graph [bgcolor=transparent, color=lightsteelblue2, fontname=Arial, fontsize=10, outputorder=edgesfirst, overlap=prism, penwidth=2, rankdir=LR, splines=spline, style="dashed, rounded", truecolor=true]; node [colorscheme=pastel19, fontname=Arial, fontsize=10, height=0, penwidth=2, shape=box, style="filled, rounded", width=0]; edge [color=lightslategrey, penwidth=1]; subgraph "cluster_abjad.system" { graph [label="abjad.system"]; node [color=1]; "abjad.system.AbjadObject.AbjadObject" [URL="../api/abjadext/rmakers/../../abjad/system/AbjadObject.html#abjad.system.AbjadObject.AbjadObject", label="Abjad\nObject", target=_top]; "abjad.system.AbjadValueObject.AbjadValueObject" [URL="../api/abjadext/rmakers/../../abjad/system/AbjadValueObject.html#abjad.system.AbjadValueObject.AbjadValueObject", label="Abjad\nValue\nObject", target=_top]; "abjad.system.AbjadObject.AbjadObject" -> "abjad.system.AbjadValueObject.AbjadValueObject"; } subgraph "cluster_abjadext.rmakers" { graph [label="abjadext.rmakers"]; node [color=2]; "abjadext.rmakers.NoteRhythmMaker.NoteRhythmMaker" [URL="../api/abjadext/rmakers/NoteRhythmMaker.html#abjadext.rmakers.NoteRhythmMaker.NoteRhythmMaker", color=black, fontcolor=white, label="Note\nRhythm\nMaker", target=_top]; "abjadext.rmakers.RhythmMaker.RhythmMaker" [URL="../api/abjadext/rmakers/RhythmMaker.html#abjadext.rmakers.RhythmMaker.RhythmMaker", label="Rhythm\nMaker", target=_top]; "abjadext.rmakers.RhythmMaker.RhythmMaker" -> "abjadext.rmakers.NoteRhythmMaker.NoteRhythmMaker"; } subgraph cluster_builtins { graph [label=builtins]; node [color=3]; "builtins.object" [URL="https://docs.python.org/3.6/library/functions.html#object", label=object, target=_top]; } "abjad.system.AbjadValueObject.AbjadValueObject" -> "abjadext.rmakers.RhythmMaker.RhythmMaker"; "builtins.object" -> "abjad.system.AbjadObject.AbjadObject"; }

class abjadext.rmakers.NoteRhythmMaker.NoteRhythmMaker(*, beam_specifier=None, burnish_specifier=None, division_masks=None, duration_specifier=None, logical_tie_masks=None, tie_specifier=None, tuplet_specifier=None)

Note rhythm-maker.

Makes notes equal to the duration of input divisions. Adds ties where necessary:

>>> rhythm_maker = abjadext.rmakers.NoteRhythmMaker()
>>> divisions = [(5, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Usage follows the two-step configure-once / call-repeatedly pattern shown here.


Attributes Summary

__call__ Calls note rhythm-maker on divisions.
__format__ Formats note rhythm-maker.
__repr__ Gets interpreter representation.
beam_specifier Gets beam specifier.
burnish_specifier Gets burnish specifier.
division_masks Gets division masks.
duration_specifier Gets duration specifier.
logical_tie_masks Gets logical tie masks.
tie_specifier Gets tie specifier.
tuplet_specifier Gets tuplet specifier.

Special methods

__call__(divisions, previous_state=None)

Calls note rhythm-maker on divisions.

Calls rhythm-maker on divisions:

>>> rhythm_maker = abjadext.rmakers.NoteRhythmMaker()
>>> divisions = [(5, 8), (3, 8)]
>>> result = rhythm_maker(divisions)
>>> for x in result:
...     x
... 
Selection([Note("c'2"), Note("c'8")])
Selection([Note("c'4.")])
Return type:List[Selection]
(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.

__format__(format_specification='')

Formats note rhythm-maker.

>>> rhythm_maker = abjadext.rmakers.NoteRhythmMaker()
>>> abjad.f(rhythm_maker)
abjadext.rmakers.NoteRhythmMaker()
Return type:str
(AbjadValueObject).__hash__()

Hashes Abjad value object.

Returns integer.

(RhythmMaker).__illustrate__(divisions=((3, 8), (4, 8), (3, 16), (4, 16)))

Illustrates rhythm-maker.

Returns LilyPond file.

__repr__()

Gets interpreter representation.

>>> abjadext.rmakers.NoteRhythmMaker()
NoteRhythmMaker()

Returns string.

Return type:str

Read-only properties

beam_specifier

Gets beam specifier.

Beams each division:

>>> rhythm_maker = abjadext.rmakers.NoteRhythmMaker(
...     beam_specifier=abjadext.rmakers.BeamSpecifier(
...         beam_each_division=True,
...         ),
...     )
>>> divisions = [(5, 32), (5, 32)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Beams divisions together:

>>> rhythm_maker = abjadext.rmakers.NoteRhythmMaker(
...     beam_specifier=abjadext.rmakers.BeamSpecifier(
...         beam_divisions_together=True,
...         ),
...     )
>>> divisions = [(5, 32), (5, 32)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Makes no beams:

>>> rhythm_maker = abjadext.rmakers.NoteRhythmMaker(
...     beam_specifier=abjadext.rmakers.BeamSpecifier(
...         beam_divisions_together=False,
...         beam_each_division=False,
...         ),
...     )
>>> divisions = [(5, 32), (5, 32)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 
Return type:Optional[BeamSpecifier]
burnish_specifier

Gets burnish specifier.

Burnishes nothing:

>>> rhythm_maker = abjadext.rmakers.NoteRhythmMaker()
>>> divisions = [(5, 8), (2, 8), (2, 8), (5, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Forces leaves of first division to be rests:

>>> rhythm_maker = abjadext.rmakers.NoteRhythmMaker(
...     burnish_specifier=abjadext.rmakers.BurnishSpecifier(
...         left_classes=[abjad.Rest],
...         left_counts=[1],
...         outer_divisions_only=True,
...         ),
...     )
>>> divisions = [(5, 8), (2, 8), (2, 8), (5, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Forces leaves of first two divisions to be rests:

>>> rhythm_maker = abjadext.rmakers.NoteRhythmMaker(
...     burnish_specifier=abjadext.rmakers.BurnishSpecifier(
...         left_classes=[abjad.Rest],
...         left_counts=[2],
...         outer_divisions_only=True,
...         ),
...     )
>>> divisions = [(5, 8), (2, 8), (2, 8), (5, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Forces leaves of first and last divisions to rests:

>>> rhythm_maker = abjadext.rmakers.NoteRhythmMaker(
...     burnish_specifier=abjadext.rmakers.BurnishSpecifier(
...         left_classes=[abjad.Rest],
...         left_counts=[1],
...         right_classes=[abjad.Rest],
...         right_counts=[1],
...         outer_divisions_only=True,
...         ),
...     )
>>> divisions = [(5, 8), (2, 8), (2, 8), (5, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Note

Currently only works when outer_divisions_only is true.

Return type:Optional[BurnishSpecifier]
division_masks

Gets division masks.

No division masks:

>>> rhythm_maker = abjadext.rmakers.NoteRhythmMaker()
>>> divisions = [(4, 8), (3, 8), (4, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Silences every other division:

>>> rhythm_maker = abjadext.rmakers.NoteRhythmMaker(
...     division_masks=[
...         abjadext.rmakers.SilenceMask(
...             pattern=abjad.index([0], 2),
...             ),
...         ],
...     )
>>> divisions = [(4, 8), (3, 8), (4, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Silences every output division:

>>> rhythm_maker = abjadext.rmakers.NoteRhythmMaker(
...     division_masks=[abjadext.rmakers.silence([0], 1)],
...     )
>>> divisions = [(4, 8), (3, 8), (4, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Silences every output division and uses multimeasure rests:

>>> mask = abjadext.rmakers.SilenceMask(
...     pattern=abjad.index_all(),
...     use_multimeasure_rests=True,
...     )
>>> rhythm_maker = abjadext.rmakers.NoteRhythmMaker(
...     division_masks=[mask],
...     )
>>> divisions = [(4, 8), (3, 8), (4, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Silences every other output division except for the first and last:

>>> pattern_1 = abjad.index([0], 2)
>>> pattern_2 = abjad.index([0, -1])
>>> pattern = pattern_1 & ~pattern_2
>>> mask = abjadext.rmakers.SilenceMask(
...     pattern=pattern,
...     )
>>> rhythm_maker = abjadext.rmakers.NoteRhythmMaker(
...     division_masks=[mask],
...     )
>>> divisions = [(4, 8), (3, 8), (4, 8), (3, 8), (2, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 
Return type:Optional[PatternTuple]
duration_specifier

Gets duration specifier.

Spells durations with the fewest number of glyphs:

>>> rhythm_maker = abjadext.rmakers.NoteRhythmMaker()
>>> divisions = [(5, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Forbids notes with written duration greater than or equal to 1/2:

>>> rhythm_maker = abjadext.rmakers.NoteRhythmMaker(
...     duration_specifier=abjadext.rmakers.DurationSpecifier(
...         forbidden_duration=(1, 2),
...         ),
...     )
>>> divisions = [(5, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Spells all divisions metrically when spell_metrically is true:

>>> rhythm_maker = abjadext.rmakers.NoteRhythmMaker(
...     duration_specifier=abjadext.rmakers.DurationSpecifier(
...         spell_metrically=True,
...         ),
...     )
>>> divisions = [(3, 4), (6, 16), (9, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Spells only unassignable durations metrically when spell_metrically is 'unassignable':

>>> rhythm_maker = abjadext.rmakers.NoteRhythmMaker(
...     duration_specifier=abjadext.rmakers.DurationSpecifier(
...         spell_metrically='unassignable',
...         ),
...     )
>>> divisions = [(3, 4), (6, 16), (9, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

9/16 is spelled metrically because it is unassignable. The other durations are spelled with the fewest number of symbols possible.

Rewrites meter:

>>> rhythm_maker = abjadext.rmakers.NoteRhythmMaker(
...     duration_specifier=abjadext.rmakers.DurationSpecifier(
...         rewrite_meter=True,
...         ),
...     )
>>> divisions = [(3, 4), (6, 16), (9, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 
Return type:Optional[DurationSpecifier]
logical_tie_masks

Gets logical tie masks.

No logical tie masks:

>>> rhythm_maker = abjadext.rmakers.NoteRhythmMaker()
>>> divisions = [(4, 8), (3, 8), (4, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Silences every other logical tie:

>>> rhythm_maker = abjadext.rmakers.NoteRhythmMaker(
...     logical_tie_masks=abjadext.rmakers.silence([0], 2),
...     )
>>> divisions = [(4, 8), (3, 8), (4, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Silences all logical ties:

>>> rhythm_maker = abjadext.rmakers.NoteRhythmMaker(
...     logical_tie_masks=abjadext.rmakers.silence([0], 1),
...     )
>>> divisions = [(4, 8), (3, 8), (4, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 
Return type:Optional[PatternTuple]
(RhythmMaker).previous_state

Gets previous state dictionary.

Return type:OrderedDict
(RhythmMaker).state

Gets state dictionary.

Return type:OrderedDict
tie_specifier

Gets tie specifier.

Does not tie across divisions:

>>> rhythm_maker = abjadext.rmakers.NoteRhythmMaker(
...     tie_specifier=abjadext.rmakers.TieSpecifier(
...         tie_across_divisions=False,
...         ),
...     )
>>> divisions = [(4, 8), (3, 8), (4, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Ties across divisions:

>>> rhythm_maker = abjadext.rmakers.NoteRhythmMaker(
...     tie_specifier=abjadext.rmakers.TieSpecifier(
...         tie_across_divisions=True,
...         ),
...     )
>>> divisions = [(4, 8), (3, 8), (4, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Patterns ties across divisions:

>>> pattern = abjad.Pattern(
...     indices=[0],
...     period=2,
...     )
>>> rhythm_maker = abjadext.rmakers.NoteRhythmMaker(
...     tie_specifier=abjadext.rmakers.TieSpecifier(
...         tie_across_divisions=pattern,
...         ),
...     )
>>> divisions = [(4, 8), (3, 8), (4, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Uses repeat ties:

>>> rhythm_maker = abjadext.rmakers.NoteRhythmMaker(
...     tie_specifier=abjadext.rmakers.TieSpecifier(
...         tie_across_divisions=True,
...         repeat_ties=True,
...         ),
...     )
>>> divisions = [(4, 8), (3, 8), (9, 16), (5, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Strips all ties:

>>> rhythm_maker = abjadext.rmakers.NoteRhythmMaker(
...     tie_specifier=abjadext.rmakers.TieSpecifier(
...         strip_ties=True,
...         ),
...     )
>>> divisions = [(7, 16), (1, 4), (5, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Spells durations metrically and then strips all ties:

>>> rhythm_maker = abjadext.rmakers.NoteRhythmMaker(
...     duration_specifier=abjadext.rmakers.DurationSpecifier(
...         spell_metrically=True,
...         ),
...     tie_specifier=abjadext.rmakers.TieSpecifier(
...         strip_ties=True,
...         ),
...     )
>>> divisions = [(7, 16), (1, 4), (5, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Returns tie specifier.

Return type:Optional[TieSpecifier]
tuplet_specifier

Gets tuplet specifier.

Spells tuplets as diminutions:

>>> rhythm_maker = abjadext.rmakers.NoteRhythmMaker()
>>> divisions = [(5, 14), (3, 7)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Spells tuplets as augmentations:

>>> rhythm_maker = abjadext.rmakers.NoteRhythmMaker(
...     tuplet_specifier=abjadext.rmakers.TupletSpecifier(
...         diminution=False,
...         ),
...     )
>>> divisions = [(5, 14), (3, 7)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 
Return type:Optional[TupletSpecifier]