functions

The rmakers functions.


Functions

after_grace_container

Makes (and attaches) after-grace containers.

attach_time_signatures

rtype:

None

beam

Beams runs of notes in each component in argument.

beam_groups

Beams groups in argument with single span beam.

before_grace_container

Makes (and attaches) before-grace containers.

denominator

Sets tuplet ratio denominator of tuplets in argument.

duration_bracket

Applies duration bracket to tuplets in argument.

example

Makes example LilyPond file.

extract_rest_filled

Extracts rest-filled tuplets from argument.

extract_trivial

Extracts trivial tuplets from argument.

feather_beam

Feather-beams leaves in argument.

force_augmentation

Spells tuplets in argument as augmentations.

force_diminution

Spells tuplets in argument as diminutions.

force_fraction

Sets force_fraction=True on tuplets in argument.

force_note

Replaces leaves in argument with notes.

force_repeat_tie

Replaces ties in argument with repeat-ties.

force_rest

Replaces leaves in argument with rests.

hide_skip_filled

Hides skip-filled tuplets in argument.

hide_trivial

Hides trivial tuplets in argument.

interpolate

Makes interpolation.

invisible_music

Makes argument invisible.

nongrace_leaves_in_each_tuplet

Selects nongrace leaves in each tuplet.

on_beat_grace_container

Makes on-beat grace containers.

reduce_multiplier

Reduces multipliers of tuplets in argument.

repeat_tie

Attaches repeat-ties to leaves in argument.

rewrite_dots

Rewrites dots of tuplets in argument.

rewrite_meter

Rewrites meter of components in voice.

rewrite_rest_filled

Rewrites rest-filled tuplets in argument.

rewrite_sustained

Rewrites sustained tuplets in argument.

split_measures

Splits measures in voice.

swap_length_1

Swaps length-1 tuplets in argument with containers.

swap_skip_filled

Swaps skip-filled tuplets in argument with containers.

swap_trivial

Swaps trivial tuplets in argument with containers.

tie

Attaches ties to notes in argument.

time_signatures

Makes time signatures from pairs.

tremolo_container

Replaces notes in argument with tremolo containers.

trivialize

Trivializes tuplets in argument.

unbeam

Unbeams leaves in argument.

untie

Unties leaves in argument.

wrap_in_time_signature_staff

Wraps components in two-voice staff.

written_duration

Sets written duration of leaves in argument.

abjadext.rmakers.functions.after_grace_container(argument, counts, *, beam=False, slash=False, talea=Talea(counts=[1], denominator=8, end_counts=(), preamble=()))[source]

Makes (and attaches) after-grace containers.

>>> def make_lilypond_file(pairs, *, beam=False, slash=False):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.even_division(durations, [4], extra_counts=[2])
...     lilypond_file = rmakers.example(tuplets, time_signatures)
...     voice = lilypond_file["Voice"]
...     notes = [abjad.select.note(_, -1) for _ in tuplets]
...     rmakers.after_grace_container(notes, [1, 4], beam=beam, slash=slash)
...     rmakers.extract_trivial(voice)
...     score = lilypond_file["Score"]
...     abjad.setting(score).autoBeaming = False
...     return lilypond_file
... 

With beam=False and slash=False:

>>> pairs = [(3, 4), (3, 4)]
>>> lilypond_file = make_lilypond_file(pairs, beam=False, slash=False)
>>> abjad.show(lilypond_file)  

With beam=True and slash=True:

>>> pairs = [(3, 4), (3, 4)]
>>> lilypond_file = make_lilypond_file(pairs, beam=True, slash=True)
>>> score = lilypond_file["Score"]
>>> abjad.setting(score).autoBeaming = False
>>> abjad.show(lilypond_file)  

When slash=True then beam must also be true.

Leaves lone after-graces unslashed even when slash=True.

Return type:

None

abjadext.rmakers.functions.attach_time_signatures(voice, time_signatures)[source]
Return type:

None

abjadext.rmakers.functions.beam(argument, *, beam_lone_notes=False, beam_rests=False, stemlet_length=None, tag=None)[source]

Beams runs of notes in each component in argument.

>>> def make_lilypond_file(pairs, beam_rests=False, stemlet_length=None):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.talea(durations, [1, 1, 1, -1], 16)
...     lilypond_file = rmakers.example(tuplets, time_signatures)
...     voice = lilypond_file["Voice"]
...     rmakers.beam(voice, beam_rests=beam_rests, stemlet_length=stemlet_length)
...     rmakers.swap_trivial(voice)
...     score = lilypond_file["Score"]
...     abjad.setting(score).autoBeaming = False
...     return lilypond_file
... 

Beams runs of notes in each tuplet:

>>> pairs = [(3, 8), (4, 8), (3, 8), (4, 8)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> abjad.show(lilypond_file)  

Set beam_rests=True and stemlet_length=n to beam rests with stemlets of length n:

>>> pairs = [(3, 8), (4, 8), (3, 8), (4, 8)]
>>> lilypond_file = make_lilypond_file(pairs, beam_rests=True, stemlet_length=0.75)
>>> abjad.show(lilypond_file)  
Return type:

None

abjadext.rmakers.functions.beam_groups(argument, *, beam_lone_notes=False, beam_rests=False, stemlet_length=None, tag=None)[source]

Beams groups in argument with single span beam.

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.talea(durations, [1], 16)
...     lilypond_file = rmakers.example(tuplets, time_signatures)
...     voice = lilypond_file["Voice"]
...     rmakers.beam_groups(tuplets)
...     rmakers.swap_trivial(voice)
...     return lilypond_file
... 
>>> pairs = [(3, 8), (4, 8), (3, 8), (4, 8)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> abjad.show(lilypond_file)  
Return type:

None

abjadext.rmakers.functions.before_grace_container(argument, counts, *, beam=False, slash=False, slur=False, talea=Talea(counts=[1], denominator=8, end_counts=(), preamble=()))[source]

Makes (and attaches) before-grace containers.

With beam=False, slash=False, slur=False (default):

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.even_division(durations, [4], extra_counts=[2])
...     container = abjad.Container(tuplets)
...     tuplets = abjad.select.tuplets(container)
...     notes = [abjad.select.notes(_) for _ in tuplets]
...     notes = [abjad.select.exclude(_, [0, -1]) for _ in notes]
...     rmakers.before_grace_container(notes, [1, 2, 3])
...     rmakers.extract_trivial(container)
...     components = abjad.mutate.eject_contents(container)
...     lilypond_file = rmakers.example(components, time_signatures)
...     return lilypond_file
... 
>>> pairs = [(3, 4)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> score = lilypond_file["Score"]
>>> abjad.setting(score).autoBeaming = False
>>> abjad.show(lilypond_file)  

With beam=False, slash=False, slur=True:

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.even_division(durations, [4], extra_counts=[2])
...     container = abjad.Container(tuplets)
...     tuplets = abjad.select.tuplets(container)
...     notes = [abjad.select.notes(_) for _ in tuplets]
...     notes = [abjad.select.exclude(_, [0, -1]) for _ in notes]
...     rmakers.before_grace_container(notes, [1, 2, 3], slur=True)
...     rmakers.extract_trivial(container)
...     components = abjad.mutate.eject_contents(container)
...     lilypond_file = rmakers.example(components, time_signatures)
...     return lilypond_file
... 
>>> pairs = [(3, 4)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> score = lilypond_file["Score"]
>>> abjad.setting(score).autoBeaming = False
>>> abjad.show(lilypond_file)  

With beam=True, slash=False, slur=False:

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.even_division(durations, [4], extra_counts=[2])
...     lilypond_file = rmakers.example(tuplets, time_signatures)
...     voice = lilypond_file["Voice"]
...     notes = [abjad.select.notes(_) for _ in tuplets]
...     notes = [abjad.select.exclude(_, [0, -1]) for _ in notes]
...     rmakers.before_grace_container(notes, [1, 2, 3], beam=True)
...     rmakers.extract_trivial(voice)
...     return lilypond_file
... 
>>> pairs = [(3, 4)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> score = lilypond_file["Score"]
>>> abjad.setting(score).autoBeaming = False
>>> abjad.show(lilypond_file)  

With beam=True, slash=False, slur=True:

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.even_division(durations, [4], extra_counts=[2])
...     lilypond_file = rmakers.example(tuplets, time_signatures)
...     voice = lilypond_file["Voice"]
...     notes = [abjad.select.notes(_) for _ in tuplets]
...     notes = [abjad.select.exclude(_, [0, -1]) for _ in notes]
...     rmakers.before_grace_container(notes, [1, 2, 3], beam=True, slur=True)
...     rmakers.extract_trivial(voice)
...     return lilypond_file
... 
>>> pairs = [(3, 4)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> score = lilypond_file["Score"]
>>> abjad.setting(score).autoBeaming = False
>>> abjad.show(lilypond_file)  

With beam=True, slash=True, slur=False:

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.even_division(durations, [4], extra_counts=[2])
...     lilypond_file = rmakers.example(tuplets, time_signatures)
...     voice = lilypond_file["Voice"]
...     notes = [abjad.select.notes(_) for _ in tuplets]
...     notes = [abjad.select.exclude(_, [0, -1]) for _ in notes]
...     rmakers.before_grace_container(notes, [1, 2, 3], beam=True, slash=True)
...     rmakers.extract_trivial(voice)
...     return lilypond_file
... 
>>> pairs = [(3, 4)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> score = lilypond_file["Score"]
>>> abjad.setting(score).autoBeaming = False
>>> abjad.show(lilypond_file)  

(When slash=True then beam must also be true.)

With beam=True, slash=True, slur=True:

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.even_division(durations, [4], extra_counts=[2])
...     lilypond_file = rmakers.example(tuplets, time_signatures)
...     voice = lilypond_file["Voice"]
...     notes = [abjad.select.notes(_) for _ in tuplets]
...     notes = [abjad.select.exclude(_, [0, -1]) for _ in notes]
...     rmakers.before_grace_container(
...         notes, [1, 2, 3], beam=True, slash=True, slur=True
...     )
...     rmakers.extract_trivial(voice)
...     return lilypond_file
... 
>>> pairs = [(3, 4)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> score = lilypond_file["Score"]
>>> abjad.setting(score).autoBeaming = False
>>> abjad.show(lilypond_file)  

(When slash=True then beam must also be true.)

Return type:

None

abjadext.rmakers.functions.denominator(argument, denominator)[source]

Sets tuplet ratio denominator of tuplets in argument.

>>> def make_lilypond_file(pairs, denominator=None):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.tuplet(durations, [(1, 4)])
...     lilypond_file = rmakers.example(tuplets, time_signatures)
...     voice = lilypond_file["Voice"]
...     rmakers.rewrite_dots(voice)
...     rmakers.beam(voice)
...     rmakers.force_fraction(voice)
...     if denominator is not None:
...         rmakers.denominator(voice, denominator)
...     score = lilypond_file["Score"]
...     abjad.override(score).TupletBracket.bracket_visibility = True
...     abjad.override(score).TupletBracket.staff_padding = 4.5
...     abjad.setting(score).tupletFullLength = True
...     return lilypond_file
... 

By default, tuplet numerators and denominators are reduced to numbers that are relatively prime. This means that ratios like 6:4 and 10:8 do not arise:

>>> pairs = [(2, 16), (4, 16), (6, 16), (8, 16)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> abjad.show(lilypond_file)  

Spelling tuplet ratios in terms of a given duration.

16th notes. This attempts to set the denominator of each tuplet ratio in terms of sixteenth notes. Because the first tuplet is so short, its ratio must be read as “5 in the time of 4 thirty-second notes.” But the ratios of the three longer tuplets can now be read as “x in the time of y sixteenth notes”:

>>> pairs = [(2, 16), (4, 16), (6, 16), (8, 16)]
>>> lilypond_file = make_lilypond_file(pairs, denominator=(1, 16))
>>> abjad.show(lilypond_file)  

32nd notes. This sets the denominator of each tuplet ratios in terms of thirty-second notes. All tuplet ratios can now be read as “x in the time of y thirty-second notes”:

>>> pairs = [(2, 16), (4, 16), (6, 16), (8, 16)]
>>> lilypond_file = make_lilypond_file(pairs, denominator=(1, 32))
>>> abjad.show(lilypond_file)  

64th notes. This sets the denominator of each tuplet ratios in terms of sixth-fourth notes. All tuplet ratios can now be read as “x in the time of y sixty-fourth notes”:

>>> pairs = [(2, 16), (4, 16), (6, 16), (8, 16)]
>>> lilypond_file = make_lilypond_file(pairs, (1, 64))
>>> abjad.show(lilypond_file)  

Spelling tuplet ratios with a fixed denominator.

Tuplet ratios spelled with denominator equal to 8. The ratio of the third tuplet is left unchanged. But the ratios of the other tuplets can be spelled “x in the time of 8”:

>>> pairs = [(2, 16), (4, 16), (6, 16), (8, 16)]
>>> lilypond_file = make_lilypond_file(pairs, 8)
>>> abjad.show(lilypond_file)  

Tuplet ratios spelled with denominator equal to 12. The ratios of all tuplets can be spelled “x in the time of 12”:

>>> pairs = [(2, 16), (4, 16), (6, 16), (8, 16)]
>>> lilypond_file = make_lilypond_file(pairs, 12)
>>> abjad.show(lilypond_file)  

Tuplet ratios spelled with denominator equal to 13. No tuplet ratio can be spelled “x in the time of 13”:

>>> pairs = [(2, 16), (4, 16), (6, 16), (8, 16)]
>>> lilypond_file = make_lilypond_file(pairs, 13)
>>> abjad.show(lilypond_file)  
Return type:

None

abjadext.rmakers.functions.duration_bracket(argument)[source]

Applies duration bracket to tuplets in argument.

Return type:

None

abjadext.rmakers.functions.example(components, time_signatures, *, includes=())[source]

Makes example LilyPond file.

Function is a documentation helper.

Return type:

LilyPondFile

abjadext.rmakers.functions.extract_rest_filled(argument)[source]

Extracts rest-filled tuplets from argument.

Return type:

None

abjadext.rmakers.functions.extract_trivial(argument)[source]

Extracts trivial tuplets from argument.

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.even_division(durations, [8])
...     lilypond_file = rmakers.example(tuplets, time_signatures)
...     voice = lilypond_file["Voice"]
...     rmakers.beam(voice)
...     tuplets = abjad.select.tuplets(voice)[-2:]
...     rmakers.extract_trivial(tuplets)
...     return lilypond_file
... 
>>> pairs = [(3, 8), (3, 8), (3, 8), (3, 8)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> abjad.show(lilypond_file)  
Return type:

None

abjadext.rmakers.functions.feather_beam(argument, *, beam_rests=False, stemlet_length=None, tag=None)[source]

Feather-beams leaves in argument.

Return type:

None

abjadext.rmakers.functions.force_augmentation(argument)[source]

Spells tuplets in argument as augmentations.

>>> def make_lilypond_file(pairs, force_augmentation=False):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.even_division(durations, [8], extra_counts=[1])
...     lilypond_file = rmakers.example(tuplets, time_signatures)
...     voice = lilypond_file["Voice"]
...     rmakers.force_fraction(voice)
...     rmakers.beam(voice)
...     if force_augmentation is True:
...         rmakers.force_augmentation(voice)
...     score = lilypond_file["Score"]
...     abjad.override(score).TupletBracket.bracket_visibility = True
...     abjad.override(score).TupletBracket.staff_padding = 4.5
...     abjad.setting(score).tupletFullLength = True
...     return lilypond_file
... 

Without forced augmentation:

>>> pairs = [(2, 8), (2, 8), (2, 8)]
>>> lilypond_file = make_lilypond_file(pairs, force_augmentation=False)
>>> abjad.show(lilypond_file)  

With forced augmentation:

>>> pairs = [(2, 8), (2, 8), (2, 8)]
>>> lilypond_file = make_lilypond_file(pairs, force_augmentation=True)
>>> abjad.show(lilypond_file)  
Return type:

None

abjadext.rmakers.functions.force_diminution(argument)[source]

Spells tuplets in argument as diminutions.

>>> def make_lilypond_file(pairs, force_diminution=False):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.talea(durations, [1], 16, extra_counts=[0, -1])
...     lilypond_file = rmakers.example(tuplets, time_signatures)
...     voice = lilypond_file["Voice"]
...     rmakers.force_fraction(voice)
...     rmakers.beam(voice)
...     rmakers.swap_trivial(voice)
...     if force_diminution is True:
...         rmakers.force_diminution(voice)
...     score = lilypond_file["Score"]
...     abjad.override(score).TupletBracket.bracket_visibility = True
...     abjad.override(score).TupletBracket.staff_padding = 4.5
...     abjad.setting(score).tupletFullLength = True
...     return lilypond_file
... 

Without forced diminution (default):

>>> pairs = [(1, 4), (1, 4), (1, 4), (1, 4)]
>>> lilypond_file = make_lilypond_file(pairs, force_diminution=False)
>>> abjad.show(lilypond_file)  

With forced diminution (default):

>>> pairs = [(1, 4), (1, 4), (1, 4), (1, 4)]
>>> lilypond_file = make_lilypond_file(pairs, force_diminution=True)
>>> abjad.show(lilypond_file)  
Return type:

None

abjadext.rmakers.functions.force_fraction(argument)[source]

Sets force_fraction=True on tuplets in argument.

Return type:

None

abjadext.rmakers.functions.force_note(argument, *, tag=None)[source]

Replaces leaves in argument with notes.

Changes logical ties 1 and 2 to notes:

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     nested_music = rmakers.note(durations)
...     components = abjad.sequence.flatten(nested_music)
...     container = abjad.Container(components)
...     rmakers.force_rest(components)
...     logical_ties = abjad.select.logical_ties(container)[1:3]
...     rmakers.force_note(logical_ties)
...     components = abjad.mutate.eject_contents(container)
...     lilypond_file = rmakers.example(components, time_signatures)
...     return lilypond_file
... 
>>> pairs = [(7, 16), (3, 8), (7, 16), (3, 8)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> abjad.show(lilypond_file)  

Changes leaves to notes with inverted composite pattern:

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     nested_music = rmakers.note(durations)
...     components = abjad.sequence.flatten(nested_music)
...     container = abjad.Container(components)
...     leaves = abjad.select.leaves(container)
...     rmakers.force_rest(leaves)
...     logical_ties = abjad.select.logical_ties(container)
...     leaves = abjad.select.get(logical_ties, [0, -1])
...     rmakers.force_note(leaves)
...     components = abjad.mutate.eject_contents(container)
...     lilypond_file = rmakers.example(components, time_signatures)
...     return lilypond_file
... 
>>> pairs = [(7, 16), (3, 8), (7, 16), (3, 8)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> abjad.show(lilypond_file)  
Return type:

None

abjadext.rmakers.functions.force_repeat_tie(argument, *, tag=None, threshold=True)[source]

Replaces ties in argument with repeat-ties.

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.even_division(durations, [8], extra_counts=[1])
...     lilypond_file = rmakers.example(tuplets, time_signatures)
...     voice = lilypond_file["Voice"]
...     tuplets = abjad.select.tuplets(voice)[:-1]
...     notes = [abjad.select.note(_, -1) for _ in tuplets]
...     rmakers.tie(notes)
...     rmakers.beam(voice)
...     return lilypond_file
... 

Attaches tie to last note in each nonlast tuplet:

>>> pairs = [(2, 8), (2, 8), (2, 8), (2, 8)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> abjad.show(lilypond_file)  

Changes ties to repeat-ties:

>>> rmakers.force_repeat_tie(lilypond_file["Score"])
>>> abjad.show(lilypond_file)  
Return type:

None

abjadext.rmakers.functions.force_rest(argument, *, tag=None)[source]

Replaces leaves in argument with rests.

Forces first and last logical ties to rest:

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.talea(durations, [1, 2, 3, 4], 16)
...     lilypond_file = rmakers.example(tuplets, time_signatures)
...     voice = lilypond_file["Voice"]
...     logical_ties = abjad.select.logical_ties(voice)
...     logical_ties = abjad.select.get(logical_ties, [0, -1])
...     rmakers.force_rest(logical_ties)
...     rmakers.beam(voice)
...     rmakers.attach_time_signatures(voice, time_signatures)
...     rmakers.extract_trivial(voice)
...     return lilypond_file
... 
>>> pairs = [(3, 8), (4, 8), (3, 8), (4, 8)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> abjad.show(lilypond_file)  

Forces all logical ties to rest. Then sustains first and last logical ties:

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.talea(durations, [1, 2, 3, 4], 16)
...     container = abjad.Container(tuplets)
...     logical_ties = abjad.select.logical_ties(container)
...     rmakers.force_rest(logical_ties)
...     logical_ties = abjad.select.logical_ties(container)
...     logical_ties = abjad.select.get(logical_ties, [0, -1])
...     rmakers.force_note(logical_ties)
...     rmakers.beam(container)
...     rmakers.extract_trivial(container)
...     components = abjad.mutate.eject_contents(container)
...     lilypond_file = rmakers.example(components, time_signatures)
...     return lilypond_file
... 
>>> pairs = [(3, 8), (4, 8), (3, 8), (4, 8)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> abjad.show(lilypond_file)  

Forces every other tuplet to rest:

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.talea(durations, [1, 2, 3, 4], 16)
...     lilypond_file = rmakers.example(tuplets, time_signatures)
...     voice = lilypond_file["Voice"]
...     tuplets = abjad.select.get(tuplets, [1], 2)
...     rmakers.force_rest(tuplets)
...     rmakers.beam(voice)
...     rmakers.rewrite_rest_filled(voice)
...     rmakers.extract_trivial(voice)
...     rmakers.attach_time_signatures(voice, time_signatures)
...     return lilypond_file
... 
>>> pairs = [(3, 8), (4, 8), (3, 8), (4, 8)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> abjad.show(lilypond_file)  

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

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.talea(durations, [1, 2, 3, 4], 16)
...     lilypond_file = rmakers.example(tuplets, time_signatures)
...     voice = lilypond_file["Voice"]
...     leaves = abjad.select.leaves(voice)
...     leaves = abjad.select.get(leaves, [0, -2, -1])
...     rmakers.force_rest(leaves)
...     rmakers.beam(voice)
...     rmakers.extract_trivial(voice)
...     rmakers.attach_time_signatures(voice, time_signatures)
...     return lilypond_file
... 
>>> pairs = [(3, 8), (4, 8), (3, 8), (4, 8)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> abjad.show(lilypond_file)  

Forces first leaf of every tuplet to rest:

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.talea(durations, [1, 2, 3, 4], 16)
...     lilypond_file = rmakers.example(tuplets, time_signatures)
...     voice = lilypond_file["Voice"]
...     leaves = [abjad.select.leaf(_, 0) for _ in tuplets]
...     rmakers.force_rest(leaves)
...     rmakers.beam(voice)
...     rmakers.extract_trivial(voice)
...     rmakers.attach_time_signatures(voice, time_signatures)
...     return lilypond_file
... 
>>> pairs = [(3, 8), (4, 8), (3, 8), (4, 8)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> abjad.show(lilypond_file)  
Return type:

None

abjadext.rmakers.functions.hide_skip_filled(argument)[source]

Hides skip-filled tuplets in argument.

Return type:

None

abjadext.rmakers.functions.hide_trivial(argument)[source]

Hides trivial tuplets in argument.

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.even_division(durations, [8])
...     lilypond_file = rmakers.example(tuplets, time_signatures)
...     voice = lilypond_file["Voice"]
...     rmakers.beam(voice)
...     tuplets = abjad.select.tuplets(tuplets)[-2:]
...     rmakers.hide_trivial(tuplets)
...     return lilypond_file
... 
>>> pairs = [(3, 8), (3, 8), (3, 8), (3, 8)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> abjad.show(lilypond_file)  
Return type:

None

abjadext.rmakers.functions.interpolate(start_duration, stop_duration, written_duration)[source]

Makes interpolation.

Return type:

Interpolation

abjadext.rmakers.functions.invisible_music(argument, *, tag=None)[source]

Makes argument invisible.

Return type:

None

abjadext.rmakers.functions.nongrace_leaves_in_each_tuplet(argument, *, level=-1)[source]

Selects nongrace leaves in each tuplet.

Return type:

list[list[Leaf]]

abjadext.rmakers.functions.on_beat_grace_container(voice, voice_name, nongrace_leaf_lists, counts, *, grace_leaf_duration=None, grace_polyphony_command=VoiceNumber(n=1, leak=False), nongrace_polyphony_command=VoiceNumber(n=2, leak=False), tag=None, talea=Talea(counts=[1], denominator=8, end_counts=(), preamble=()))[source]

Makes on-beat grace containers.

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.even_division(durations, [4], extra_counts=[2])
...     voice = abjad.Voice(tuplets)
...     tuplets = abjad.select.tuplets(voice)
...     notes = [abjad.select.notes(_) for _ in tuplets]
...     notes = [abjad.select.exclude(_, [0, -1]) for _ in notes]
...     notes = abjad.select.notes(notes)
...     groups = [[_] for _ in notes]
...     rmakers.on_beat_grace_container(
...         voice, "RhythmMaker.Music", groups, [2, 4], grace_leaf_duration=(1, 28)
...     )
...     components = abjad.mutate.eject_contents(voice)
...     music_voice = abjad.Voice(components, name="RhythmMaker.Music")
...     lilypond_file = rmakers.example(
...         [music_voice], time_signatures, includes=["abjad.ily"]
...     )
...     staff = lilypond_file["Staff"]
...     abjad.override(staff).TupletBracket.direction = abjad.UP
...     abjad.override(staff).TupletBracket.staff_padding = 5
...     return lilypond_file
... 
>>> pairs = [(3, 4)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> abjad.show(lilypond_file)  
>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.talea(durations, [5], 16)
...     voice = abjad.Voice(tuplets)
...     rmakers.extract_trivial(voice)
...     logical_ties = abjad.select.logical_ties(voice)
...     rmakers.on_beat_grace_container(
...         voice,
...         "RhythmMaker.Music",
...         logical_ties,
...         [6, 2],
...         grace_leaf_duration=(1, 28),
...     )
...     components = abjad.mutate.eject_contents(voice)
...     music_voice = abjad.Voice(components, name="RhythmMaker.Music")
...     lilypond_file = rmakers.example(
...         [music_voice], time_signatures, includes=["abjad.ily"]
...     )
...     return lilypond_file
... 
>>> pairs = [(3, 4), (3, 4)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> abjad.show(lilypond_file)  
Return type:

None

abjadext.rmakers.functions.reduce_multiplier(argument)[source]

Reduces multipliers of tuplets in argument.

Return type:

None

abjadext.rmakers.functions.repeat_tie(argument, *, tag=None)[source]

Attaches repeat-ties to leaves in argument.

Attaches repeat-tie to first note in each nonfirst tuplet:

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.even_division(durations, [8], extra_counts=[1])
...     voice = abjad.Voice(tuplets)
...     tuplets = abjad.select.tuplets(voice)[1:]
...     notes = [abjad.select.note(_, 0) for _ in tuplets]
...     rmakers.repeat_tie(notes)
...     rmakers.beam(voice)
...     components = abjad.mutate.eject_contents(voice)
...     lilypond_file = rmakers.example(components, time_signatures)
...     return lilypond_file
... 
>>> pairs = [(2, 8), (2, 8), (2, 8), (2, 8), (2, 8), (2, 8)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> abjad.show(lilypond_file)  

Attaches repeat-ties to nonfirst notes in each tuplet:

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.even_division(durations, [8], extra_counts=[1])
...     voice = abjad.Voice(tuplets)
...     tuplets = abjad.select.tuplets(voice)
...     notes = [abjad.select.notes(_)[1:] for _ in tuplets]
...     rmakers.repeat_tie(notes)
...     rmakers.beam(voice)
...     components = abjad.mutate.eject_contents(voice)
...     lilypond_file = rmakers.example(components, time_signatures)
...     return lilypond_file
... 
>>> pairs = [(2, 8), (2, 8), (2, 8), (2, 8), (2, 8), (2, 8)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> abjad.show(lilypond_file)  
Return type:

None

abjadext.rmakers.functions.rewrite_dots(argument, *, tag=None)[source]

Rewrites dots of tuplets in argument.

Return type:

None

abjadext.rmakers.functions.rewrite_meter(voice, *, boundary_depth=None, reference_meters=(), tag=None)[source]

Rewrites meter of components in voice.

Use rmakers.wrap_in_time_signature_staff() to make sure voice appears together with time signature information in a staff.

Rewrites meter:

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.talea(durations, [5, 4], 16)
...     voice = rmakers.wrap_in_time_signature_staff(tuplets, time_signatures)
...     rmakers.beam(voice)
...     rmakers.extract_trivial(voice)
...     rmakers.rewrite_meter(voice)
...     components = abjad.mutate.eject_contents(voice)
...     lilypond_file = rmakers.example(components, time_signatures)
...     return lilypond_file
... 
>>> pairs = [(3, 4), (3, 4), (3, 4)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> abjad.show(lilypond_file)  
Return type:

None

abjadext.rmakers.functions.rewrite_rest_filled(argument, *, spelling=None, tag=None)[source]

Rewrites rest-filled tuplets in argument.

Does not rewrite rest-filled tuplets:

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.talea(durations, [-1], 16, extra_counts=[1])
...     container = abjad.Container(tuplets)
...     tuplets = abjad.select.tuplets(container)
...     rmakers.extract_trivial(container)
...     components = abjad.mutate.eject_contents(container)
...     lilypond_file = rmakers.example(components, time_signatures)
...     return lilypond_file
... 
>>> pairs = [(4, 16), (4, 16), (5, 16), (5, 16)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> abjad.show(lilypond_file)  

Rewrites rest-filled tuplets:

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.talea(durations, [-1], 16, extra_counts=[1])
...     container = abjad.Container(tuplets)
...     tuplets = abjad.select.tuplets(container)
...     rmakers.rewrite_rest_filled(container)
...     rmakers.extract_trivial(container)
...     components = abjad.mutate.eject_contents(container)
...     lilypond_file = rmakers.example(components, time_signatures)
...     return lilypond_file
... 
>>> pairs = [(4, 16), (4, 16), (5, 16), (5, 16)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> abjad.show(lilypond_file)  

With spelling specifier:

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.talea(durations, [-1], 16, extra_counts=[1])
...     container = abjad.Container(tuplets)
...     tuplets = abjad.select.tuplets(container)
...     rmakers.rewrite_rest_filled(
...         container, spelling=rmakers.Spelling(increase_monotonic=True)
...     )
...     rmakers.extract_trivial(container)
...     components = abjad.mutate.eject_contents(container)
...     lilypond_file = rmakers.example(components, time_signatures)
...     return lilypond_file
... 
>>> pairs = [(4, 16), (4, 16), (5, 16), (5, 16)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> abjad.show(lilypond_file)  

Working with rewrite_rest_filled.

Makes rest-filled tuplets:

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.talea(durations, [3, 3, -6, -6], 16, extra_counts=[1, 0])
...     lilypond_file = rmakers.example(tuplets, time_signatures)
...     voice = lilypond_file["Voice"]
...     rmakers.beam(voice)
...     return lilypond_file
... 
>>> pairs = [(3, 8), (4, 8), (3, 8), (4, 8)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> abjad.show(lilypond_file)  

Rewrites rest-filled tuplets:

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.talea(durations, [3, 3, -6, -6], 16, extra_counts=[1, 0])
...     lilypond_file = rmakers.example(tuplets, time_signatures)
...     voice = lilypond_file["Voice"]
...     rmakers.beam(voice)
...     rmakers.rewrite_rest_filled(voice)
...     rmakers.attach_time_signatures(voice, time_signatures)
...     return lilypond_file
... 
>>> pairs = [(3, 8), (4, 8), (3, 8), (4, 8)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> abjad.show(lilypond_file)  
Return type:

None

abjadext.rmakers.functions.rewrite_sustained(argument, *, tag=None)[source]

Rewrites sustained tuplets in argument.

Sustained tuplets generalize a class of rhythms composers are likely to rewrite:

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.talea(
...         durations, [6, 5, 5, 4, 1], 16, extra_counts=[2, 1, 1, 1]
...     )
...     container = abjad.Container(tuplets)
...     tuplets = abjad.select.tuplets(container)[1:3]
...     leaves = [abjad.select.leaf(_, -1) for _ in tuplets]
...     rmakers.tie(leaves)
...     rmakers.beam(container)
...     components = abjad.mutate.eject_contents(container)
...     lilypond_file = rmakers.example(components, time_signatures)
...     return lilypond_file
... 
>>> pairs = [(4, 16), (4, 16), (4, 16), (4, 16)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> abjad.show(lilypond_file)  

The first three tuplets in the example above qualify as sustained:

>>> staff = lilypond_file["Score"]
>>> for tuplet in abjad.select.tuplets(staff):
...     abjad.get.sustained(tuplet)
... 
True
True
True
False

Tuplets 0 and 1 each contain only a single tuplet-initial attack. Tuplet 2 contains no attack at all. All three fill their duration completely.

Tuplet 3 contains a nonintial attack that rearticulates the tuplet’s duration midway through the course of the figure. Tuplet 3 does not qualify as sustained.

Rewrite sustained tuplets like this:

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.talea(
...         durations, [6, 5, 5, 4, 1], 16, extra_counts=[2, 1, 1, 1]
...     )
...     container = abjad.Container(tuplets)
...     tuplets = abjad.select.tuplets(container)[1:3]
...     leaves = [abjad.select.leaf(_, -1) for _ in tuplets]
...     rmakers.tie(leaves)
...     rmakers.rewrite_sustained(container)
...     rmakers.beam(container)
...     components = abjad.mutate.eject_contents(container)
...     lilypond_file = rmakers.example(components, time_signatures)
...     return lilypond_file
... 
>>> pairs = [(4, 16), (4, 16), (4, 16), (4, 16)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> abjad.show(lilypond_file)  

Rewrite sustained tuplets – and then extract the trivial tuplets that result – like this:

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.talea(
...         durations, [6, 5, 5, 4, 1], 16, extra_counts=[2, 1, 1, 1]
...     )
...     container = abjad.Container(tuplets)
...     rmakers.beam(container)
...     tuplets = abjad.select.tuplets(container)[1:3]
...     leaves = [abjad.select.leaf(_, -1) for _ in tuplets]
...     rmakers.tie(leaves)
...     rmakers.rewrite_sustained(container)
...     rmakers.extract_trivial(container)
...     components = abjad.mutate.eject_contents(container)
...     lilypond_file = rmakers.example(components, time_signatures)
...     return lilypond_file
... 
>>> pairs = [(4, 16), (4, 16), (4, 16), (4, 16)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> abjad.show(lilypond_file)  

With selector:

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.even_division(durations, [8], extra_counts=[1])
...     lilypond_file = rmakers.example(tuplets, time_signatures)
...     voice = lilypond_file["Voice"]
...     notes = [abjad.select.notes(_)[:-1] for _ in tuplets]
...     rmakers.tie(notes)
...     rmakers.rewrite_sustained(tuplets[-2:])
...     rmakers.beam(voice)
...     return lilypond_file
... 
>>> pairs = [(2, 8), (2, 8), (2, 8), (2, 8)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> abjad.show(lilypond_file)  

Sustains every other tuplet:

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.talea(durations, [1, 2, 3, 4], 16)
...     lilypond_file = rmakers.example(tuplets, time_signatures)
...     voice = lilypond_file["Voice"]
...     tuplets = abjad.select.get(tuplets, [1], 2)
...     notes = [abjad.select.notes(_)[:-1] for _ in tuplets]
...     rmakers.tie(notes)
...     rmakers.rewrite_sustained(tuplets)
...     rmakers.beam(voice)
...     rmakers.extract_trivial(voice)
...     return lilypond_file
... 
>>> pairs = [(3, 8), (4, 8), (3, 8), (4, 8)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> abjad.show(lilypond_file)  
Return type:

None

abjadext.rmakers.functions.split_measures(voice, *, durations=None, tag=None)[source]

Splits measures in voice.

Uses durations when durations is not none.

Tries to find time signature information (from the staff that contains voice) when durations is none.

Return type:

None

abjadext.rmakers.functions.swap_length_1(argument)[source]

Swaps length-1 tuplets in argument with containers.

Return type:

None

abjadext.rmakers.functions.swap_skip_filled(argument)[source]

Swaps skip-filled tuplets in argument with containers.

Return type:

None

abjadext.rmakers.functions.swap_trivial(argument)[source]

Swaps trivial tuplets in argument with containers.

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.even_division(durations, [8])
...     lilypond_file = rmakers.example(tuplets, time_signatures)
...     voice = lilypond_file["Voice"]
...     rmakers.beam(voice)
...     tuplets = abjad.select.tuplets(tuplets)[-2:]
...     rmakers.swap_trivial(tuplets)
...     return lilypond_file
... 
>>> pairs = [(3, 8), (3, 8), (3, 8), (3, 8)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> abjad.show(lilypond_file)  
Return type:

None

abjadext.rmakers.functions.tie(argument, *, tag=None)[source]

Attaches ties to notes in argument.

Attaches tie to last note in each nonlast tuplet:

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.even_division(durations, [8], extra_counts=[1])
...     lilypond_file = rmakers.example(tuplets, time_signatures)
...     voice = lilypond_file["Voice"]
...     tuplets = abjad.select.tuplets(tuplets)[:-1]
...     notes = [abjad.select.note(_, -1) for _ in tuplets]
...     rmakers.tie(notes)
...     rmakers.beam(voice)
...     return lilypond_file
... 
>>> pairs = [(2, 8), (2, 8), (2, 8), (2, 8), (2, 8), (2, 8)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> abjad.show(lilypond_file)  

Ties the last leaf of nonlast tuplets:

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.talea(durations, [5, 3, 3, 3], 16)
...     lilypond_file = rmakers.example(tuplets, time_signatures)
...     voice = lilypond_file["Voice"]
...     tuplets = abjad.select.tuplets(tuplets)[:-1]
...     leaves = [abjad.select.leaf(_, -1) for _ in tuplets]
...     rmakers.tie(leaves)
...     rmakers.beam(voice)
...     rmakers.extract_trivial(voice)
...     return lilypond_file
... 
>>> pairs = [(4, 8), (3, 8), (4, 8), (3, 8)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> abjad.show(lilypond_file)  

Ties across every other tuplet:

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.talea(durations, [5, 3, 3, 3], 16)
...     lilypond_file = rmakers.example(tuplets, time_signatures)
...     voice = lilypond_file["Voice"]
...     tuplets = abjad.select.get(tuplets[:-1], [0], 2)
...     leaves = [abjad.select.leaf(_, -1) for _ in tuplets]
...     rmakers.tie(leaves)
...     rmakers.beam(voice)
...     rmakers.extract_trivial(voice)
...     return lilypond_file
... 
>>> pairs = [(4, 8), (3, 8), (4, 8), (3, 8)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> abjad.show(lilypond_file)  

TIE-CONSECUTIVE-NOTES RECIPE:

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.talea(durations, [5, -3, 3, 3], 16)
...     lilypond_file = rmakers.example(tuplets, time_signatures)
...     voice = lilypond_file["Voice"]
...     rmakers.untie(voice)
...     runs = abjad.select.runs(voice)
...     notes = [abjad.select.notes(_)[:-1] for _ in runs]
...     rmakers.tie(notes)
...     rmakers.beam(voice)
...     rmakers.extract_trivial(voice)
...     return lilypond_file
... 
>>> pairs = [(4, 8), (3, 8), (4, 8), (3, 8)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> abjad.show(lilypond_file)  

Attaches ties to nonlast notes in each tuplet:

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.even_division(durations, [8], extra_counts=[1])
...     lilypond_file = rmakers.example(tuplets, time_signatures)
...     voice = lilypond_file["Voice"]
...     notes = [abjad.select.notes(_)[:-1] for _ in tuplets]
...     rmakers.untie(notes)
...     rmakers.tie(notes)
...     rmakers.beam(voice)
...     return lilypond_file
... 
>>> pairs = [(2, 8), (2, 8), (2, 8), (2, 8), (2, 8), (2, 8)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> abjad.show(lilypond_file)  
Return type:

None

abjadext.rmakers.functions.time_signatures(pairs)[source]

Makes time signatures from pairs.

Documentation helper.

Return type:

list[TimeSignature]

abjadext.rmakers.functions.tremolo_container(argument, count, *, tag=None)[source]

Replaces notes in argument with tremolo containers.

Repeats figures two times each:

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.even_division(durations, [4])
...     lilypond_file = rmakers.example(tuplets, time_signatures)
...     voice = lilypond_file["Voice"]
...     notes = [abjad.select.notes(_) for _ in tuplets]
...     groups = [abjad.select.get(_, [0, -1]) for _ in notes]
...     rmakers.tremolo_container(groups, 2)
...     rmakers.extract_trivial(voice)
...     containers = abjad.select.components(voice, abjad.TremoloContainer)
...     result = [abjad.slur(_) for _ in containers]
...     rmakers.attach_time_signatures(voice, time_signatures)
...     return lilypond_file
... 
>>> pairs = [(4, 4), (3, 4)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> abjad.show(lilypond_file)  

Repeats figures four times each:

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.even_division(durations, [4])
...     lilypond_file = rmakers.example(tuplets, time_signatures)
...     voice = lilypond_file["Voice"]
...     notes = [abjad.select.notes(_) for _ in tuplets]
...     groups = [abjad.select.get(_, [0, -1]) for _ in notes]
...     rmakers.tremolo_container(groups, 4)
...     rmakers.extract_trivial(voice)
...     containers = abjad.select.components(voice, abjad.TremoloContainer)
...     result = [abjad.slur(_) for _ in containers]
...     rmakers.attach_time_signatures(voice, time_signatures)
...     return lilypond_file
... 
>>> pairs = [(4, 4), (3, 4)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> abjad.show(lilypond_file)  
Return type:

None

abjadext.rmakers.functions.trivialize(argument)[source]

Trivializes tuplets in argument.

Leaves trivializable tuplets as-is when no tuplet command is given. The tuplets in measures 2 and 4 can be written as trivial tuplets, but they are not:

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.talea(durations, [3, 3, 6, 6], 16, extra_counts=[0, 4])
...     lilypond_file = rmakers.example(tuplets, time_signatures)
...     voice = lilypond_file["Voice"]
...     rmakers.beam(voice)
...     return lilypond_file
... 
>>> pairs = [(3, 8), (4, 8), (3, 8), (4, 8)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> abjad.show(lilypond_file)  

Rewrites trivializable tuplets as trivial (1:1) tuplets when trivialize is true:

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.talea(durations, [3, 3, 6, 6], 16, extra_counts=[0, 4])
...     lilypond_file = rmakers.example(tuplets, time_signatures)
...     voice = lilypond_file["Voice"]
...     rmakers.trivialize(voice)
...     rmakers.beam(voice)
...     return lilypond_file
... 
>>> pairs = [(3, 8), (4, 8), (3, 8), (4, 8)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> abjad.show(lilypond_file)  

REGRESSION #907a. Rewrites trivializable tuplets even when tuplets contain multiple ties:

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.talea(durations, [3, 3, 6, 6], 16, extra_counts=[0, 4])
...     lilypond_file = rmakers.example(tuplets, time_signatures)
...     voice = lilypond_file["Voice"]
...     rmakers.trivialize(voice)
...     leaves = [abjad.select.leaf(_, -1) for _ in tuplets[:-1]]
...     rmakers.tie(leaves)
...     rmakers.beam(voice)
...     return lilypond_file
... 
>>> pairs = [(3, 8), (4, 8), (3, 8), (4, 8)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> abjad.show(lilypond_file)  

REGRESSION #907b. Rewrites trivializable tuplets even when tuplets contain very long ties:

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.talea(durations, [3, 3, 6, 6], 16, extra_counts=[0, 4])
...     lilypond_file = rmakers.example(tuplets, time_signatures)
...     voice = lilypond_file["Voice"]
...     rmakers.trivialize(voice)
...     notes = abjad.select.notes(voice)[:-1]
...     rmakers.tie(notes)
...     rmakers.beam(voice)
...     return lilypond_file
... 
>>> pairs = [(3, 8), (4, 8), (3, 8), (4, 8)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> abjad.show(lilypond_file)  
Return type:

None

abjadext.rmakers.functions.unbeam(argument, *, smart=False, tag=None)[source]

Unbeams leaves in argument.

Adjusts adjacent start- and stop-beams when smart=True.

Unbeams 1 note:

>>> voice = abjad.Voice("c'8 [ d' e' f' g' a' ]")
>>> staff = abjad.Staff([voice])
>>> score = abjad.Score([staff])
>>> abjad.setting(score).autoBeaming = False
>>> rmakers.unbeam(voice[0], smart=True)
>>> abjad.show(score)  
>>> voice = abjad.Voice("c'8 [ d' e' f' g' a' ]")
>>> staff = abjad.Staff([voice])
>>> score = abjad.Score([staff])
>>> abjad.setting(score).autoBeaming = False
>>> rmakers.unbeam(voice[1], smart=True)
>>> abjad.show(score)  
>>> voice = abjad.Voice("c'8 [ d' e' f' g' a' ]")
>>> staff = abjad.Staff([voice])
>>> score = abjad.Score([staff])
>>> abjad.setting(score).autoBeaming = False
>>> rmakers.unbeam(voice[2], smart=True)
>>> abjad.show(score)  
>>> voice = abjad.Voice("c'8 [ d' e' f' g' a' ]")
>>> staff = abjad.Staff([voice])
>>> score = abjad.Score([staff])
>>> abjad.setting(score).autoBeaming = False
>>> rmakers.unbeam(voice[3], smart=True)
>>> abjad.show(score)  
>>> voice = abjad.Voice("c'8 [ d' e' f' g' a' ]")
>>> staff = abjad.Staff([voice])
>>> score = abjad.Score([staff])
>>> abjad.setting(score).autoBeaming = False
>>> rmakers.unbeam(voice[4], smart=True)
>>> abjad.show(score)  
>>> voice = abjad.Voice("c'8 [ d' e' f' g' a' ]")
>>> staff = abjad.Staff([voice])
>>> score = abjad.Score([staff])
>>> abjad.setting(score).autoBeaming = False
>>> rmakers.unbeam(voice[5], smart=True)
>>> abjad.show(score)  

Unbeams 2 notes:

>>> voice = abjad.Voice("c'8 [ d' e' f' g' a' ]")
>>> staff = abjad.Staff([voice])
>>> score = abjad.Score([staff])
>>> abjad.setting(score).autoBeaming = False
>>> rmakers.unbeam(voice[:2], smart=True)
>>> abjad.show(score)  
>>> voice = abjad.Voice("c'8 [ d' e' f' g' a' ]")
>>> staff = abjad.Staff([voice])
>>> score = abjad.Score([staff])
>>> abjad.setting(score).autoBeaming = False
>>> rmakers.unbeam(voice[1:3], smart=True)
>>> abjad.show(score)  
>>> voice = abjad.Voice("c'8 [ d' e' f' g' a' ]")
>>> staff = abjad.Staff([voice])
>>> score = abjad.Score([staff])
>>> abjad.setting(score).autoBeaming = False
>>> rmakers.unbeam(voice[2:4], smart=True)
>>> abjad.show(score)  
>>> voice = abjad.Voice("c'8 [ d' e' f' g' a' ]")
>>> staff = abjad.Staff([voice])
>>> score = abjad.Score([staff])
>>> abjad.setting(score).autoBeaming = False
>>> rmakers.unbeam(voice[3:5], smart=True)
>>> abjad.show(score)  
>>> voice = abjad.Voice("c'8 [ d' e' f' g' a' ]")
>>> staff = abjad.Staff([voice])
>>> score = abjad.Score([staff])
>>> abjad.setting(score).autoBeaming = False
>>> rmakers.unbeam(voice[4:], smart=True)
>>> abjad.show(score)  

Unbeams 1 note:

>>> voice = abjad.Voice("c'8 [ d' ] e' [ f' ] g' [ a' ]")
>>> staff = abjad.Staff([voice])
>>> score = abjad.Score([staff])
>>> abjad.setting(score).autoBeaming = False
>>> rmakers.unbeam(voice[0], smart=True)
>>> abjad.show(score)  
>>> voice = abjad.Voice("c'8 [ d' ] e' [ f' ] g' [ a' ]")
>>> staff = abjad.Staff([voice])
>>> score = abjad.Score([staff])
>>> abjad.setting(score).autoBeaming = False
>>> rmakers.unbeam(voice[1], smart=True)
>>> abjad.show(score)  
>>> staff = abjad.Staff("c'8 [ d' ] e' [ f' ] g' [ a' ]")
>>> score = abjad.Score([staff])
>>> abjad.setting(score).autoBeaming = False
>>> rmakers.unbeam(staff[2], smart=True)
>>> abjad.show(score)  
>>> staff = abjad.Staff("c'8 [ d' ] e' [ f' ] g' [ a' ]")
>>> score = abjad.Score([staff])
>>> abjad.setting(score).autoBeaming = False
>>> rmakers.unbeam(staff[3], smart=True)
>>> abjad.show(score)  
>>> staff = abjad.Staff("c'8 [ d' ] e' [ f' ] g' [ a' ]")
>>> score = abjad.Score([staff])
>>> abjad.setting(score).autoBeaming = False
>>> rmakers.unbeam(staff[4], smart=True)
>>> abjad.show(score)  
>>> staff = abjad.Staff("c'8 [ d' ] e' [ f' ] g' [ a' ]")
>>> score = abjad.Score([staff])
>>> abjad.setting(score).autoBeaming = False
>>> rmakers.unbeam(staff[5], smart=True)
>>> abjad.show(score)  

Unbeams 2 notes:

>>> staff = abjad.Staff("c'8 [ d' ] e' [ f' ] g' [ a' ]")
>>> score = abjad.Score([staff])
>>> abjad.setting(score).autoBeaming = False
>>> rmakers.unbeam(staff[:2], smart=True)
>>> abjad.show(score)  
>>> staff = abjad.Staff("c'8 [ d' ] e' [ f' ] g' [ a' ]")
>>> score = abjad.Score([staff])
>>> abjad.setting(score).autoBeaming = False
>>> rmakers.unbeam(staff[1:3], smart=True)
>>> abjad.show(score)  
>>> staff = abjad.Staff("c'8 [ d' ] e' [ f' ] g' [ a' ]")
>>> score = abjad.Score([staff])
>>> abjad.setting(score).autoBeaming = False
>>> rmakers.unbeam(staff[2:4], smart=True)
>>> abjad.show(score)  
>>> staff = abjad.Staff("c'8 [ d' ] e' [ f' ] g' [ a' ]")
>>> score = abjad.Score([staff])
>>> abjad.setting(score).autoBeaming = False
>>> rmakers.unbeam(staff[3:5], smart=True)
>>> abjad.show(score)  
>>> staff = abjad.Staff("c'8 [ d' ] e' [ f' ] g' [ a' ]")
>>> score = abjad.Score([staff])
>>> abjad.setting(score).autoBeaming = False
>>> rmakers.unbeam(staff[4:], smart=True)
>>> abjad.show(score)  
Return type:

None

abjadext.rmakers.functions.untie(argument)[source]

Unties leaves in argument.

Attaches ties to nonlast notes; then detaches ties from select notes:

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.even_division(durations, [8], extra_counts=[1])
...     lilypond_file = rmakers.example(tuplets, time_signatures)
...     voice = lilypond_file["Voice"]
...     notes = abjad.select.notes(voice)[:-1]
...     rmakers.tie(notes)
...     notes = abjad.select.notes(voice)
...     notes = abjad.select.get(notes, [0], 4)
...     rmakers.untie(notes)
...     rmakers.beam(voice)
...     return lilypond_file
... 
>>> pairs = [(2, 8), (2, 8), (2, 8), (2, 8), (2, 8), (2, 8)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> abjad.show(lilypond_file)  

Attaches repeat-ties to nonfirst notes; then detaches ties from select notes:

>>> def make_lilypond_file(pairs):
...     time_signatures = rmakers.time_signatures(pairs)
...     durations = [abjad.Duration(_) for _ in time_signatures]
...     tuplets = rmakers.even_division(durations, [8], extra_counts=[1])
...     voice = abjad.Voice(tuplets)
...     notes = abjad.select.notes(voice)[1:]
...     rmakers.repeat_tie(notes)
...     notes = abjad.select.notes(voice)
...     notes = abjad.select.get(notes, [0], 4)
...     rmakers.untie(notes)
...     rmakers.beam(voice)
...     components = abjad.mutate.eject_contents(voice)
...     lilypond_file = rmakers.example(components, time_signatures)
...     return lilypond_file
... 
>>> pairs = [(2, 8), (2, 8), (2, 8), (2, 8), (2, 8), (2, 8)]
>>> lilypond_file = make_lilypond_file(pairs)
>>> abjad.show(lilypond_file)  
Return type:

None

abjadext.rmakers.functions.wrap_in_time_signature_staff(components, time_signatures)[source]

Wraps components in two-voice staff.

One voice for components and another voice for time_signatures.

See rmakers.rewrite_meter() for examples of this function.

Return type:

Voice

abjadext.rmakers.functions.written_duration(argument, duration)[source]

Sets written duration of leaves in argument.

Return type:

None