TupletRhythmMaker

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.RhythmMaker.RhythmMaker" [URL="../api/abjadext/rmakers/RhythmMaker.html#abjadext.rmakers.RhythmMaker.RhythmMaker", label="Rhythm\nMaker", target=_top]; "abjadext.rmakers.TupletRhythmMaker.TupletRhythmMaker" [URL="../api/abjadext/rmakers/TupletRhythmMaker.html#abjadext.rmakers.TupletRhythmMaker.TupletRhythmMaker", color=black, fontcolor=white, label="Tuplet\nRhythm\nMaker", target=_top]; "abjadext.rmakers.RhythmMaker.RhythmMaker" -> "abjadext.rmakers.TupletRhythmMaker.TupletRhythmMaker"; } 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.TupletRhythmMaker.TupletRhythmMaker(*, beam_specifier=None, denominator=None, division_masks=None, duration_specifier=None, tie_specifier=None, tuplet_ratios=None, tuplet_specifier=None)

Tuplet rhythm-maker.

Makes tuplets with 3:2 ratios:

>>> rhythm_maker = abjadext.rmakers.TupletRhythmMaker(
...     tuplet_ratios=[(3, 2)],
...     )
>>> divisions = [(1, 2), (3, 8), (5, 16), (5, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Makes tuplets with alternating 1:-1 and 3:1 ratios:

>>> rhythm_maker = abjadext.rmakers.TupletRhythmMaker(
...     tuplet_ratios=[(1, -1), (3, 1)],
...     )
>>> divisions = [(1, 2), (3, 8), (5, 16), (5, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Object model of a partially evaluated function that accepts a (possibly empty) list of divisions as input and returns a list of selections as output. Output structured one selection per division with each selection wrapping a single tuplet.

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


Attributes Summary

__call__ Calls tuplet rhythm-maker on divisions.
__format__ Formats tuplet rhythm-maker.
beam_specifier Gets beam specifier.
denominator Gets preferred denominator.
division_masks Gets division masks.
tie_specifier Gets tie specifier.
tuplet_ratios Gets tuplet ratios.
tuplet_specifier Gets tuplet specifier.

Special methods

__call__(divisions, previous_state=None)

Calls tuplet rhythm-maker on divisions.

Calls tuplet rhythm-maker with one ratio:

>>> rhythm_maker = abjadext.rmakers.TupletRhythmMaker(
...     tuplet_ratios=[(3, 2)],
...     )
>>> divisions = [(1, 2), (3, 8), (5, 16), (5, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Calls tuplet rhythm-maker on two ratios:

>>> rhythm_maker = abjadext.rmakers.TupletRhythmMaker(
...     tuplet_ratios=[(1, -1), (3, 1)],
...     )
>>> divisions = [(1, 2), (3, 8), (5, 16), (5, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Returns list of selections structured one selection per division. Each selection wraps a single tuplet.

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 tuplet rhythm-maker.

Formats tuplet rhythm-maker with one ratio:

>>> rhythm_maker = abjadext.rmakers.TupletRhythmMaker(
...     tuplet_ratios=[(3, 2)],
...     )
>>> abjad.f(rhythm_maker)
abjadext.rmakers.TupletRhythmMaker(
    tuplet_ratios=[
        abjad.Ratio((3, 2)),
        ],
    )

Formats tuplet rhythm-maker with two ratios:

>>> rhythm_maker = abjadext.rmakers.TupletRhythmMaker(
...     tuplet_ratios=[(1, -1), (3, 1)],
...     )
>>> abjad.f(rhythm_maker)
abjadext.rmakers.TupletRhythmMaker(
    tuplet_ratios=[
        abjad.Ratio((1, -1)),
        abjad.Ratio((3, 1)),
        ],
    )
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.

(AbjadObject).__repr__()

Gets interpreter representation of Abjad object.

Returns string.


Read-only properties

beam_specifier

Gets beam specifier.

Beams each division:

>>> rhythm_maker = abjadext.rmakers.TupletRhythmMaker(
...     tuplet_ratios=[(1, 1, 2, 1, 1), (3, 1, 1)],
...     beam_specifier=abjadext.rmakers.BeamSpecifier(
...         beam_each_division=True,
...         ),
...     )
>>> divisions = [(5, 8), (3, 8), (6, 8), (4, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file)  

Beams divisions together:

>>> rhythm_maker = abjadext.rmakers.TupletRhythmMaker(
...     tuplet_ratios=[(1, 1, 2, 1, 1), (3, 1, 1)],
...     beam_specifier=abjadext.rmakers.BeamSpecifier(
...         beam_divisions_together=True,
...         ),
...     )
>>> divisions = [(5, 8), (3, 8), (6, 8), (4, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file)  

Beams nothing:

>>> rhythm_maker = abjadext.rmakers.TupletRhythmMaker(
...     tuplet_ratios=[(1, 1, 2, 1, 1), (3, 1, 1)],
...     beam_specifier=abjadext.rmakers.BeamSpecifier(
...         beam_divisions_together=False,
...         beam_each_division=False,
...         ),
...     )
>>> divisions = [(5, 8), (3, 8), (6, 8), (4, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file)  

Ignores beam_each_division when beam_division_together is true.

Return type:Optional[BeamSpecifier]
denominator

Gets preferred denominator.

Tuplet numerators and denominators are reduced to numbers that are relatively prime when denominator is set to none. This means that ratios like 6:4 and 10:8 do not arise:

>>> rhythm_maker = abjadext.rmakers.TupletRhythmMaker(
...     tuplet_ratios=[(1, 4)],
...     tuplet_specifier=abjadext.rmakers.TupletSpecifier(
...         rewrite_dots=True,
...         denominator=None,
...         ),
...     )
>>> divisions = [(2, 16), (4, 16), (6, 16), (8, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

The preferred denominator of each tuplet is set to the numerator of the division that generates the tuplet when denominator is set to the string 'divisions'. This means that the tuplet numerator and denominator are not necessarily relatively prime. This also means that ratios like 6:4 and 10:8 may arise:

>>> rhythm_maker = abjadext.rmakers.TupletRhythmMaker(
...     tuplet_ratios=[(1, 4)],
...     tuplet_specifier=abjadext.rmakers.TupletSpecifier(
...         rewrite_dots=True,
...         denominator='divisions',
...         ),
...     )
>>> divisions = [(2, 16), (4, 16), (6, 16), (8, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

The preferred denominator of each tuplet is set in terms of a unit duration when denominator is set to a duration. The setting does not affect the first tuplet:

>>> rhythm_maker = abjadext.rmakers.TupletRhythmMaker(
...     tuplet_ratios=[(1, 4)],
...     tuplet_specifier=abjadext.rmakers.TupletSpecifier(
...         rewrite_dots=True,
...         denominator=(1, 16),
...         ),
...     )
>>> divisions = [(2, 16), (4, 16), (6, 16), (8, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Sets the preferred denominator of each tuplet in terms 32nd notes. The setting affects all tuplets:

>>> rhythm_maker = abjadext.rmakers.TupletRhythmMaker(
...     tuplet_ratios=[(1, 4)],
...     tuplet_specifier=abjadext.rmakers.TupletSpecifier(
...         rewrite_dots=True,
...         denominator=(1, 32),
...         ),
...     )
>>> divisions = [(2, 16), (4, 16), (6, 16), (8, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Sets the preferred denominator each tuplet in terms 64th notes. The setting affects all tuplets:

>>> rhythm_maker = abjadext.rmakers.TupletRhythmMaker(
...     tuplet_ratios=[(1, 4)],
...     tuplet_specifier=abjadext.rmakers.TupletSpecifier(
...         rewrite_dots=True,
...         denominator=(1, 64),
...         ),
...     )
>>> divisions = [(2, 16), (4, 16), (6, 16), (8, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

The preferred denominator of each tuplet is set directly when denominator is set to a positive integer. This example sets the preferred denominator of each tuplet to 8. Setting does not affect the third tuplet:

>>> rhythm_maker = abjadext.rmakers.TupletRhythmMaker(
...     tuplet_ratios=[(1, 4)],
...     tuplet_specifier=abjadext.rmakers.TupletSpecifier(
...         rewrite_dots=True,
...         denominator=8,
...         ),
...     )
>>> divisions = [(2, 16), (4, 16), (6, 16), (8, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Sets the preferred denominator of each tuplet to 12. Setting affects all tuplets:

>>> rhythm_maker = abjadext.rmakers.TupletRhythmMaker(
...     tuplet_ratios=[(1, 4)],
...     tuplet_specifier=abjadext.rmakers.TupletSpecifier(
...         rewrite_dots=True,
...         denominator=12,
...         ),
...     )
>>> divisions = [(2, 16), (4, 16), (6, 16), (8, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Sets the preferred denominator of each tuplet to 13. Setting does not affect any tuplet:

>>> rhythm_maker = abjadext.rmakers.TupletRhythmMaker(
...     tuplet_ratios=[(1, 4)],
...     tuplet_specifier=abjadext.rmakers.TupletSpecifier(
...         rewrite_dots=True,
...         denominator=13,
...         ),
...     )
>>> divisions = [(2, 16), (4, 16), (6, 16), (8, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Set to 'divisions', duration, positive integer or none.

Return type:Union[str, Duration, int, None]
division_masks

Gets division masks.

No division masks:

>>> rhythm_maker = abjadext.rmakers.TupletRhythmMaker(
...     tuplet_ratios=[(4, 1)],
...     beam_specifier=abjadext.rmakers.BeamSpecifier(
...         beam_divisions_together=False,
...         beam_each_division=False,
...         ),
...     )
>>> divisions = [(3, 8), (4, 8), (3, 8), (4, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Masks every other output division:

>>> rhythm_maker = abjadext.rmakers.TupletRhythmMaker(
...     tuplet_ratios=[(4, 1)],
...     beam_specifier=abjadext.rmakers.BeamSpecifier(
...         beam_divisions_together=False,
...         beam_each_division=False,
...         ),
...     division_masks=[
...         abjadext.rmakers.silence([1], 2),
...         ],
...     )
>>> divisions = [(3, 8), (4, 8), (3, 8), (4, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 
Return type:Optional[PatternTuple]
(RhythmMaker).duration_specifier

Gets duration specifier.

Return type:Optional[DurationSpecifier]
(RhythmMaker).logical_tie_masks

Gets logical tie masks.

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.

Ties nothing:

>>> rhythm_maker = abjadext.rmakers.TupletRhythmMaker(
...     tuplet_ratios=[(2, 3), (1, -2, 1)],
...     tie_specifier=abjadext.rmakers.TieSpecifier(
...         tie_across_divisions=False,
...         ),
...     )
>>> divisions = [(1, 2), (3, 8), (5, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Ties across all divisions:

>>> rhythm_maker = abjadext.rmakers.TupletRhythmMaker(
...     tuplet_ratios=[(2, 3), (1, -2, 1)],
...     tie_specifier=abjadext.rmakers.TieSpecifier(
...         tie_across_divisions=True,
...         ),
...     )
>>> divisions = [(1, 2), (3, 8), (5, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Ties across every other division:

>>> pattern = abjad.Pattern(
...     indices=[0],
...     period=2,
...     )
>>> rhythm_maker = abjadext.rmakers.TupletRhythmMaker(
...     tuplet_ratios=[(2, 3), (1, -2, 1)],
...     tie_specifier=abjadext.rmakers.TieSpecifier(
...         tie_across_divisions=pattern,
...         ),
...     )
>>> divisions = [(1, 2), (3, 8), (5, 16), (5, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 
Return type:Optional[TieSpecifier]
tuplet_ratios

Gets tuplet ratios.

Makes tuplets with 3:2 ratios:

>>> rhythm_maker = abjadext.rmakers.TupletRhythmMaker(
...     tuplet_ratios=[(3, 2)],
...     )
>>> divisions = [(1, 2), (3, 8), (5, 16), (5, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Makes tuplets with alternating 1:-1 and 3:1 ratios:

>>> rhythm_maker = abjadext.rmakers.TupletRhythmMaker(
...     tuplet_ratios=[(1, -1), (3, 1)],
...     )
>>> divisions = [(1, 2), (3, 8), (5, 16), (5, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 
Return type:Optional[List[Ratio]]
tuplet_specifier

Gets tuplet specifier.

Makes diminished tuplets:

>>> rhythm_maker = abjadext.rmakers.TupletRhythmMaker(
...     tuplet_ratios=[(2, 1)],
...     tuplet_specifier=abjadext.rmakers.TupletSpecifier(
...         diminution=True,
...         ),
...     )
>>> divisions = [(2, 8), (2, 8), (4, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Makes augmented tuplets:

>>> rhythm_maker = abjadext.rmakers.TupletRhythmMaker(
...     tuplet_ratios=[(2, 1)],
...     tuplet_specifier=abjadext.rmakers.TupletSpecifier(
...         diminution=False,
...         ),
...     )
>>> divisions = [(2, 8), (2, 8), (4, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Makes diminished tuplets and does not rewrite dots:

>>> rhythm_maker = abjadext.rmakers.TupletRhythmMaker(
...     tuplet_ratios=[(1, 1)],
...     tuplet_specifier=abjadext.rmakers.TupletSpecifier(
...         rewrite_dots=False,
...         diminution=True,
...         ),
...     )
>>> divisions = [(2, 8), (3, 8), (7, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Makes diminished tuplets and rewrites dots:

>>> rhythm_maker = abjadext.rmakers.TupletRhythmMaker(
...     tuplet_ratios=[(1, 1)],
...     tuplet_specifier=abjadext.rmakers.TupletSpecifier(
...         rewrite_dots=True,
...         diminution=True,
...         ),
...     )
>>> divisions = [(2, 8), (3, 8), (7, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Makes augmented tuplets and does not rewrite dots:

>>> rhythm_maker = abjadext.rmakers.TupletRhythmMaker(
...     tuplet_ratios=[(1, 1)],
...     tuplet_specifier=abjadext.rmakers.TupletSpecifier(
...         rewrite_dots=False,
...         diminution=False,
...         ),
...     )
>>> divisions = [(2, 8), (3, 8), (7, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Makes augmented tuplets and rewrites dots:

>>> rhythm_maker = abjadext.rmakers.TupletRhythmMaker(
...     tuplet_ratios=[(1, 1)],
...     tuplet_specifier=abjadext.rmakers.TupletSpecifier(
...         rewrite_dots=True,
...         diminution=False,
...         ),
...     )
>>> divisions = [(2, 8), (3, 8), (7, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Leaves trivializable tuplets as-is when trivialize is false:

>>> rhythm_maker = abjadext.rmakers.TupletRhythmMaker(
...     tuplet_ratios=[(3, -2), (1,), (-2, 3), (1, 1)],
...     tuplet_specifier=abjadext.rmakers.TupletSpecifier(
...         rewrite_dots=True,
...         trivialize=False,
...         ),
...     )
>>> divisions = [(3, 8), (3, 8), (3, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Rewrites trivializable tuplets when trivialize is true. Measures 2 and 4 contain trivial tuplets with 1:1 ratios. To remove these trivial tuplets, set extract_trivial as shown in the next example:

>>> rhythm_maker = abjadext.rmakers.TupletRhythmMaker(
...     tuplet_ratios=[(3, -2), (1,), (-2, 3), (1, 1)],
...     tuplet_specifier=abjadext.rmakers.TupletSpecifier(
...         trivialize=True,
...         ),
...     )
>>> divisions = [(3, 8), (3, 8), (3, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

REGRESSION: Ignores trivialize and respects rewrite_dots when both are true. Measures 2 and 4 are first rewritten as trivial but then supplied again with nontrivial prolation when removing dots. The result is that measures 2 and 4 carry nontrivial prolation with no dots:

>>> rhythm_maker = abjadext.rmakers.TupletRhythmMaker(
...     tuplet_ratios=[(3, -2), (1,), (-2, 3), (1, 1)],
...     tuplet_specifier=abjadext.rmakers.TupletSpecifier(
...         rewrite_dots=True,
...         trivialize=True,
...         ),
...     )
>>> divisions = [(3, 8), (3, 8), (3, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Leaves trivial tuplets as-is when extract_trivial is false:

>>> rhythm_maker = abjadext.rmakers.TupletRhythmMaker(
...     tie_specifier=abjadext.rmakers.TieSpecifier(
...         tie_across_divisions=True,
...         ),
...     tuplet_ratios=[(2, 3), (1, 1)],
...     tuplet_specifier=abjadext.rmakers.TupletSpecifier(
...         extract_trivial=False,
...         ),
...     )
>>> divisions = [(3, 8), (2, 8), (3, 8), (2, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Extracts trivial tuplets when extract_trivial is true. Measures 2 and 4 in the example below now contain only a flat list of notes:

>>> rhythm_maker = abjadext.rmakers.TupletRhythmMaker(
...     tie_specifier=abjadext.rmakers.TieSpecifier(
...         tie_across_divisions=True,
...         ),
...     tuplet_ratios=[(2, 3), (1, 1)],
...     tuplet_specifier=abjadext.rmakers.TupletSpecifier(
...         extract_trivial=True,
...         ),
...     )
>>> divisions = [(3, 8), (2, 8), (3, 8), (2, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 

Note

Flattening trivial tuplets makes it possible subsequently to rewrite the meter of the untupletted notes.

REGRESSION: Very long ties are preserved when extract_trivial is true:

>>> rhythm_maker = abjadext.rmakers.TupletRhythmMaker(
...     tie_specifier=abjadext.rmakers.TieSpecifier(
...         tie_across_divisions=True,
...         tie_consecutive_notes=True,
...         ),
...     tuplet_ratios=[(2, 3), (1, 1)],
...     tuplet_specifier=abjadext.rmakers.TupletSpecifier(
...         extract_trivial=True,
...         ),
...     )
>>> divisions = [(3, 8), (2, 8), (3, 8), (2, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = abjad.LilyPondFile.rhythm(
...     selections,
...     divisions,
...     )
>>> abjad.show(lilypond_file) 
Return type:Optional[TupletSpecifier]