TaleaRhythmMaker

class rhythmmakertools.TaleaRhythmMaker(talea=None, beam_specifier=None, burnish_specifier=None, division_masks=None, duration_spelling_specifier=None, extra_counts_per_division=None, logical_tie_masks=None, read_talea_once_only=None, rest_tied_notes=None, split_divisions_by_counts=None, tie_specifier=None, tie_split_notes=True, tuplet_spelling_specifier=None, helper_functions=None)

Talea rhythm-maker.

Repeats talea of 1/16, 2/16, 3/16, 4/16:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     talea=rhythmmakertools.Talea(
...         counts=[1, 2, 3, 4],
...         denominator=16,
...         ),
...     )
>>> divisions = [(3, 8), (4, 8), (3, 8), (4, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Formats rhythm-maker:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     talea=rhythmmakertools.Talea(
...         counts=[1, 2, 3, 4],
...         denominator=16,
...         ),
...     )
>>> f(rhythm_maker)
rhythmmakertools.TaleaRhythmMaker(
    talea=rhythmmakertools.Talea(
        counts=[1, 2, 3, 4],
        denominator=16,
        ),
    )

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

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 (structured one selection per input division).

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.TaleaRhythmMaker.TaleaRhythmMaker" [color=black, fontcolor=white, group=2, label=<<B>TaleaRhythmMaker</B>>, shape=box, style="filled, rounded"]; "abjad.tools.rhythmmakertools.RhythmMaker.RhythmMaker" -> "abjad.tools.rhythmmakertools.TaleaRhythmMaker.TaleaRhythmMaker"; } 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.
burnish_specifier Gets burnish specifier.
division_masks Gets division masks.
duration_spelling_specifier Gets duration spelling specifier.
extra_counts_per_division Gets extra counts per division.
helper_functions Gets helper functions.
logical_tie_masks Gets logical tie masks.
read_talea_once_only Is true when rhythm-maker should read talea once only.
rest_tied_notes Is true when rhythm-maker should leave the head of each logical tie but change tied notes to rests and remove ties.
split_divisions_by_counts Gets secondary divisions.
talea Gets talea.
tie_specifier Gets tie specifier.
tie_split_notes Is true when talea rhythm-maker should tie split notes.
tuplet_spelling_specifier Gets tuplet spelling specifier.
__call__(divisions[, rotation]) Calls talea rhythm-maker 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 talea rhythm-maker.
__hash__() Hashes Abjad value object.
__illustrate__([divisions]) Illustrates talea rhythm-maker.
__ne__(argument) Is true when Abjad object does not equal argument.
__repr__() Gets interpreter representation.

Read-only properties

TaleaRhythmMaker.beam_specifier

Gets beam specifier.

Beams each division:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     talea=rhythmmakertools.Talea(
...         counts=[1],
...         denominator=16,
...         ),
...     beam_specifier=rhythmmakertools.BeamSpecifier(
...         beam_each_division=True,
...         ),
...     )
>>> divisions = [(3, 8), (4, 8), (3, 8), (4, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Beams divisions together:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     talea=rhythmmakertools.Talea(
...         counts=[1],
...         denominator=16,
...         ),
...     beam_specifier=rhythmmakertools.BeamSpecifier(
...         beam_divisions_together=True,
...         ),
...     )
>>> divisions = [(3, 8), (4, 8), (3, 8), (4, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Beams nothing:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     talea=rhythmmakertools.Talea(
...         counts=[1],
...         denominator=16,
...         ),
...     beam_specifier=rhythmmakertools.BeamSpecifier(
...         beam_each_division=False,
...         beam_divisions_together=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) 

Does not beam rests:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     talea=rhythmmakertools.Talea(
...         counts=[1, 1, 1, -1],
...         denominator=16,
...         ),
...     beam_specifier=rhythmmakertools.BeamSpecifier(
...         beam_each_division=True,
...         ),
...     )
>>> divisions = [(3, 8), (4, 8), (3, 8), (4, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Does beam rests:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     talea=rhythmmakertools.Talea(
...         counts=[1, 1, 1, -1],
...         denominator=16,
...         ),
...     beam_specifier=rhythmmakertools.BeamSpecifier(
...         beam_each_division=True,
...         beam_rests=True,
...         ),
...     )
>>> divisions = [(3, 8), (4, 8), (3, 8), (4, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Beams rests with stemlets:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     talea=rhythmmakertools.Talea(
...         counts=[1, 1, 1, -1],
...         denominator=16,
...         ),
...     beam_specifier=rhythmmakertools.BeamSpecifier(
...         beam_each_division=True,
...         beam_rests=True,
...         stemlet_length=0.75,
...         ),
...     )
>>> 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 beam specifier or none.

Returns beam specifier or none.

TaleaRhythmMaker.burnish_specifier

Gets burnish specifier.

Forces the first leaf and the last two leaves to be rests:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     talea=rhythmmakertools.Talea(
...         counts=[1, 2, 3, 4],
...         denominator=16,
...         ),
...     burnish_specifier=rhythmmakertools.BurnishSpecifier(
...         left_classes=[Rest],
...         left_counts=[1],
...         right_classes=[Rest],
...         right_counts=[2],
...         outer_divisions_only=True,
...         ),
...     )
>>> divisions = [(3, 8), (4, 8), (3, 8), (4, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Forces the first leaf of every division to be a rest:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     talea=rhythmmakertools.Talea(
...         counts=[1, 2, 3, 4],
...         denominator=16,
...         ),
...     burnish_specifier=rhythmmakertools.BurnishSpecifier(
...         left_classes=[Rest],
...         left_counts=[1],
...         ),
...     )
>>> 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 burnish specifier or none.

Returns burnish specifier or none.

TaleaRhythmMaker.division_masks

Gets division masks.

No division masks:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     talea=rhythmmakertools.Talea(
...         counts=[1, 2, 3, 4],
...         denominator=16,
...         ),
...     )
>>> divisions = [(3, 8), (4, 8), (3, 8), (4, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Silences every other output division:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     talea=rhythmmakertools.Talea(
...         counts=[1, 2, 3, 4],
...         denominator=16,
...         ),
...     division_masks=[
...         rhythmmakertools.SilenceMask(
...             pattern=patterntools.select_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) 

Sustains every other output division:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     talea=rhythmmakertools.Talea(
...         counts=[1, 2, 3, 4],
...         denominator=16,
...         ),
...     division_masks=[
...         rhythmmakertools.sustain_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) 

Silences every other secondary output division:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     talea=rhythmmakertools.Talea(
...         counts=[1],
...         denominator=16,
...         ),
...     split_divisions_by_counts=[9],
...     division_masks=[
...         rhythmmakertools.SilenceMask(
...             pattern=patterntools.select_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) 

Sustains every other secondary output division:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     talea=rhythmmakertools.Talea(
...         counts=[1],
...         denominator=16,
...         ),
...     split_divisions_by_counts=[9],
...     division_masks=[
...         rhythmmakertools.sustain_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 tuple of division masks or none.

Returns tuple of division masks or none.

TaleaRhythmMaker.duration_spelling_specifier

Gets duration spelling specifier.

Several duration spelling specifier configurations are available.

Spells nonassignable durations with monontonically decreasing durations:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     talea=rhythmmakertools.Talea(
...         counts=[5],
...         denominator=16,
...         ),
...     duration_spelling_specifier=rhythmmakertools.DurationSpellingSpecifier(
...         decrease_durations_monotonically=True,
...         ),
...     )
>>> divisions = [(5, 8), (5, 8), (5, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Spells nonassignable durations with monontonically increasing durations:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     talea=rhythmmakertools.Talea(
...         counts=[5],
...         denominator=16,
...         ),
...     duration_spelling_specifier=rhythmmakertools.DurationSpellingSpecifier(
...         decrease_durations_monotonically=False,
...         ),
...     )
>>> divisions = [(5, 8), (5, 8), (5, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Forbids no durations:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     talea=rhythmmakertools.Talea(
...         counts=[1, 1, 1, 1, 4, 4],
...         denominator=16,
...         ),
...     duration_spelling_specifier=rhythmmakertools.DurationSpellingSpecifier(
...         forbidden_written_duration=None,
...         ),
...     )
>>> divisions = [(3, 4), (3, 4)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Forbids durations equal to 1/4 or greater:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     talea=rhythmmakertools.Talea(
...         counts=[1, 1, 1, 1, 4, 4],
...         denominator=16,
...         ),
...     duration_spelling_specifier=rhythmmakertools.DurationSpellingSpecifier(
...         forbidden_written_duration=Duration(1, 4),
...         ),
...     )
>>> divisions = [(3, 4), (3, 4)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Rewrites forbidden durations with smaller durations tied together.

Spells all durations metrically:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     talea=rhythmmakertools.Talea(
...         counts=[5, 4],
...         denominator=16,
...         ),
...     duration_spelling_specifier=rhythmmakertools.DurationSpellingSpecifier(
...         spell_metrically=True,
...         ),
...     )
>>> divisions = [(3, 4), (3, 4), (3, 4)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Spells unassignable durations metrically:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     talea=rhythmmakertools.Talea(
...         counts=[5, 4],
...         denominator=16,
...         ),
...     duration_spelling_specifier=rhythmmakertools.DurationSpellingSpecifier(
...         spell_metrically='unassignable',
...         ),
...     )
>>> divisions = [(3, 4), (3, 4), (3, 4)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Rewrites meter:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     talea=rhythmmakertools.Talea(
...         counts=[5, 4],
...         denominator=16,
...         ),
...     duration_spelling_specifier=rhythmmakertools.DurationSpellingSpecifier(
...         rewrite_meter=True,
...         ),
...     )
>>> divisions = [(3, 4), (3, 4), (3, 4)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Set to duration spelling specifier or none.

Returns duration spelling specifier or none.

TaleaRhythmMaker.extra_counts_per_division

Gets extra counts per division.

No extra counts per division:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     talea=rhythmmakertools.Talea(
...         counts=[1, 2, 3, 4],
...         denominator=16,
...         ),
...     )
>>> divisions = [(3, 8), (4, 8), (3, 8), (4, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Adds one extra count to every other division:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     talea=rhythmmakertools.Talea(
...         counts=[1, 2, 3, 4],
...         denominator=16,
...         ),
...     extra_counts_per_division=[0, 1],
...     )
>>> divisions = [(3, 8), (4, 8), (3, 8), (4, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Adds two extra counts to every other division:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     talea=rhythmmakertools.Talea(
...         counts=[1, 2, 3, 4],
...         denominator=16,
...         ),
...     extra_counts_per_division=[0, 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) 

The duration of each added count equals the duration of each count in the rhythm-maker’s input talea.

Removes one count from every other division:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     talea=rhythmmakertools.Talea(
...         counts=[1, 2, 3, 4],
...         denominator=16,
...         ),
...     extra_counts_per_division=[0, -1],
...     )
>>> 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 integer tuple or none.

Returns integer tuple or none.

TaleaRhythmMaker.helper_functions

Gets helper functions.

Set to dictionary or none.

Returns dictionary or none.

TaleaRhythmMaker.logical_tie_masks

Gets logical tie masks.

Silences every third logical tie:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     logical_tie_masks=[
...         rhythmmakertools.silence_every([2], period=3),
...         ],
...     talea=rhythmmakertools.Talea(
...         counts=[1, 2, 3, 4],
...         denominator=16,
...         ),
...     )
>>> divisions = [(3, 8), (3, 8), (3, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Silences the first and last logical ties:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     logical_tie_masks=[
...         rhythmmakertools.silence_first(),
...         rhythmmakertools.silence_last(),
...         ],
...     talea=rhythmmakertools.Talea(
...         counts=[1, 2, 3, 4],
...         denominator=16,
...         ),
...     )
>>> divisions = [(3, 8), (3, 8), (3, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Returns patterns or none.

TaleaRhythmMaker.read_talea_once_only

Is true when rhythm-maker should read talea once only.

Reads talea cyclically:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     talea=rhythmmakertools.Talea(
...         counts=[1, 2, 3, 4],
...         denominator=16,
...         ),
...     )
>>> divisions = [(3, 8), (3, 8), (3, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Reads talea once only:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     read_talea_once_only=True,
...     talea=rhythmmakertools.Talea(
...         counts=[1, 2, 3, 4],
...         denominator=16,
...         ),
...     )

Calling rhythm_maker on these divisions raises an exception because talea is too short to read once only:

>>> divisions = [(3, 8), (3, 8), (3, 8), (3, 8)]
>>> rhythm_maker(divisions)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/joberholtzer/Development/abjad/abjad/tools/rhythmmakertools/TaleaRhythmMaker.py", line 275, in __call__
    rotation=rotation,
  File "/Users/joberholtzer/Development/abjad/abjad/tools/rhythmmakertools/RhythmMaker.py", line 77, in __call__
    selections = self._make_music(divisions, rotation)
  File "/Users/joberholtzer/Development/abjad/abjad/tools/rhythmmakertools/TaleaRhythmMaker.py", line 543, in _make_music
    extra_counts_per_division,
  File "/Users/joberholtzer/Development/abjad/abjad/tools/rhythmmakertools/TaleaRhythmMaker.py", line 586, in _make_numeric_map
    prolated_numerators,
  File "/Users/joberholtzer/Development/abjad/abjad/tools/rhythmmakertools/TaleaRhythmMaker.py", line 669, in _split_sequence_extended_to_weights
    raise Exception(message)
Exception: talea is too short to read once only:
CyclicTuple([1, 2, 3, 4]) in [6, 6, 6, 6].

Set to true to ensure talea is long enough to cover all divisions without repeating.

Provides way of using talea noncyclically when, for example, interpolating from short durations to long durations.

Set to true, false or none.

Defaults to none.

Returns true, false or none.

TaleaRhythmMaker.rest_tied_notes

Is true when rhythm-maker should leave the head of each logical tie but change tied notes to rests and remove ties.

Does not rest tied notes:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     talea=rhythmmakertools.Talea(
...         counts=[1, 2, 3, 4],
...         denominator=16,
...         ),
...     )
>>> divisions = [(3, 8), (3, 8), (3, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Rests tied notes:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     rest_tied_notes=True,
...     talea=rhythmmakertools.Talea(
...         counts=[1, 2, 3, 4],
...         denominator=16,
...         ),
...     )
>>> divisions = [(3, 8), (3, 8), (3, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Defaults to none.

Set to true, false or none.

Returns true, false or none.

TaleaRhythmMaker.split_divisions_by_counts

Gets secondary divisions.

Secondary divisions impose a cyclic split operation on divisions.

Here’s a talea equal to two thirty-second notes repeating indefinitely. Output equals four divisions of 12 thirty-second notes each:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     talea=rhythmmakertools.Talea(
...         counts=[2],
...         denominator=32,
...         ),
...     )
>>> divisions = [(3, 8), (3, 8), (3, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Here’s the same talea with secondary divisions set to split the divisions every 17 thirty-second notes. The rhythm_maker makes six divisions with durations equal, respectively, to 12, 5, 7, 10, 2 and 12 thirty-second notes.

Note that 12 + 5 = 17 and 7 + 10 = 17:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     talea=rhythmmakertools.Talea(
...         counts=[2],
...         denominator=32,
...         ),
...     split_divisions_by_counts=[17],
...     )
>>> divisions = [(3, 8), (3, 8), (3, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Additional divisions created when using split_divisions_by_counts are subject to extra_counts_per_division just like other divisions.

This example adds one extra thirty-second note to every other division. The durations of the divisions remain the same as in the previous example. But now every other division is tupletted:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     talea=rhythmmakertools.Talea(
...         counts=[2],
...         denominator=32,
...         ),
...     split_divisions_by_counts=[17],
...     extra_counts_per_division=[0, 1],
...     )
>>> divisions = [(3, 8), (3, 8), (3, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Set to tuple of positive integers or none.

Returns tuple of positive integers or none.

TaleaRhythmMaker.talea

Gets talea.

No talea:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker()
>>> divisions = [(3, 8), (3, 8), (3, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Talea equal to durations 1/16, 2/16, 3/16, 4/16 repeating indefinitely:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     talea=rhythmmakertools.Talea(
...         counts=[1, 2, 3, 4],
...         denominator=16,
...         ),
...     )
>>> divisions = [(3, 8), (3, 8), (3, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Set to talea or none.

Returns talea or none.

TaleaRhythmMaker.tie_specifier

Gets tie specifier.

Does not tie across divisions:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     talea=rhythmmakertools.Talea(
...         counts=[5, 3, 3, 3],
...         denominator=16,
...         ),
...     )
>>> divisions = [(4, 8), (3, 8), (4, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Ties across divisions:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     talea=rhythmmakertools.Talea(
...         counts=[5, 3, 3, 3],
...         denominator=16,
...         ),
...     tie_specifier=rhythmmakertools.TieSpecifier(
...         tie_across_divisions=True,
...         ),
...     )
>>> divisions = [(4, 8), (3, 8), (4, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Patterns ties across divisions:

>>> pattern = patterntools.Pattern(
...     indices=[0],
...     period=2,
...     )
>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     talea=rhythmmakertools.Talea(
...         counts=[5, 3, 3, 3],
...         denominator=16,
...         ),
...     tie_specifier=rhythmmakertools.TieSpecifier(
...         tie_across_divisions=pattern,
...         ),
...     )
>>> divisions = [(4, 8), (3, 8), (4, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Uses Messiaen-style ties:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     talea=rhythmmakertools.Talea(
...         counts=[5, 3, 3, 3],
...         denominator=16,
...         ),
...     tie_specifier=rhythmmakertools.TieSpecifier(
...         tie_across_divisions=True,
...         use_messiaen_style_ties=True,
...         ),
...     )
>>> divisions = [(4, 8), (3, 8), (4, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Ties consecutive notes:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     talea=rhythmmakertools.Talea(
...         counts=[5, -3, 3, 3],
...         denominator=16,
...         ),
...     tie_specifier=rhythmmakertools.TieSpecifier(
...         tie_consecutive_notes=True,
...         ),
...     )
>>> divisions = [(4, 8), (3, 8), (4, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Set to tie specifier or none.

Returns tie specifier.

TaleaRhythmMaker.tie_split_notes

Is true when talea rhythm-maker should tie split notes. Otherwise false.

Todo

Add examples.

Set to true or false.

Returns true or false.

TaleaRhythmMaker.tuplet_spelling_specifier

Gets tuplet spelling specifier.

Redudant tuplets with no tuplet spelling specifier:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     extra_counts_per_division=[0, 4],
...     talea=rhythmmakertools.Talea(
...         counts=[3, 3, 6, 6],
...         denominator=16,
...         ),
...     )
>>> divisions = [(3, 8), (4, 8), (3, 8), (4, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Simplifies redundant tuplets:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     extra_counts_per_division=[0, 4],
...     talea=rhythmmakertools.Talea(
...         counts=[3, 3, 6, 6],
...         denominator=16,
...         ),
...     tuplet_spelling_specifier=rhythmmakertools.TupletSpellingSpecifier(
...         simplify_redundant_tuplets=True,
...         ),
...     )
>>> divisions = [(3, 8), (4, 8), (3, 8), (4, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Rest-filled tuplets with no tuplet spelling specifier:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     extra_counts_per_division=[1, 0],
...     talea=rhythmmakertools.Talea(
...         counts=[3, 3, -6, -6],
...         denominator=16,
...         ),
...     )
>>> divisions = [(3, 8), (4, 8), (3, 8), (4, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Rewrites rest-filled tuplets:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     extra_counts_per_division=[1, 0],
...     talea=rhythmmakertools.Talea(
...         counts=[3, 3, -6, -6],
...         denominator=16,
...         ),
...     tuplet_spelling_specifier=rhythmmakertools.TupletSpellingSpecifier(
...         rewrite_rest_filled_tuplets=True,
...         ),
...     )
>>> 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 tuplet spelling specifier or none.

Returns tuplet spelling specifier or none.

Special methods

TaleaRhythmMaker.__call__(divisions, rotation=None)

Calls talea rhythm-maker on divisions.

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     talea=rhythmmakertools.Talea(
...         counts=[1, 2, 3, 4],
...         denominator=16,
...         ),
...     )
>>> divisions = [(3, 8), (4, 8), (3, 8), (4, 8)]
>>> selections = rhythm_maker(divisions)
>>> for selection in selections:
...     selection
... 
Selection([Note("c'16"), Note("c'8"), Note("c'8.")])
Selection([Note("c'4"), Note("c'16"), Note("c'8"), Note("c'16")])
Selection([Note("c'8"), Note("c'4")])
Selection([Note("c'16"), Note("c'8"), Note("c'8."), Note("c'8")])

Todo

Add rotation examples.

Returns list of of selections.

(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.

TaleaRhythmMaker.__format__(format_specification='')

Formats talea rhythm-maker.

Set format_specification to ‘’ or ‘storage’.

Formats talea rhythm-maker:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     talea=rhythmmakertools.Talea(
...         counts=[1, 2, 3, 4],
...         denominator=16,
...         ),
...     )
>>> f(rhythm_maker)
rhythmmakertools.TaleaRhythmMaker(
    talea=rhythmmakertools.Talea(
        counts=[1, 2, 3, 4],
        denominator=16,
        ),
    )

Storage formats talea rhythm-maker:

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     talea=rhythmmakertools.Talea(
...         counts=[1, 2, 3, 4],
...         denominator=16,
...         ),
...     )
>>> f(rhythm_maker)
rhythmmakertools.TaleaRhythmMaker(
    talea=rhythmmakertools.Talea(
        counts=[1, 2, 3, 4],
        denominator=16,
        ),
    )

Returns string.

(AbjadValueObject).__hash__()

Hashes Abjad value object.

Returns integer.

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

Illustrates talea rhythm-maker.

>>> rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
...     talea=rhythmmakertools.Talea(
...         counts=[1, 2, 3, 4],
...         denominator=16,
...         ),
...     )
>>> show(rhythm_maker) 

Defaults divisions to 3/8, 4/8, 3/16, 4/16.

Returns LilyPond file.

(AbjadObject).__ne__(argument)

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

Returns true or false.

TaleaRhythmMaker.__repr__()

Gets interpreter representation.

>>> rhythmmakertools.TaleaRhythmMaker(
...     talea=rhythmmakertools.Talea(
...         counts=[1, 2, 3, 4],
...         denominator=16,
...         ),
...     )
TaleaRhythmMaker(talea=Talea(counts=[1, 2, 3, 4], denominator=16))

Returns string.