Esempio n. 1
0
def intercalate_silences(rhythm_command_list, voice_names=None):
    global_timespan = abjad.Timespan(
        start_offset=0,
        stop_offset=max(_.timespan.stop_offset for _ in rhythm_command_list),
    )
    silence_maker = handlers.RhythmHandler(
        rmakers.stack(
            rmakers.NoteRhythmMaker(),
            rmakers.force_rest(
                lambda _: abjad.Selection(_).leaves(pitched=True)),
        ),
        name="silence_maker",
    )
    if voice_names is None:
        voice_names = sorted(set(_.voice_name for _ in rhythm_command_list))
    for voice_name in voice_names:
        timespan_list = abjad.TimespanList([
            _.timespan for _ in rhythm_command_list
            if _.voice_name == voice_name
        ])
        silences = abjad.TimespanList([global_timespan])
        for timespan in timespan_list:
            silences -= timespan
        for timespan in silences:
            new_command = RhythmCommand(
                voice_name,
                timespan,
                silence_maker,
            )
            rhythm_command_list.append(new_command)
Esempio n. 2
0
def downbeat_attack(count=1, denominator=8):
    return baca.rhythm(
        rmakers.talea([count], denominator),
        rmakers.force_rest(baca.selectors.lts((1, None)), ),
        rmakers.beam(),
        rmakers.rewrite_rest_filled(),
        rmakers.extract_trivial(),
        rmakers.rewrite_meter(),
        tag=abjad.Tag("animales.downbeat_attack()"),
    )
Esempio n. 3
0
def silence_and_rhythm_maker(maker, annotated_divisions, *commands):
    rest_maker = rmakers.stack(rmakers.note(), rmakers.force_rest(abjad.select()))

    my_stack_voice = abjad.Container()

    for dur in annotated_divisions:
        if dur.annotation.startswith("Rests ") is True:
            rests = rest_maker([dur])
            my_stack_voice.extend(rests)
        else:
            selection = maker([dur], *commands)
            my_stack_voice.extend(selection)
    return my_stack_voice
Esempio n. 4
0
def make_rests(*, measures: typings.SliceTyping = None) -> RhythmCommand:
    """
    Makes rests.
    """
    return RhythmCommand(
        rmakers.stack(
            rmakers.note(),
            rmakers.force_rest(classes.select().lts()),
            tag=_site(inspect.currentframe()),
        ),
        annotation_spanner_color="#darkcyan",
        frame=inspect.currentframe(),
        measures=measures,
    )
Esempio n. 5
0
def VA(voice):
    voice = score["Viola.Music"]
    music = library.make_circle_rhythm(
        accumulator.get(1, 7),
        (1, 2),
        rmakers.force_rest(lambda _: baca.select.lt(_, 0)),
        remainder=abjad.LEFT,
    )
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(8, 9), head=voice.name)
    voice.extend(music)
    music = library.make_urtext_field_rhythm(accumulator.get(10, 11))
    voice.extend(music)
    baca.append_anchor_note_function(voice)
Esempio n. 6
0
def pennant_rhythm(extra_counts=None, silences=None):
    commands = []
    if silences is not None:
        specifier = rmakers.force_rest(baca.selectors.tuplets(silences), )
        commands.append(specifier)

    def preprocessor(divisions):
        result = baca.sequence.fuse(divisions)
        result = baca.sequence.quarters(divisions)
        return result

    return baca.rhythm(
        rmakers.talea([1], 16, extra_counts=extra_counts),
        *commands,
        rmakers.beam(),
        rmakers.rewrite_rest_filled(),
        rmakers.force_diminution(),
        rmakers.trivialize(),
        rmakers.extract_trivial(),
        rmakers.rewrite_meter(),
        preprocessor=preprocessor,
        tag=abjad.Tag("animales.pennant_rhythm()"),
    )
Esempio n. 7
0
def harp_exchange_rhythm(this_part, *commands, silence_first=False):
    part_to_pattern = dict([
        (0, abjad.index([0, 30], period=36)),
        (1, abjad.index([0, 12, 16, 28, 32], period=48)),
        (2, abjad.index([0, 30], period=36)),
        (3, abjad.index([0, 12, 16, 28, 32], period=48)),
    ])

    part_to_indices = {}
    for part in part_to_pattern:
        part_to_indices[part] = []

    harp_indices = []
    part = 0
    pattern = part_to_pattern[part]
    index = 0
    while True:
        if index % pattern.period in pattern.indices:
            part_to_indices[part].append(index)
            harp_indices.append((index, part))
            degrees = []
            for indices in part_to_indices.values():
                talea = abjad.math.difference_series(indices)
                degree = baca.sequence.degree_of_rotational_symmetry(talea)
                degrees.append(degree)
            if all(1 < _ for _ in degrees):
                break
            part = (part + 1) % len(part_to_pattern)
            pattern = part_to_pattern[part]
        index += 1
        if 999 < index:
            break

    part_to_preamble = {}
    part_to_counts = {}
    for part, indices in part_to_indices.items():
        offset = indices[0]
        preamble = []
        if offset != 0:
            preamble.append(offset)
        part_to_preamble[part] = preamble
        counts = abjad.math.difference_series(indices)
        period = baca.sequence.period_of_rotation(counts)
        counts = counts[:period]
        part_to_counts[part] = counts

    preamble = part_to_preamble[this_part]
    counts = []
    for count in part_to_counts[this_part]:
        counts.append(2)
        rest = -(count - 2)
        counts.append(rest)

    silence_first_specifier = []
    if silence_first is True:
        specifier = rmakers.force_rest(baca.selectors.lt(0))
        silence_first_specifier.append(specifier)

    def preprocessor(divisions):
        result = baca.sequence.fuse(divisions)
        result = baca.sequence.quarters(result)
        return result

    return baca.rhythm(
        rmakers.talea(counts, 16, extra_counts=[2], preamble=preamble),
        *commands,
        rmakers.cache_state(),
        *silence_first_specifier,
        rmakers.beam(),
        rmakers.trivialize(),
        rmakers.extract_trivial(),
        rmakers.rewrite_meter(),
        rmakers.force_repeat_tie(),
        preprocessor=preprocessor,
        persist="harp_exchange_rhythm",
        tag=abjad.Tag("animales.harp_exchange_rhythm()"),
    )
Esempio n. 8
0
            16,
            16,
            16,
            16,
        ],
        extra_counts=[0, 3, -1, 2, -2, 0, 3, 1, 2, 2, 0, -3, 1, -2, 2],
    ),
    rmakers.trivialize(abjad.select().tuplets()),
    rmakers.extract_trivial(abjad.select().tuplets()),
    rmakers.rewrite_rest_filled(abjad.select().tuplets()),
    rmakers.rewrite_sustained(abjad.select().tuplets()),
)

silence_maker_ = rmakers.stack(
    rmakers.NoteRhythmMaker(),
    rmakers.force_rest(abjad.select().leaves(pitched=True)),
)

silence_maker = evans.RhythmHandler(rmaker=silence_maker_,
                                    name="silence maker")

rhythm_handler_one = evans.RhythmHandler(rmaker=rmaker_one,
                                         forget=False,
                                         name="rhythm_handler_one")

rhythm_handler_two = evans.RhythmHandler(rmaker=rmaker_two,
                                         forget=False,
                                         name="rhythm_handler_two")

rhythm_handler_three = evans.RhythmHandler(rmaker=rmaker_three,
                                           forget=False,
Esempio n. 9
0
def VA(voice):
    voice = score["Viola.Music"]
    music = library.make_continuous_tremolo_material(accumulator.get(1, 2))
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(3), head=voice.name)
    voice.extend(music)
    music = library.make_picket_rhythm(
        accumulator.get(4, 5),
        4,
        0,
        rmakers.force_rest(lambda _: baca.select.tuplet(_, 0), ),
    )
    voice.extend(music)
    music = library.make_grid_to_trajectory_rhythm(
        accumulator.get(6, 23),
        0,
        -4,
        0,
    )
    voice.extend(music)
    music = library.make_measure_initiation_rhythm(accumulator.get(24, 33))
    voice.extend(music)
    music = library.make_declamation_rhythm(accumulator.get(34))
    voice.extend(music)
    music = library.make_measure_initiation_rhythm(accumulator.get(35, 40))
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(41), head=voice.name)
    voice.extend(music)
    music = library.make_desynchronization_rhythm(
        accumulator.get(42, 49),
        4,
        [0],
    )
    voice.extend(music)
    music = library.make_trajectory_rhythm(
        accumulator.get(50, 61),
        "C",
        -2,
        -1,
    )
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(62), head=voice.name)
    voice.extend(music)
    music = library.make_running_quarter_divisions(
        accumulator.get(63, 76),
        2,
    )
    voice.extend(music)
    music = baca.make_repeat_tied_notes(accumulator.get(77, 80))
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(81), head=voice.name)
    voice.extend(music)
    music = library.make_talea_eighth_notes(
        accumulator.get(82, 85),
        [3, 6, 8],
        -2,
        -1,
        end_counts=[1],
    )
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(86))
    voice.extend(music)
    music = library.make_talea_eighth_notes(
        accumulator.get(87, 88),
        [3, 6, 8],
        -2,
        -1,
    )
    voice.extend(music)
    music = library.make_desynchronization_rhythm(
        accumulator.get(89, 96),
        4,
        [0],
    )
    voice.extend(music)
    music = library.make_trajectory_rhythm(
        accumulator.get(97, 108),
        "C",
        -2,
        -1,
    )
    voice.extend(music)
    music = library.make_talea_eighth_notes(
        accumulator.get(109, 110),
        [3, 6, 8],
        -2,
        -1,
    )
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(111), head=voice.name)
    voice.extend(music)
    music = library.make_talea_eighth_notes(
        accumulator.get(112, 119),
        [3, 6, 8],
        -2,
        -1,
    )
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(120, 127), head=voice.name)
    voice.extend(music)
Esempio n. 10
0
def V2(voice):
    voice = score["Violin.2.Music"]
    music = baca.make_repeat_tied_notes(accumulator.get(1, 5))
    voice.extend(music)
    music = baca.make_repeat_tied_notes(accumulator.get(6))
    voice.extend(music)
    music = baca.make_repeat_tied_notes(accumulator.get(7, 10))
    voice.extend(music)
    music = library.make_accelerando(
        accumulator.get(11, 12),
        (1, 2),
        (7, 32),
    )
    voice.extend(music)
    music = library.make_desynchronization_rhythm(
        accumulator.get(13, 16),
        4,
        [1, 0, 2],
    )
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(17, 22), head=voice.name)
    voice.extend(music)
    music = library.make_picket_rhythm(
        accumulator.get(23, 28),
        4,
        1,
        rmakers.force_rest(
            lambda _: baca.select.tuplet(_, 0),
        ),
    )
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(29), head=voice.name)
    voice.extend(music)
    music = library.make_accelerando(
        accumulator.get(30, 31),
        (1, 2),
        (8, 32),
    )
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(32), head=voice.name)
    voice.extend(music)
    music = library.make_clocktick_rhythm(accumulator.get(33))
    voice.extend(music)
    music = baca.make_skeleton(
        r"\times 2/3 { c'8 r4 } \times 2/3 { c'8 r8 }",
    )
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(35), head=voice.name)
    voice.extend(music)
    music = baca.make_repeat_tied_notes(accumulator.get(36, 37))
    voice.extend(music)
    music = library.make_accelerando(
        accumulator.get(38, 40),
        (1, 2),
        (8, 32),
    )
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(41), head=voice.name)
    voice.extend(music)
    music = library.make_accelerando(
        accumulator.get(42, 45),
        (1, 2),
        (8, 32),
    )
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(46), head=voice.name)
    voice.extend(music)
    music = library.make_picket_rhythm(
        accumulator.get(47, 51),
        4,
        1,
    )
    voice.extend(music)
    music = library.make_loure_tuplets_material(
        accumulator.get(52),
        1,
    )
    voice.extend(music)
    music = library.make_clocktick_rhythm(accumulator.get(53))
    voice.extend(music)
    music = baca.make_skeleton(
        r"{ \times 2/3 { c'8 r4 } \times 2/3 { c'8 r8 } }",
    )
    voice.extend(music)
    music = library.make_loure_tuplets_material(
        accumulator.get(55),
        1,
    )
    voice.extend(music)
    music = library.make_circle_rhythm(
        accumulator.get(56),
        (1, 4),
    )
    voice.extend(music)
    baca.append_anchor_note_function(voice)
Esempio n. 11
0
def VC(voice):
    voice = score["Cello.Music"]
    music = library.make_stroke_rhythm(
        accumulator.get(1, 6),
        3,
        rmakers.force_rest(lambda _: baca.select.tuplets(_, ([1, 2], 3)), ),
    )
    voice.extend(music)
    music = library.make_stroke_rhythm(
        accumulator.get(7, 12),
        -3,
        rmakers.force_rest(lambda _: baca.select.tuplets(_, ([1, 2], 3)), ),
    )
    voice.extend(music)
    music = library.make_stroke_rhythm(
        accumulator.get(13, 18),
        -3,
        rmakers.force_rest(lambda _: baca.select.tuplets(_, ([1], 3)), ),
    )
    voice.extend(music)
    music = library.make_stroke_rhythm(
        accumulator.get(19, 24),
        -3,
        rmakers.force_rest(lambda _: baca.select.tuplets(_, ([1], 3)), ),
    )
    voice.extend(music)
    music = library.make_stroke_rhythm(
        accumulator.get(25, 30),
        -2,
        rmakers.force_rest(lambda _: baca.select.tuplets(_, ([2], 3)), ),
    )
    voice.extend(music)
    music = library.make_stroke_rhythm(
        accumulator.get(31, 36),
        0,
        rmakers.force_rest(lambda _: baca.select.tuplets(_, ([0], 3)), ),
    )
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(37), head=voice.name)
    voice.extend(music)
    music = library.make_cello_cell_rhythm(accumulator.get(38))
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(39), head=voice.name)
    voice.extend(music)
    music = library.make_stroke_rhythm(
        accumulator.get(40, 45),
        0,
    )
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(46, 48))
    voice.extend(music)
    music = baca.make_repeat_tied_notes(accumulator.get(49, 50),
                                        do_not_rewrite_meter=True)
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(51), head=voice.name)
    voice.extend(music)
    music = baca.make_repeat_tied_notes(accumulator.get(52, 53),
                                        do_not_rewrite_meter=True)
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(54, 56), head=voice.name)
    voice.extend(music)
    music = baca.make_skeleton("c2. ~ c4")
    voice.extend(music)
    music = library.make_stroke_rhythm(
        accumulator.get(58, 63),
        0,
    )
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(64), head=voice.name)
    voice.extend(music)
    music = library.make_clouded_pane_rhythm(accumulator.get(65, 92))
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(93), head=voice.name)
    voice.extend(music)
    music = library.make_clouded_pane_rhythm(accumulator.get(94, 99))
    voice.extend(music)
Esempio n. 12
0
def VA(voice):
    voice = score["Viola.Music"]
    music = library.make_stroke_rhythm(
        accumulator.get(1, 6),
        -2,
        rmakers.force_rest(lambda _: baca.select.tuplets(_, ([0, 1], 3)), ),
    )
    voice.extend(music)
    music = library.make_stroke_rhythm(
        accumulator.get(7, 12),
        -2,
        rmakers.force_rest(lambda _: baca.select.tuplets(_, ([0], 3)), ),
    )
    voice.extend(music)
    music = library.make_stroke_rhythm(
        accumulator.get(13, 18),
        -2,
        rmakers.force_rest(lambda _: baca.select.tuplets(_, ([0], 3)), ),
    )
    voice.extend(music)
    music = library.make_stroke_rhythm(
        accumulator.get(19, 24),
        -2,
        rmakers.force_rest(lambda _: baca.select.tuplets(_, ([0], 3)), ),
    )
    voice.extend(music)
    music = library.make_stroke_rhythm(
        accumulator.get(25, 30),
        -2,
        rmakers.force_rest(lambda _: baca.select.tuplets(_, ([0], 2)), ),
    )
    voice.extend(music)
    music = library.make_stroke_rhythm(
        accumulator.get(31, 36),
        0,
        rmakers.force_rest(lambda _: baca.select.tuplets(_, ([1], 2)), ),
    )
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(37, 39), head=voice.name)
    voice.extend(music)
    music = library.make_stroke_rhythm(
        accumulator.get(40, 45),
        0,
    )
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(46))
    voice.extend(music)
    music = library.make_declamation_rhythm(accumulator.get(47))
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(48), head=voice.name)
    voice.extend(music)
    music = baca.make_repeat_tied_notes(accumulator.get(49, 53),
                                        do_not_rewrite_meter=True)
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(54), head=voice.name)
    voice.extend(music)
    music = library.make_declamation_rhythm(accumulator.get(55))
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(56), head=voice.name)
    voice.extend(music)
    music = baca.make_repeat_tied_notes(accumulator.get(57))
    voice.extend(music)
    music = library.make_stroke_rhythm(
        accumulator.get(58, 63),
        0,
    )
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(64), head=voice.name)
    voice.extend(music)
    music = library.make_urtext_field_rhythm(accumulator.get(65))
    voice.extend(music)
    music = library.make_circle_rhythm(
        accumulator.get(66),
        (1, 2),
        rmakers.force_rest(lambda _: baca.select.lt(_, 0)),
        remainder=abjad.LEFT,
    )
    voice.extend(music)
    music = library.make_urtext_field_rhythm(accumulator.get(67))
    voice.extend(music)
    music = library.make_flight_rhythm(
        accumulator.get(68, 83),
        "B",
        -2,
    )
    voice.extend(music)
    music = library.make_continuous_tremolo_material(accumulator.get(84, 89))
    pleaf = baca.select.pleaf(music, 0)
    baca.repeat_tie_function(pleaf)
    voice.extend(music)
    music = baca.make_repeat_tied_notes(accumulator.get(90, 93),
                                        do_not_rewrite_meter=True)
    voice.extend(music)
    music = library.make_continuous_tremolo_material(accumulator.get(94, 96))
    voice.extend(music)
    music = library.make_desynchronization_rhythm(
        accumulator.get(97, 98),
        4,
        [2],
    )
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(99), head=voice.name)
    voice.extend(music)
Esempio n. 13
0
def V2(voice):
    voice = score["Violin.2.Music"]
    music = library.make_stroke_rhythm(
        accumulator.get(1, 6),
        -1,
        rmakers.force_rest(lambda _: baca.select.tuplets(_, ([1], 2)), ),
    )
    voice.extend(music)
    music = library.make_stroke_rhythm(
        accumulator.get(7, 12),
        -1,
        rmakers.force_rest(lambda _: baca.select.tuplets(_, ([1], 2)), ),
    )
    voice.extend(music)
    music = library.make_stroke_rhythm(
        accumulator.get(13, 18),
        -1,
        rmakers.force_rest(lambda _: baca.select.tuplets(_, ([1], 2)), ),
    )
    voice.extend(music)
    music = library.make_stroke_rhythm(
        accumulator.get(19, 24),
        0,
        rmakers.force_rest(lambda _: baca.select.tuplets(_, ([2], 3)), ),
    )
    voice.extend(music)
    music = library.make_stroke_rhythm(
        accumulator.get(25, 30),
        0,
        rmakers.force_rest(lambda _: baca.select.tuplets(_, ([2], 3)), ),
    )
    voice.extend(music)
    music = library.make_stroke_rhythm(
        accumulator.get(31, 36),
        0,
        rmakers.force_rest(lambda _: baca.select.tuplets(_, ([2], 3)), ),
    )
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(37, 39), head=voice.name)
    voice.extend(music)
    music = library.make_stroke_rhythm(
        accumulator.get(40, 45),
        0,
    )
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(46))
    voice.extend(music)
    music = library.make_declamation_rhythm(accumulator.get(47))
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(48, 54), head=voice.name)
    voice.extend(music)
    music = library.make_declamation_rhythm(accumulator.get(55))
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(56), head=voice.name)
    voice.extend(music)
    music = library.make_accelerando(
        accumulator.get(57),
        (1, 4),
        (2, 16),
    )
    voice.extend(music)
    music = library.make_stroke_rhythm(
        accumulator.get(58, 63),
        0,
    )
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(64), head=voice.name)
    voice.extend(music)
    music = library.make_urtext_field_rhythm(accumulator.get(65))
    voice.extend(music)
    music = library.make_circle_rhythm(
        accumulator.get(66),
        (1, 4),
    )
    voice.extend(music)
    music = library.make_urtext_field_rhythm(accumulator.get(67))
    voice.extend(music)
    music = library.make_flight_rhythm(
        accumulator.get(68, 83),
        "C",
        -1,
    )
    voice.extend(music)
    music = library.make_continuous_tremolo_material(accumulator.get(84, 92))
    pleaf = baca.select.pleaf(music, 0)
    baca.repeat_tie_function(pleaf)
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(93), head=voice.name)
    voice.extend(music)
    music = library.make_continuous_tremolo_material(accumulator.get(94, 96))
    voice.extend(music)
    music = library.make_desynchronization_rhythm(
        accumulator.get(97, 98),
        4,
        [0],
    )
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(99), head=voice.name)
    voice.extend(music)
Esempio n. 14
0
    abjad.attach(signature, skips[i])
    if 0 < i:
        if time_signatures[i] == time_signatures[i - 1]:
            new_signature = abjad.TimeSignature(signature.pair, hide=True)
            abjad.detach(signature, skips[i])
            abjad.attach(new_signature, skips[i])

ts_staff = abjad.Staff(skips,
                       lilypond_type="TimeSignatureContext",
                       name="globalcontext")

selector = abjad.select().notes().exclude([0, 1, 3, 4, -1])
selector = abjad.select().tuplets().map(selector)
stack = rmakers.stack(
    rmakers.tuplet([(1, 2, 4, 1, 1, 1)]),
    rmakers.force_rest(selector),
    rmakers.before_grace_container(
        [1, 2, 1],
        abjad.select().tuplets().map(
            abjad.select().logical_ties(pitched=True).exclude([0, 3, 4, 5])),
    ),
    rmakers.rewrite_dots(abjad.select().tuplets().get([1])),
    rmakers.trivialize(abjad.select().tuplets()),
    rmakers.extract_trivial(abjad.select().tuplets()),
    rmakers.rewrite_rest_filled(abjad.select().tuplets()),
    rmakers.rewrite_sustained(abjad.select().tuplets()),
)
stack2 = rmakers.stack(
    rmakers.talea([3, 1, 4, -1, 5, 9], 8, extra_counts=[1, 3, 5]),
    rmakers.trivialize(abjad.select().tuplets()),
    rmakers.extract_trivial(abjad.select().tuplets()),
Esempio n. 15
0
    (3, 4),
    (4, 4),
    (5, 4),
    (6, 4),
    (5, 4),
    (4, 4),
    (3, 4),
    (2, 4),
]

nonlast_tuplets = abjad.select().tuplets()[:-1]
last_leaf = abjad.select().leaf(-1)

s = rmakers.stack(
    evans.RTMMaker(final_rtm_list),
    rmakers.force_rest(abjad.select().leaves().get([0, -2, -1])),
    rmakers.tie(nonlast_tuplets.map(last_leaf)),
    rmakers.trivialize(abjad.select().tuplets()),
    rmakers.extract_trivial(abjad.select().tuplets()),
    rmakers.rewrite_rest_filled(abjad.select().tuplets()),
    rmakers.rewrite_sustained(abjad.select().tuplets()),
    rmakers.beam(),
)
h = evans.RhythmHandler(s, forget=False)
voice_1_selections = h(durs)
staff_1 = abjad.Staff(name="Voice 1", lilypond_type="RhythmicStaff")
staff_1.extend(voice_1_selections)

quantizer = evans.RhythmTreeQuantizer()
final_rtm_list = [quantizer(_) for _ in final_rtm_list]
Esempio n. 16
0
)

commands(
    ("cb3", 1),
    baca.dynamic("p"),
    baca.only_parts(baca.markup(r"\animales-still-non-vibrato-markup"), ),
)

# contrabass solo

commands(
    "cb1",
    library.parts("Contrabass", 1),
    library.harp_exchange_rhythm(
        1,
        rmakers.force_rest(baca.selectors.tuplet(1)),
    ),
    library.margin_markup("Cb. 1"),
    baca.dynamic("p"),
)

commands(
    ("cb1", 1),
    baca.pitch("A#1"),
)

commands(
    ("cb1", (2, -1)),
    baca.clef("treble"),
    baca.dynamic("mf"),
    baca.laissez_vibrer(selector=baca.selectors.ptails()),
Esempio n. 17
0
def VA(voice):
    voice = score["Viola.Music"]
    music = baca.make_repeat_tied_notes(accumulator.get(1, 5))
    voice.extend(music)
    music = library.make_circle_rhythm(
        accumulator.get(6),
        (1, 2),
        rmakers.force_rest(lambda _: baca.select.lt(_, 0)),
        remainder=abjad.LEFT,
    )
    voice.extend(music)
    music = library.make_accelerando(
        accumulator.get(7, 8),
        (1, 2),
        (6, 32),
    )
    voice.extend(music)
    music = library.make_desynchronization_rhythm(
        accumulator.get(9, 16),
        4,
        [1, 0, 2],
    )
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(17, 22), head=voice.name)
    voice.extend(music)
    music = library.make_picket_rhythm(
        accumulator.get(23, 28),
        4,
        0,
        rmakers.force_rest(
            lambda _: baca.select.tuplet(_, 0),
        ),
    )
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(29), head=voice.name)
    voice.extend(music)
    music = library.make_accelerando(
        accumulator.get(30, 31),
        (1, 2),
        (12, 32),
    )
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(32), head=voice.name)
    voice.extend(music)
    music = library.make_clouded_pane_rhythm(accumulator.get(33, 34))
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(35), head=voice.name)
    voice.extend(music)
    music = baca.make_repeat_tied_notes(accumulator.get(36, 37))
    voice.extend(music)
    music = library.make_accelerando(
        accumulator.get(38, 40),
        (1, 2),
        (12, 32),
    )
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(41), head=voice.name)
    voice.extend(music)
    music = library.make_accelerando(
        accumulator.get(42, 45),
        (1, 2),
        (12, 32),
    )
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(46), head=voice.name)
    voice.extend(music)
    music = library.make_picket_rhythm(
        accumulator.get(47, 51),
        4,
        0,
    )
    voice.extend(music)
    music = library.make_loure_tuplets_material(
        accumulator.get(52),
        -1,
    )
    voice.extend(music)
    music = library.make_clouded_pane_rhythm(accumulator.get(53, 54))
    voice.extend(music)
    music = library.make_loure_tuplets_material(
        accumulator.get(55),
        -1,
    )
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(56), head=voice.name)
    voice.extend(music)
Esempio n. 18
0
def V1(voice):
    voice = score["Violin.1.Music"]
    music = baca.make_repeat_tied_notes(accumulator.get(1, 5))
    voice.extend(music)
    music = library.make_circle_rhythm(
        accumulator.get(6),
        (1, 8),
    )
    voice.extend(music)
    music = library.make_accelerando(
        accumulator.get(7, 8),
        (1, 2),
        (8, 32),
    )
    voice.extend(music)
    music = library.make_desynchronization_rhythm(
        accumulator.get(9, 16),
        4,
        [0, 2, 1],
    )
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(17, 22), head=voice.name)
    voice.extend(music)
    music = library.make_picket_rhythm(
        accumulator.get(23, 28),
        4,
        2,
        rmakers.force_rest(
            lambda _: baca.select.tuplet(_, 0),
        ),
    )
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(29), head=voice.name)
    voice.extend(music)
    music = library.make_accelerando(
        accumulator.get(30, 31),
        (1, 2),
        (4, 32),
    )
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(32), head=voice.name)
    voice.extend(music)
    music = library.make_clouded_pane_rhythm(accumulator.get(33, 34))
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(35), head=voice.name)
    voice.extend(music)
    music = baca.make_repeat_tied_notes(accumulator.get(36, 37))
    voice.extend(music)
    music = library.make_accelerando(
        accumulator.get(38, 40),
        (1, 2),
        (4, 32),
    )
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(41), head=voice.name)
    voice.extend(music)
    music = library.make_accelerando(
        accumulator.get(42, 45),
        (1, 2),
        (4, 32),
    )
    voice.extend(music)
    music = baca.make_mmrests(accumulator.get(46), head=voice.name)
    voice.extend(music)
    music = library.make_picket_rhythm(
        accumulator.get(47, 51),
        4,
        2,
    )
    voice.extend(music)
    music = library.make_loure_tuplets_material(
        accumulator.get(52),
        0,
    )
    voice.extend(music)
    music = library.make_clouded_pane_rhythm(accumulator.get(53, 54))
    voice.extend(music)
    music = library.make_loure_tuplets_material(
        accumulator.get(55),
        0,
    )
    voice.extend(music)
    music = library.make_circle_rhythm(
        accumulator.get(56),
        (1, 8),
    )
    voice.extend(music)
    baca.append_anchor_note_function(voice)
Esempio n. 19
0
rmaker_afluteA = rmakers.stack(
    rmakers.talea([4, -2, 1], 8),
    rmakers.extract_trivial(),  # counts  # denominator
    tag=abjad.Tag("Mat_A"),
)

rmaker_afluteB = rmakers.stack(
    rmakers.talea([1], 8, extra_counts=[1]),
    rmakers.beam(),
    rmakers.extract_trivial(),  # counts  # denominator
    # rmakers.rewrite_meter(),
    tag=abjad.Tag("Mat_B"),
)

rest_maker = rmakers.stack(rmakers.note(),
                           rmakers.force_rest(abjad.select()),
                           tag=abjad.Tag("Rests"))

rmaker_bclarinetA = rmakers.stack(
    rmakers.talea([-4, 2], 8),  # counts  # denominator
    rmakers.beam(),
    rmakers.extract_trivial(),
    tag=abjad.Tag("Mat_A"),
)
rmaker_bclarinetB = rmakers.stack(
    rmakers.talea([1], 8, extra_counts=[1]),
    rmakers.beam(),
    rmakers.extract_trivial(),  # counts  # denominator
    # rmakers.rewrite_meter(),
    tag=abjad.Tag("Mat_B"),
)
Esempio n. 20
0
last_leaf = abjad.select().leaf(-6)
nonlast_tuplets = abjad.select().tuplets()[:-1]

rhythm_maker_voice_one = rmakers.stack(
    rmakers.even_division([8], extra_counts=[0, 1]),
    rmakers.tie(abjad.select().leaves().get([0], 2)),
    rmakers.rewrite_sustained(),
    # rmakers.beam(),
    # rmakers.extract_trivial(),
    )

# rmakers.stack(rmakers.tuplet([(2, 2, 2), (2, 2, 2, 2)]), rmakers.beam(), rmakers.extract_trivial(),)

rhythm_maker_voice_four = rmakers.stack(
    rmakers.even_division([8], extra_counts=[0, 1]),
    rmakers.force_rest(abjad.select().leaves().get([0])),
    rmakers.tie(abjad.select().leaves().get([1], 2)),
    rmakers.rewrite_sustained(),
    # rmakers.beam(),
    # rmakers.extract_trivial(),
    )
    # rmakers.tuplet(
    # [(1, 2, 2, 1), (1, 2, 2, 2, 1)],), 
    # rmakers.force_rest(abjad.select().leaves().get([0])),
    # rmakers.tie(abjad.select().leaves().get([3], 4)),
    # rmakers.beam(),
    # rmakers.rewrite_sustained(),
    # rmakers.extract_trivial(),