AccelerandoRhythmMaker

class rhythmmakertools.AccelerandoRhythmMaker(beam_specifier=None, logical_tie_masks=None, division_masks=None, duration_spelling_specifier=None, interpolation_specifiers=None, tie_specifier=None, tuplet_spelling_specifier=None)

Accelerando rhythm-maker.

Example 1. Makes accelerando for each input division:

>>> rhythm_maker = rhythmmakertools.AccelerandoRhythmMaker(
...     beam_specifier=rhythmmakertools.BeamSpecifier(
...         use_feather_beams=True,
...         ),
...     interpolation_specifiers=rhythmmakertools.InterpolationSpecifier(
...         start_duration=Duration(1, 8),
...         stop_duration=Duration(1, 20),
...         written_duration=Duration(1, 16),
...         ),
...     tuplet_spelling_specifier=rhythmmakertools.TupletSpellingSpecifier(
...         use_note_duration_bracket=True,
...         ),
...     )
>>> divisions = [(5, 8), (3, 8), (5, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Example 2. Makes ritardando for each input division:

>>> rhythm_maker = rhythmmakertools.AccelerandoRhythmMaker(
...     beam_specifier=rhythmmakertools.BeamSpecifier(
...         use_feather_beams=True,
...         ),
...     interpolation_specifiers=rhythmmakertools.InterpolationSpecifier(
...         start_duration=Duration(1, 20),
...         stop_duration=Duration(1, 8),
...         written_duration=Duration(1, 16),
...         ),
...     tuplet_spelling_specifier=rhythmmakertools.TupletSpellingSpecifier(
...         use_note_duration_bracket=True,
...         ),
...     )
>>> divisions = [(5, 8), (3, 8), (5, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Set written_duration to 1/16 or less for multiple beams.

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.AccelerandoRhythmMaker.AccelerandoRhythmMaker" [color=black, fontcolor=white, group=2, label=<<B>AccelerandoRhythmMaker</B>>, shape=box, style="filled, rounded"]; "abjad.tools.rhythmmakertools.RhythmMaker.RhythmMaker" [color=3, group=2, label=RhythmMaker, shape=box]; "abjad.tools.rhythmmakertools.RhythmMaker.RhythmMaker" -> "abjad.tools.rhythmmakertools.AccelerandoRhythmMaker.AccelerandoRhythmMaker"; } 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.
interpolation_specifiers Gets interpolation specifier.
logical_tie_masks Gets logical tie masks.
tie_specifier Gets tie specifier.
tuplet_spelling_specifier Gets tuplet spelling specifier.
__call__(divisions[, rotation]) Calls interpolated 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 Abjad object.
__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

AccelerandoRhythmMaker.beam_specifier

Gets beam specifier.

Example 1. Feather beams each division:

>>> rhythm_maker = rhythmmakertools.AccelerandoRhythmMaker(
...     beam_specifier=rhythmmakertools.BeamSpecifier(
...         beam_each_division=True,
...         use_feather_beams=True,
...         ),
...     interpolation_specifiers=rhythmmakertools.InterpolationSpecifier(
...         start_duration=Duration(1, 8),
...         stop_duration=Duration(1, 20),
...         written_duration=Duration(1, 16),
...         ),
...     tuplet_spelling_specifier=rhythmmakertools.TupletSpellingSpecifier(
...         use_note_duration_bracket=True,
...         ),
...     )
>>> divisions = [(5, 8), (3, 8), (5, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Example 2. Beams divisions together (without feathering):

>>> rhythm_maker = rhythmmakertools.AccelerandoRhythmMaker(
...     beam_specifier=rhythmmakertools.BeamSpecifier(
...         beam_divisions_together=True,
...         use_feather_beams=False,
...         ),
...     interpolation_specifiers=rhythmmakertools.InterpolationSpecifier(
...         start_duration=Duration(1, 8),
...         stop_duration=Duration(1, 20),
...         written_duration=Duration(1, 16),
...         ),
...     tuplet_spelling_specifier=rhythmmakertools.TupletSpellingSpecifier(
...         use_note_duration_bracket=True,
...         ),
...     )
>>> divisions = [(5, 8), (3, 8), (5, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

It is important to leave feathering turned off here because LilyPond feathers conjoint beams poorly.

Example 3. Makes no beams:

>>> rhythm_maker = rhythmmakertools.AccelerandoRhythmMaker(
...     beam_specifier=rhythmmakertools.BeamSpecifier(
...         beam_divisions_together=False,
...         beam_each_division=False,
...         ),
...     interpolation_specifiers=rhythmmakertools.InterpolationSpecifier(
...         start_duration=Duration(1, 8),
...         stop_duration=Duration(1, 20),
...         written_duration=Duration(1, 16),
...         ),
...     tuplet_spelling_specifier=rhythmmakertools.TupletSpellingSpecifier(
...         use_note_duration_bracket=True,
...         ),
...     )
>>> divisions = [(5, 8), (3, 8), (5, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Returns beam specifier.

AccelerandoRhythmMaker.division_masks

Gets division masks.

Example 1. No division masks:

>>> rhythm_maker = rhythmmakertools.AccelerandoRhythmMaker(
...     beam_specifier=rhythmmakertools.BeamSpecifier(
...         use_feather_beams=True,
...         ),
...     interpolation_specifiers=rhythmmakertools.InterpolationSpecifier(
...         start_duration=Duration(1, 8),
...         stop_duration=Duration(1, 20),
...         written_duration=Duration(1, 16),
...         ),
...     division_masks=None,
...     tuplet_spelling_specifier=rhythmmakertools.TupletSpellingSpecifier(
...         use_note_duration_bracket=True,
...         ),
...     )
>>> divisions = [(5, 8), (3, 8), (5, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Example 2. Silences every other division:

>>> rhythm_maker = rhythmmakertools.AccelerandoRhythmMaker(
...     beam_specifier=rhythmmakertools.BeamSpecifier(
...         use_feather_beams=True,
...         ),
...     interpolation_specifiers=rhythmmakertools.InterpolationSpecifier(
...         start_duration=Duration(1, 8),
...         stop_duration=Duration(1, 20),
...         written_duration=Duration(1, 16),
...         ),
...     division_masks=[
...         rhythmmakertools.SilenceMask(
...             pattern=patterntools.select_every([1], period=2),
...             ),
...         ],
...     tuplet_spelling_specifier=rhythmmakertools.TupletSpellingSpecifier(
...         use_note_duration_bracket=True,
...         ),
...     )
>>> divisions = [(5, 8), (3, 8), (5, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 
(RhythmMaker).duration_spelling_specifier

Gets duration spelling specifier.

Set to duration spelling specifier or none.

AccelerandoRhythmMaker.interpolation_specifiers

Gets interpolation specifier.

Example 1. Makes accelerando for each input division:

>>> rhythm_maker = rhythmmakertools.AccelerandoRhythmMaker(
...     beam_specifier=rhythmmakertools.BeamSpecifier(
...         use_feather_beams=True,
...         ),
...     interpolation_specifiers=rhythmmakertools.InterpolationSpecifier(
...         start_duration=Duration(1, 8),
...         stop_duration=Duration(1, 20),
...         written_duration=Duration(1, 16),
...         ),
...     tuplet_spelling_specifier=rhythmmakertools.TupletSpellingSpecifier(
...         use_note_duration_bracket=True,
...         ),
...     )
>>> divisions = [(5, 8), (3, 8), (5, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Example 2. Makes accelerandi and ritardandi on alternate divisions:

>>> rhythm_maker = rhythmmakertools.AccelerandoRhythmMaker(
...     beam_specifier=rhythmmakertools.BeamSpecifier(
...         use_feather_beams=True,
...         ),
...     interpolation_specifiers=[
...         rhythmmakertools.InterpolationSpecifier(
...             start_duration=Duration(1, 8),
...             stop_duration=Duration(1, 20),
...             written_duration=Duration(1, 16),
...             ),
...         rhythmmakertools.InterpolationSpecifier(
...             start_duration=Duration(1, 20),
...             stop_duration=Duration(1, 8),
...             written_duration=Duration(1, 16),
...             ),
...         ],
...     tuplet_spelling_specifier=rhythmmakertools.TupletSpellingSpecifier(
...         use_note_duration_bracket=True,
...         ),
...     )
>>> divisions = [(5, 8), (3, 8), (5, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Example 3. Makes a single note in the case that interpolation would take too long for a given division:

>>> rhythm_maker = rhythmmakertools.AccelerandoRhythmMaker(
...     beam_specifier=rhythmmakertools.BeamSpecifier(
...         use_feather_beams=True,
...         ),
...     interpolation_specifiers=rhythmmakertools.InterpolationSpecifier(
...         start_duration=Duration(1, 8),
...         stop_duration=Duration(1, 20),
...         written_duration=Duration(1, 16),
...         ),
...     tuplet_spelling_specifier=rhythmmakertools.TupletSpellingSpecifier(
...         use_note_duration_bracket=True,
...         ),
...     )
>>> divisions = [(5, 8), (3, 8), (1, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Defaults to none.

Set to interpolation specifier or none.

Returns interpolation specifier or none.

AccelerandoRhythmMaker.logical_tie_masks

Gets logical tie masks.

Example 1. Silences first and last logical tie:

>>> rhythm_maker = rhythmmakertools.AccelerandoRhythmMaker(
...     beam_specifier=rhythmmakertools.BeamSpecifier(
...         beam_each_division=True,
...         beam_rests=True,
...         stemlet_length=0.75,
...         use_feather_beams=True,
...         ),
...     logical_tie_masks=[
...         rhythmmakertools.silence_first(),
...         rhythmmakertools.silence_last(),
...         ],
...     interpolation_specifiers=[
...         rhythmmakertools.InterpolationSpecifier(
...             start_duration=Duration(1, 8),
...             stop_duration=Duration(1, 20),
...             written_duration=Duration(1, 16),
...             ),
...         rhythmmakertools.InterpolationSpecifier(
...             start_duration=Duration(1, 20),
...             stop_duration=Duration(1, 8),
...             written_duration=Duration(1, 16),
...             ),
...         ],
...     tuplet_spelling_specifier=rhythmmakertools.TupletSpellingSpecifier(
...         use_note_duration_bracket=True,
...         ),
...     )
>>> divisions = [(5, 8), (3, 8), (5, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Example 2. Silences every third logical tie:

>>> rhythm_maker = rhythmmakertools.AccelerandoRhythmMaker(
...     beam_specifier=rhythmmakertools.BeamSpecifier(
...         beam_each_division=True,
...         beam_rests=True,
...         stemlet_length=0.75,
...         use_feather_beams=True,
...         ),
...     logical_tie_masks=[
...         rhythmmakertools.silence_every([2], period=3),
...         ],
...     interpolation_specifiers=[
...         rhythmmakertools.InterpolationSpecifier(
...             start_duration=Duration(1, 8),
...             stop_duration=Duration(1, 20),
...             written_duration=Duration(1, 16),
...             ),
...         rhythmmakertools.InterpolationSpecifier(
...             start_duration=Duration(1, 20),
...             stop_duration=Duration(1, 8),
...             written_duration=Duration(1, 16),
...             ),
...         ],
...     tuplet_spelling_specifier=rhythmmakertools.TupletSpellingSpecifier(
...         use_note_duration_bracket=True,
...         ),
...     )
>>> divisions = [(5, 8), (3, 8), (5, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Defaults to none.

Set to patterns or none.

Returns patterns or none.

AccelerandoRhythmMaker.tie_specifier

Gets tie specifier.

Example 1. Does not tie across divisions:

>>> rhythm_maker = rhythmmakertools.AccelerandoRhythmMaker(
...     beam_specifier=rhythmmakertools.BeamSpecifier(
...         use_feather_beams=True,
...         ),
...     interpolation_specifiers=rhythmmakertools.InterpolationSpecifier(
...         start_duration=Duration(1, 8),
...         stop_duration=Duration(1, 20),
...         written_duration=Duration(1, 16),
...         ),
...     tie_specifier=rhythmmakertools.TieSpecifier(
...         tie_across_divisions=False,
...         ),
...     tuplet_spelling_specifier=rhythmmakertools.TupletSpellingSpecifier(
...         use_note_duration_bracket=True,
...         ),
...     )
>>> divisions = [(5, 8), (3, 8), (5, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Example 2. Ties across divisions:

>>> rhythm_maker = rhythmmakertools.AccelerandoRhythmMaker(
...     beam_specifier=rhythmmakertools.BeamSpecifier(
...         use_feather_beams=True,
...         ),
...     interpolation_specifiers=rhythmmakertools.InterpolationSpecifier(
...         start_duration=Duration(1, 8),
...         stop_duration=Duration(1, 20),
...         written_duration=Duration(1, 16),
...         ),
...     tie_specifier=rhythmmakertools.TieSpecifier(
...         tie_across_divisions=True,
...         ),
...     tuplet_spelling_specifier=rhythmmakertools.TupletSpellingSpecifier(
...         use_note_duration_bracket=True,
...         ),
...     )
>>> divisions = [(5, 8), (3, 8), (5, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Example 3. Patterns ties across divisions:

>>> pattern = patterntools.Pattern(
...      indices=[0],
...      period=2,
...  )
>>> rhythm_maker = rhythmmakertools.AccelerandoRhythmMaker(
...     beam_specifier=rhythmmakertools.BeamSpecifier(
...         use_feather_beams=True,
...         ),
...     interpolation_specifiers=rhythmmakertools.InterpolationSpecifier(
...         start_duration=Duration(1, 8),
...         stop_duration=Duration(1, 20),
...         written_duration=Duration(1, 16),
...         ),
...     tie_specifier=rhythmmakertools.TieSpecifier(
...         tie_across_divisions=pattern,
...         ),
...     tuplet_spelling_specifier=rhythmmakertools.TupletSpellingSpecifier(
...         use_note_duration_bracket=True,
...         ),
...     )
>>> divisions = [(5, 8), (3, 8), (5, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Returns tie specifier.

AccelerandoRhythmMaker.tuplet_spelling_specifier

Gets tuplet spelling specifier.

Example 1. Tuplets use note duration bracket:

>>> rhythm_maker = rhythmmakertools.AccelerandoRhythmMaker(
...     beam_specifier=rhythmmakertools.BeamSpecifier(
...         use_feather_beams=True,
...         ),
...     interpolation_specifiers=rhythmmakertools.InterpolationSpecifier(
...         start_duration=Duration(1, 8),
...         stop_duration=Duration(1, 20),
...         written_duration=Duration(1, 16),
...         ),
...     tie_specifier=rhythmmakertools.TieSpecifier(
...         tie_across_divisions=False,
...         ),
...     tuplet_spelling_specifier=rhythmmakertools.TupletSpellingSpecifier(
...         use_note_duration_bracket=True,
...         ),
...     )
>>> divisions = [(5, 8), (3, 8), (5, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Example 2. Tuplets do not use note duration bracket:

>>> rhythm_maker = rhythmmakertools.AccelerandoRhythmMaker(
...     beam_specifier=rhythmmakertools.BeamSpecifier(
...         use_feather_beams=True,
...         ),
...     interpolation_specifiers=rhythmmakertools.InterpolationSpecifier(
...         start_duration=Duration(1, 8),
...         stop_duration=Duration(1, 20),
...         written_duration=Duration(1, 16),
...         ),
...     tie_specifier=rhythmmakertools.TieSpecifier(
...         tie_across_divisions=False,
...         ),
...     tuplet_spelling_specifier=rhythmmakertools.TupletSpellingSpecifier(
...         use_note_duration_bracket=False,
...         ),
...     )
>>> divisions = [(5, 8), (3, 8), (5, 8), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Returns tuplet spelling specifier or none.

Special methods

AccelerandoRhythmMaker.__call__(divisions, rotation=None)

Calls interpolated rhythm-maker on divisions.

Ignores rotation.

Returns list of selections.

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

(AbjadObject).__format__(format_specification='')

Formats Abjad object.

Set format_specification to ‘’ or ‘storage’. Interprets ‘’ equal to ‘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.