functions¶
The rmakers functions.
Functions
Makes (and attaches) after-grace containers. |
|
|
|
Beams runs of notes in each component in |
|
Beams groups in |
|
Makes (and attaches) before-grace containers. |
|
Sets tuplet ratio denominator of tuplets in |
|
Applies duration bracket to tuplets in |
|
Makes example LilyPond file. |
|
Extracts rest-filled tuplets from |
|
Extracts trivial tuplets from |
|
Feather-beams leaves in |
|
Spells tuplets in |
|
Spells tuplets in |
|
Sets |
|
Replaces leaves in |
|
Replaces ties in |
|
Replaces leaves in |
|
Hides skip-filled tuplets in |
|
Hides trivial tuplets in |
|
Makes interpolation. |
|
Makes |
|
Selects nongrace leaves in each tuplet. |
|
Makes on-beat grace containers. |
|
Reduces multipliers of tuplets in |
|
Attaches repeat-ties to leaves in |
|
Rewrites dots of tuplets in |
|
Rewrites meter of components in |
|
Rewrites rest-filled tuplets in |
|
Rewrites sustained tuplets in |
|
Splits measures in |
|
Swaps length-1 tuplets in |
|
Swaps skip-filled tuplets in |
|
Swaps trivial tuplets in |
|
Attaches ties to notes in |
|
Makes time signatures from |
|
Replaces notes in |
|
Trivializes tuplets in |
|
Unbeams leaves in |
|
Unties leaves in |
|
Wraps |
|
Sets written duration of leaves in |
- 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
andslash=False
:>>> pairs = [(3, 4), (3, 4)] >>> lilypond_file = make_lilypond_file(pairs, beam=False, slash=False) >>> abjad.show(lilypond_file)
With
beam=True
andslash=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
thenbeam
must also be true.Leaves lone after-graces unslashed even when
slash=True
.- Return type:
- 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
andstemlet_length=n
to beam rests with stemlets of lengthn
:>>> 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:
- 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:
- 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
thenbeam
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
thenbeam
must also be true.)- Return type:
- 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
and10: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:
- abjadext.rmakers.functions.duration_bracket(argument)[source]¶
Applies duration bracket to tuplets in
argument
.- Return type:
- abjadext.rmakers.functions.example(components, time_signatures, *, includes=())[source]¶
Makes example LilyPond file.
Function is a documentation helper.
- Return type:
- abjadext.rmakers.functions.extract_rest_filled(argument)[source]¶
Extracts rest-filled tuplets from
argument
.- Return type:
- 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:
- abjadext.rmakers.functions.feather_beam(argument, *, beam_rests=False, stemlet_length=None, tag=None)[source]¶
Feather-beams leaves in
argument
.- Return type:
- 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:
- 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:
- abjadext.rmakers.functions.force_fraction(argument)[source]¶
Sets
force_fraction=True
on tuplets inargument
.- Return type:
- 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:
- 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:
- 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:
- abjadext.rmakers.functions.hide_skip_filled(argument)[source]¶
Hides skip-filled tuplets in
argument
.- Return type:
- 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:
- abjadext.rmakers.functions.interpolate(start_duration, stop_duration, written_duration)[source]¶
Makes interpolation.
- Return type:
- abjadext.rmakers.functions.invisible_music(argument, *, tag=None)[source]¶
Makes
argument
invisible.- Return type:
- abjadext.rmakers.functions.nongrace_leaves_in_each_tuplet(argument, *, level=-1)[source]¶
Selects nongrace leaves in each tuplet.
- 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:
- abjadext.rmakers.functions.reduce_multiplier(argument)[source]¶
Reduces multipliers of tuplets in
argument
.- Return type:
- 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:
- abjadext.rmakers.functions.rewrite_dots(argument, *, tag=None)[source]¶
Rewrites dots of tuplets in
argument
.- Return type:
- 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 surevoice
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:
- 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:
- 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:
- abjadext.rmakers.functions.split_measures(voice, *, durations=None, tag=None)[source]¶
Splits measures in
voice
.Uses
durations
whendurations
is not none.Tries to find time signature information (from the staff that contains
voice
) whendurations
is none.- Return type:
- abjadext.rmakers.functions.swap_length_1(argument)[source]¶
Swaps length-1 tuplets in
argument
with containers.- Return type:
- abjadext.rmakers.functions.swap_skip_filled(argument)[source]¶
Swaps skip-filled tuplets in
argument
with containers.- Return type:
- 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:
- 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:
- abjadext.rmakers.functions.time_signatures(pairs)[source]¶
Makes time signatures from
pairs
.Documentation helper.
- Return type:
- 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:
- 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:
- 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:
- 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: