TupletRhythmMaker

class rhythmmakertools.TupletRhythmMaker(tuplet_ratios=None, beam_specifier=None, division_masks=None, duration_spelling_specifier=None, preferred_denominator=None, tie_specifier=None, tuplet_spelling_specifier=None)

Tuplet rhythm-maker.

Example 1. Makes tuplets with 3:2 ratios:

>>> rhythm_maker = rhythmmakertools.TupletRhythmMaker(
...     tuplet_ratios=[(3, 2)],
...     )
>>> divisions = [(1, 2), (3, 8), (5, 16), (5, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Example 2. Makes tuplets with alternating 1:-1 and 3:1 ratios:

>>> rhythm_maker = rhythmmakertools.TupletRhythmMaker(
...     tuplet_ratios=[(1, -1), (3, 1)],
...     )
>>> divisions = [(1, 2), (3, 8), (5, 16), (5, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> 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 fixed-duration tuplet.

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

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.RhythmMaker.RhythmMaker" [color=3, group=2, label=RhythmMaker, shape=box]; "abjad.tools.rhythmmakertools.TupletRhythmMaker.TupletRhythmMaker" [color=black, fontcolor=white, group=2, label=<<B>TupletRhythmMaker</B>>, shape=box, style="filled, rounded"]; "abjad.tools.rhythmmakertools.RhythmMaker.RhythmMaker" -> "abjad.tools.rhythmmakertools.TupletRhythmMaker.TupletRhythmMaker"; } subgraph cluster_builtins { graph [label=builtins]; "builtins.object" [color=2, group=1, label=object, shape=box]; } "abjad.tools.abctools.AbjadValueObject.AbjadValueObject" -> "abjad.tools.rhythmmakertools.RhythmMaker.RhythmMaker"; "builtins.object" -> "abjad.tools.abctools.AbjadObject.AbstractBase"; }

Attribute summary

beam_specifier Gets beam specifier.
division_masks Gets division masks.
duration_spelling_specifier Gets duration spelling specifier.
logical_tie_masks Gets logical tie masks.
preferred_denominator Gets preferred denominator.
tie_specifier Gets tie specifier.
tuplet_ratios Gets tuplet ratios.
tuplet_spelling_specifier Gets tuplet spelling specifier.
__call__(divisions[, rotation]) Calls tuplet rhythm-maker on divisions.
__copy__(\*args) Copies Abjad value object.
__eq__(expr) Is true when all initialization values of Abjad value object equal the initialization values of expr.
__format__([format_specification]) Formats tuplet rhythm-maker.
__hash__() Hashes Abjad value object.
__illustrate__([divisions]) Illustrates rhythm-maker.
__ne__(expr) Is true when Abjad object does not equal expr.
__repr__() Gets interpreter representation of Abjad object.

Read-only properties

TupletRhythmMaker.beam_specifier

Gets beam specifier.

Example 1. Beams each division:

>>> rhythm_maker = rhythmmakertools.TupletRhythmMaker(
...     tuplet_ratios=[(1, 1, 2, 1, 1), (3, 1, 1)],
...     beam_specifier=rhythmmakertools.BeamSpecifier(
...         beam_each_division=True,
...         ),
...     )
>>> divisions = [(5, 8), (3, 8), (6, 8), (4, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file)  

Example 2. Beams divisions together:

>>> rhythm_maker = rhythmmakertools.TupletRhythmMaker(
...     tuplet_ratios=[(1, 1, 2, 1, 1), (3, 1, 1)],
...     beam_specifier=rhythmmakertools.BeamSpecifier(
...         beam_divisions_together=True,
...         ),
...     )
>>> divisions = [(5, 8), (3, 8), (6, 8), (4, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file)  

Example 3. Beams nothing:

>>> rhythm_maker = rhythmmakertools.TupletRhythmMaker(
...     tuplet_ratios=[(1, 1, 2, 1, 1), (3, 1, 1)],
...     beam_specifier=rhythmmakertools.BeamSpecifier(
...         beam_divisions_together=False,
...         beam_each_division=False,
...         ),
...     )
>>> divisions = [(5, 8), (3, 8), (6, 8), (4, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file)  

Ignores beam_each_division when beam_division_together is true.

Set to beam specifier or none.

Returns beam specifier or none.

TupletRhythmMaker.division_masks

Gets division masks.

Example 1. No division masks:

>>> rhythm_maker = rhythmmakertools.TupletRhythmMaker(
...     tuplet_ratios=[(4, 1)],
...     beam_specifier=rhythmmakertools.BeamSpecifier(
...         beam_divisions_together=False,
...         beam_each_division=False,
...         ),
...     )
>>> divisions = [(3, 8), (4, 8), (3, 8), (4, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Example 2. Masks every other output division:

>>> rhythm_maker = rhythmmakertools.TupletRhythmMaker(
...     tuplet_ratios=[(4, 1)],
...     beam_specifier=rhythmmakertools.BeamSpecifier(
...         beam_divisions_together=False,
...         beam_each_division=False,
...         ),
...     division_masks=[
...         rhythmmakertools.silence_every([1], period=2),
...         ],
...     )
>>> divisions = [(3, 8), (4, 8), (3, 8), (4, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Set to division masks or none.

Returns division masks or none.

(RhythmMaker).duration_spelling_specifier

Gets duration spelling specifier.

Set to duration spelling specifier or none.

(RhythmMaker).logical_tie_masks

Gets logical tie masks.

Set to patterns or none.

Defaults to none.

Returns patterns or none.

TupletRhythmMaker.preferred_denominator

Gets preferred denominator.

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

>>> rhythm_maker = rhythmmakertools.TupletRhythmMaker(
...     tuplet_ratios=[(1, 4)],
...     tuplet_spelling_specifier=rhythmmakertools.TupletSpellingSpecifier(
...         avoid_dots=True,
...         preferred_denominator=None,
...         ),
...     )
>>> divisions = [(2, 16), (4, 16), (6, 16), (8, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

This is default behavior.

Example 2. The preferred denominator of each tuplet is set to the numerator of the division that generates the tuplet when preferred_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 = rhythmmakertools.TupletRhythmMaker(
...     tuplet_ratios=[(1, 4)],
...     tuplet_spelling_specifier=rhythmmakertools.TupletSpellingSpecifier(
...         avoid_dots=True,
...         preferred_denominator='divisions',
...         ),
...     )
>>> divisions = [(2, 16), (4, 16), (6, 16), (8, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

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

>>> rhythm_maker = rhythmmakertools.TupletRhythmMaker(
...     tuplet_ratios=[(1, 4)],
...     tuplet_spelling_specifier=rhythmmakertools.TupletSpellingSpecifier(
...         avoid_dots=True,
...         preferred_denominator=Duration(1, 16),
...         ),
...     )
>>> divisions = [(2, 16), (4, 16), (6, 16), (8, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

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

>>> rhythm_maker = rhythmmakertools.TupletRhythmMaker(
...     tuplet_ratios=[(1, 4)],
...     tuplet_spelling_specifier=rhythmmakertools.TupletSpellingSpecifier(
...         avoid_dots=True,
...         preferred_denominator=Duration(1, 32),
...         ),
...     )
>>> divisions = [(2, 16), (4, 16), (6, 16), (8, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

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

>>> rhythm_maker = rhythmmakertools.TupletRhythmMaker(
...     tuplet_ratios=[(1, 4)],
...     tuplet_spelling_specifier=rhythmmakertools.TupletSpellingSpecifier(
...         avoid_dots=True,
...         preferred_denominator=Duration(1, 64),
...         ),
...     )
>>> divisions = [(2, 16), (4, 16), (6, 16), (8, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Example 6. The preferred denominator of each tuplet is set directly when preferred_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 = rhythmmakertools.TupletRhythmMaker(
...     tuplet_ratios=[(1, 4)],
...     tuplet_spelling_specifier=rhythmmakertools.TupletSpellingSpecifier(
...         avoid_dots=True,
...         preferred_denominator=8,
...         ),
...     )
>>> divisions = [(2, 16), (4, 16), (6, 16), (8, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

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

>>> rhythm_maker = rhythmmakertools.TupletRhythmMaker(
...     tuplet_ratios=[(1, 4)],
...     tuplet_spelling_specifier=rhythmmakertools.TupletSpellingSpecifier(
...         avoid_dots=True,
...         preferred_denominator=12,
...         ),
...     )
>>> divisions = [(2, 16), (4, 16), (6, 16), (8, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

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

>>> rhythm_maker = rhythmmakertools.TupletRhythmMaker(
...     tuplet_ratios=[(1, 4)],
...     tuplet_spelling_specifier=rhythmmakertools.TupletSpellingSpecifier(
...         avoid_dots=True,
...         preferred_denominator=13,
...         ),
...     )
>>> divisions = [(2, 16), (4, 16), (6, 16), (8, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

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

Returns 'divisions', duration, positive integer or none.

TupletRhythmMaker.tie_specifier

Gets tie specifier.

Example 1. Ties nothing:

>>> rhythm_maker = rhythmmakertools.TupletRhythmMaker(
...     tuplet_ratios=[(2, 3), (1, -2, 1)],
...     tie_specifier=rhythmmakertools.TieSpecifier(
...         tie_across_divisions=False,
...         ),
...     )
>>> divisions = [(1, 2), (3, 8), (5, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

This is default behavior.

Example 2. Ties across all divisions:

>>> rhythm_maker = rhythmmakertools.TupletRhythmMaker(
...     tuplet_ratios=[(2, 3), (1, -2, 1)],
...     tie_specifier=rhythmmakertools.TieSpecifier(
...         tie_across_divisions=True,
...         ),
...     )
>>> divisions = [(1, 2), (3, 8), (5, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Example 3. Ties across every other division:

>>> pattern = patterntools.Pattern(
...     indices=[0],
...     period=2,
...     )
>>> rhythm_maker = rhythmmakertools.TupletRhythmMaker(
...     tuplet_ratios=[(2, 3), (1, -2, 1)],
...     tie_specifier=rhythmmakertools.TieSpecifier(
...         tie_across_divisions=pattern,
...         ),
...     )
>>> divisions = [(1, 2), (3, 8), (5, 16), (5, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Set to tie specifier or none.

Returns tie speicifer or none.

TupletRhythmMaker.tuplet_ratios

Gets tuplet ratios.

Example 1. Makes tuplets with 3:2 ratios:

>>> rhythm_maker = rhythmmakertools.TupletRhythmMaker(
...     tuplet_ratios=[(3, 2)],
...     )
>>> divisions = [(1, 2), (3, 8), (5, 16), (5, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Example 2. Makes tuplets with alternating 1:-1 and 3:1 ratios:

>>> rhythm_maker = rhythmmakertools.TupletRhythmMaker(
...     tuplet_ratios=[(1, -1), (3, 1)],
...     )
>>> divisions = [(1, 2), (3, 8), (5, 16), (5, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Set to tuple of ratios.

Returns tuple of ratios.

TupletRhythmMaker.tuplet_spelling_specifier

Gets tuplet spelling specifier.

Example 1. Makes diminished tuplets and does not avoid dots:

>>> rhythm_maker = rhythmmakertools.TupletRhythmMaker(
...     tuplet_ratios=[(1, 1)],
...     tuplet_spelling_specifier=rhythmmakertools.TupletSpellingSpecifier(
...         avoid_dots=False,
...         is_diminution=True,
...         ),
...     )
>>> divisions = [(2, 8), (3, 8), (7, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

This is default behavior.

Example 2. Makes diminished tuplets and avoids dots:

>>> rhythm_maker = rhythmmakertools.TupletRhythmMaker(
...     tuplet_ratios=[(1, 1)],
...     tuplet_spelling_specifier=rhythmmakertools.TupletSpellingSpecifier(
...         avoid_dots=True,
...         is_diminution=True,
...         ),
...     )
>>> divisions = [(2, 8), (3, 8), (7, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Example 3. Makes augmented tuplets and does not avoid dots:

>>> rhythm_maker = rhythmmakertools.TupletRhythmMaker(
...     tuplet_ratios=[(1, 1)],
...     tuplet_spelling_specifier=rhythmmakertools.TupletSpellingSpecifier(
...         avoid_dots=False,
...         is_diminution=False,
...         ),
...     )
>>> divisions = [(2, 8), (3, 8), (7, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Example 4. Makes augmented tuplets and avoids dots:

>>> rhythm_maker = rhythmmakertools.TupletRhythmMaker(
...     tuplet_ratios=[(1, 1)],
...     tuplet_spelling_specifier=rhythmmakertools.TupletSpellingSpecifier(
...         avoid_dots=True,
...         is_diminution=False,
...         ),
...     )
>>> divisions = [(2, 8), (3, 8), (7, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Example 5. Does not simplify tuplets:

>>> rhythm_maker = rhythmmakertools.TupletRhythmMaker(
...     tuplet_ratios=[(3, -2), (1,), (-2, 3), (1, 1)],
...     tuplet_spelling_specifier=rhythmmakertools.TupletSpellingSpecifier(
...         avoid_dots=True,
...         simplify_redundant_tuplets=False,
...         ),
...     )
>>> divisions = [(3, 8), (3, 8), (3, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Example 6. Simplifies tuplets:

>>> rhythm_maker = rhythmmakertools.TupletRhythmMaker(
...     tuplet_ratios=[(3, -2), (1,), (-2, 3), (1, 1)],
...     tuplet_spelling_specifier=rhythmmakertools.TupletSpellingSpecifier(
...         avoid_dots=True,
...         simplify_redundant_tuplets=True,
...         ),
...     )
>>> divisions = [(3, 8), (3, 8), (3, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Example 7. Leaves trivial tuplets enclosed in curly braces in LilyPond output:

>>> rhythm_maker = rhythmmakertools.TupletRhythmMaker(
...     tie_specifier=rhythmmakertools.TieSpecifier(
...         tie_across_divisions=True,
...         ),
...     tuplet_ratios=[(2, 3), (1, 1)],
...     tuplet_spelling_specifier=rhythmmakertools.TupletSpellingSpecifier(
...         flatten_trivial_tuplets=False,
...         ),
...     )
>>> divisions = [(3, 8), (2, 8), (3, 8), (2, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 
>>> staff = rhythm_maker._get_staff(lilypond_file)
>>> f(staff)
\new RhythmicStaff {
    {
        \time 3/8
        \tweak text #tuplet-number::calc-fraction-text
        \times 3/5 {
            c'4
            c'4. ~
        }
    }
    {
        \time 2/8
        {
            c'8 [
            c'8 ~ ]
        }
    }
    {
        \time 3/8
        \tweak text #tuplet-number::calc-fraction-text
        \times 3/5 {
            c'4
            c'4. ~
        }
    }
    {
        \time 2/8
        {
            c'8 [
            c'8 ]
        }
    }
}

Runs of eighth notes are enclosed in a first set of curly braces (representing trivial tuplets) and a second set of curly braces (representing measures). This is default behavior.

Example 8. Flattens trivial tuplets:

>>> rhythm_maker = rhythmmakertools.TupletRhythmMaker(
...     tie_specifier=rhythmmakertools.TieSpecifier(
...         tie_across_divisions=True,
...         ),
...     tuplet_ratios=[(2, 3), (1, 1)],
...     tuplet_spelling_specifier=rhythmmakertools.TupletSpellingSpecifier(
...         flatten_trivial_tuplets=True,
...         ),
...     )
>>> divisions = [(3, 8), (2, 8), (3, 8), (2, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 
>>> staff = rhythm_maker._get_staff(lilypond_file)
>>> f(staff)
\new RhythmicStaff {
    {
        \time 3/8
        \tweak text #tuplet-number::calc-fraction-text
        \times 3/5 {
            c'4
            c'4. ~
        }
    }
    {
        \time 2/8
        c'8 [
        c'8 ~ ]
    }
    {
        \time 3/8
        \tweak text #tuplet-number::calc-fraction-text
        \times 3/5 {
            c'4
            c'4. ~
        }
    }
    {
        \time 2/8
        c'8 [
        c'8 ]
    }
}

Runs of eighth notes are now enclosed in only one set of curly braces (representing measures). The graphic output of the two examples is the same.

Note

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

Defaults to none.

Set to tuplet spelling specifier or none.

Returns tuplet spelling specifier or none.

Special methods

TupletRhythmMaker.__call__(divisions, rotation=None)

Calls tuplet rhythm-maker on divisions.

Example 1. Calls tuplet rhythm-maker with one ratio:

>>> rhythm_maker = rhythmmakertools.TupletRhythmMaker(
...     tuplet_ratios=[(3, 2)],
...     )
>>> divisions = [(1, 2), (3, 8), (5, 16), (5, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Example 2. Calls tuplet rhythm-maker on two ratios:

>>> rhythm_maker = rhythmmakertools.TupletRhythmMaker(
...     tuplet_ratios=[(1, -1), (3, 1)],
...     )
>>> divisions = [(1, 2), (3, 8), (5, 16), (5, 16)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

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

(AbjadValueObject).__copy__(*args)

Copies Abjad value object.

Returns new Abjad value object.

(AbjadValueObject).__eq__(expr)

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

Returns true or false.

TupletRhythmMaker.__format__(format_specification='')

Formats tuplet rhythm-maker.

Example 1. Formats tuplet rhythm-maker with one ratio:

>>> rhythm_maker = rhythmmakertools.TupletRhythmMaker(
...     tuplet_ratios=[(3, 2)],
...     )
>>> print(format(rhythm_maker))
rhythmmakertools.TupletRhythmMaker(
    tuplet_ratios=(
        mathtools.Ratio((3, 2)),
        ),
    )

Example 2. Formats tuplet rhythm-maker with two ratios:

>>> rhythm_maker = rhythmmakertools.TupletRhythmMaker(
...     tuplet_ratios=[(1, -1), (3, 1)],
...     )
>>> print(format(rhythm_maker))
rhythmmakertools.TupletRhythmMaker(
    tuplet_ratios=(
        mathtools.Ratio((1, -1)),
        mathtools.Ratio((3, 1)),
        ),
    )

Set format_specification to ‘’ or ‘storage’.

Returns string.

(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).__ne__(expr)

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

Returns true or false.

(AbjadObject).__repr__()

Gets interpreter representation of Abjad object.

Returns string.