Ejemplo n.º 1
0
def glissando_rhythm(rotate=0):
    return baca.rhythm(
        rmakers.talea(abjad.sequence.rotate([5, 1, 2, 1], n=rotate), 8),
        rmakers.beam(),
        rmakers.extract_trivial(),
        rmakers.rewrite_meter(),
        tag=abjad.Tag("animales.glissando_rhythm()"),
    )
Ejemplo n.º 2
0
    def make_music(self, durations, denominator, divisions, pitches):
        # make rhythm with one tuplet per division
        stack = rmakers.stack(
            rmakers.talea(
                durations,
                denominator, 
                extra_counts=(0, 0, 0),
            ),
            rmakers.beam()
        )
        selection = stack(divisions)

        # attach time signature to first leaf in each tuplet
        assert len(divisions) == len(selection)
        for division, tuplet in zip(divisions, selection):
            time_signature = abjad.TimeSignature(division)
            leaf = abjad.select(tuplet).leaf(0)
            abjad.attach(time_signature, leaf)
 
        # apply pitch material
        cyclic_tuple = abjad.CyclicTuple(pitches) 
        iterator = abjad.iterate(selection).logical_ties(pitched=True) # make iterator out of selection using logical ties as virtual measures
        iterator = enumerate(iterator) # makes enum out of iterator  
        for index, logical_tie in iterator:
            print("entered the loop make_music")
            pitch = cyclic_tuple[index]
            print(pitch)
            for old_leaf in logical_tie:
                print("here is the old leaf: ", old_leaf)
                if isinstance(pitch, int):
                    print("in if pitch is still", pitch)
                    old_leaf.written_pitch = pitch
                    print(old_leaf)
                elif isinstance(pitch, list):
                    print("entered elif")
                    print("pitch is still", pitch)
                    new_leaf = abjad.Chord(pitch, old_leaf.written_duration)
                    print("this is the new leaf: ", new_leaf)
                    indicators = abjad.inspect(old_leaf).indicators()
                    if indicators != None:
                        for indicator in indicators:
                            abjad.attach(indicator, new_leaf)
                    abjad.mutate(old_leaf).replace(new_leaf)
                elif isinstance(pitch, abjad.Chord):
                    print("entered elif")
                    print("pitch is still", pitch)
                    new_leaf = abjad.Chord(pitch, old_leaf.written_duration)
                    print("this is the new leaf: ", new_leaf)
                    indicators = abjad.inspect(old_leaf).indicators()
                    if indicators != None:
                        for indicator in indicators:
                            abjad.attach(indicator, new_leaf)
                    abjad.mutate(old_leaf).replace(new_leaf)

        # remove trivial 1:1 tuplets
        self.staff.extend(selection)
        command = rmakers.extract_trivial()
        command(selection)
Ejemplo n.º 3
0
def clb_rhythm(
    section: str,
    member: int,
    counts: typing.Sequence[abjad.IntegerSequence],
    wrap: int,
):
    if section in ("First.Violin", "Second.Violin", "Viola"):
        assert member in range(1, 18 + 1), repr(member)
    elif section == "Cello":
        assert member in range(1, 14 + 1), repr(member)
    elif section == "Contrabass":
        assert member in range(1, 6 + 1), repr(member)
    else:
        assert ValueError(section)

    section_to_offset = {
        "First.Violin": 0,
        "Second.Violin": 18,
        "Viola": 36,
        "Cello": 54,
        "Contrabass": 68,
    }

    total_players = 74
    index = section_to_offset[section] + member - 1

    counts_ = baca.sequence.helianthate(counts, -1, -1)
    counts_ = abjad.sequence.flatten(counts_)
    counts_ = abjad.sequence.repeat_to_weight(counts_, total_players * wrap)
    shards = abjad.sequence.split(counts_, [wrap],
                                  cyclic=True,
                                  overhang=abjad.Exact)
    assert len(shards) == total_players
    assert abjad.sequence.weight(shards) == abjad.sequence.weight(counts_)
    counts_ = shards[index]

    extra_counts = None
    if index % 9 in [2, 3, 6, 7]:
        extra_counts = [-1]

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

    return baca.rhythm(
        rmakers.talea(counts_, 16, extra_counts=extra_counts),
        rmakers.beam(),
        rmakers.rewrite_rest_filled(),
        rmakers.trivialize(),
        rmakers.force_diminution(),
        rmakers.extract_trivial(),
        rmakers.rewrite_meter(),
        preprocessor=preprocessor,
        tag=abjad.Tag("animales.clb_rhythm()"),
    )
Ejemplo n.º 4
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()"),
    )
Ejemplo n.º 5
0
    def make_phrase(self, durations, denominator, divisions, pitches):
        # make rhythm with one tuplet per division
        stack = rmakers.stack(
            rmakers.talea(
                durations,
                denominator,
                extra_counts=(0, 0, 0),
            ),
            rmakers.beam()
        )
        selection = stack(divisions)

        # attach time signature to first leaf in each tuplet
        assert len(divisions) == len(selection)
        previous_time_signature = None
        for division, tuplet in zip(divisions, selection):
            time_signature = abjad.TimeSignature(division)
            leaf = abjad.select(tuplet).leaf(0)
            if time_signature != previous_time_signature:
                abjad.attach(time_signature, leaf)
                previous_time_signature = time_signature

        # apply pitch material
        cyclic_tuple = abjad.CyclicTuple(pitches)
        iterator = abjad.iterate(selection).logical_ties(pitched=True) # make iterator out of selection using logical ties as virtual measures
        iterator = enumerate(iterator) # makes enum out of iterator
        for index, logical_tie in iterator:
            pitch = cyclic_tuple[index]
            for old_leaf in logical_tie:
                if isinstance(pitch, int):
                    old_leaf.written_pitch = pitch
                elif isinstance(pitch, str):
    # warning: was formerly checking for list    import rill.tools.FuzzyHarmony as FuzzyHarmony
    #import rill.tools.PhraseMaker as PhraseMaker
                    new_leaf = abjad.Chord(pitch, old_leaf.written_duration)
                    indicators = abjad.inspect(old_leaf).indicators()
                    if indicators != None:
                        for indicator in indicators:
                            abjad.attach(indicator, new_leaf)
                    abjad.mutate(old_leaf).replace(new_leaf)
                elif isinstance(pitch, abjad.Chord):
                    new_leaf = abjad.Chord(pitch, old_leaf.written_duration)
                    indicators = abjad.inspect(old_leaf).indicators()
                    if indicators != None:
                        for indicator in indicators:
                            abjad.attach(indicator, new_leaf)
                    abjad.mutate(old_leaf).replace(new_leaf)

        # remove trivial 1:1 tuplets
        self.container.extend(selection)
        command = rmakers.extract_trivial()
        command(selection)
Ejemplo n.º 6
0
def material_test():
    print(
        "Running material test using ``muda.Material()`` class and its methods."
    )
    timespans = muda.alternating_timespans([[1, 1], [1, 1], [1, 1]], 2,
                                           ["matA", "matB"])
    durations = timespans.annotated_durations(subdivision=(2, 4))
    makers = {
        "matA":
        rmakers.stack(rmakers.talea([-1, 2, -1], 16),
                      rmakers.extract_trivial()),
        "matB":
        rmakers.stack(rmakers.talea([1, 1, 1, 1], 16),
                      rmakers.extract_trivial()),
    }
    mat = muda.Material("A")
    mat.alternating_materials(durations, makers)
    pitches = {
        "matA": abjad.PitchSegment("fs'"),
        "matB": abjad.PitchSegment("ds'"),
    }
    mat.write_pitches_by_name(pitches)
    mat.material_name_markups(["matA", "matB"])
Ejemplo n.º 7
0
    def make_music(self, durations, denominator, divisions, pitches):
        # make rhythm with one tuplet per division
        stack = rmakers.stack(
            rmakers.talea(
                durations,
                denominator,
                extra_counts=None,
            ),
            rmakers.beam(),
        )
        selection = stack(divisions)

#        # attach time signature to first leaf in each tuplet
#        assert len(divisions) == len(selection)
#        for division, tuplet in zip(divisions, selection):
#            time_signature = abjad.TimeSignature(division)
#            leaf = abjad.select(tuplet).leaf(0)
#            abjad.attach(time_signature, leaf)
#
        # apply pitches
        cyclic_tuple = abjad.CyclicTuple(pitches)
        iterator = abjad.iterate(selection).logical_ties(pitched=True)
        iterator = enumerate(iterator)
        for index, logical_tie in iterator:
            pitch = cyclic_tuple[index]
            for old_leaf in logical_tie:
                if isinstance(pitch, int):
                    old_leaf.written_pitch = pitch
                elif isinstance(pitch, list):
                    new_leaf = abjad.Chord(pitch, old_leaf.written_duration)
                    indicators = abjad.inspect(old_leaf).indicators()
                    if indicators != None:
                        for indicator in indicators:
                            abjad.attach(indicator, new_leaf)
                    abjad.mutate(old_leaf).replace(new_leaf)

        # remove trivial 1:1 tuplets
        self.staff.extend(selection)
        command = rmakers.extract_trivial()
        command(selection)
Ejemplo n.º 8
0
def brass_manifest_rhythm(part):
    assert part in range(1, 12 + 1), repr(part)
    counts, delay, extra_counts = {
        1: ([8, 8, -2], 9, [0, 0, 0, 1]),
        2: ([8, 8, -2], 13, [0, 1, 0, 0]),
        3: ([8, 8, -2], None, [0, 0, 1, 0]),
        4: ([8, 8, -2], 4, [1, 0, 0, 0]),
        5: ([7, 7, -2], 6, [0, 0, 0, 1]),
        6: ([7, 7, -2], 10, [0, 1, 0, 0]),
        7: ([7, 7, -2], None, [0, 0, 1, 0]),
        8: ([7, 7, -2], 4, [1, 0, 0, 0]),
        9: ([6, 6, 6, -2], 9, [0, 0, 0, 1]),
        10: ([6, 6, 6, -2], 13, [0, 1, 0, 0]),
        11: ([6, 6, 6, -2], None, [0, 0, 1, 0]),
        12: ([6, 6, 6, -2], 4, [1, 0, 0, 0]),
    }[part]

    if delay is None:
        preamble = ()
    else:
        preamble = [-delay]

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

    return baca.rhythm(
        rmakers.talea(counts, 8, extra_counts=extra_counts, preamble=preamble),
        rmakers.beam(),
        rmakers.rewrite_rest_filled(),
        rmakers.trivialize(),
        rmakers.extract_trivial(),
        rmakers.rewrite_meter(),
        preprocessor=preprocessor,
        persist="brass_manifest_rhythm",
        tag=abjad.Tag("animales.brass_manifest_rhythm()"),
    )
Ejemplo n.º 9
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()"),
    )
Ejemplo n.º 10
0
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()),
    rmakers.rewrite_rest_filled(abjad.select().tuplets()),
    rmakers.rewrite_sustained(abjad.select().tuplets()),
)

selection1 = stack([time_signatures[0]])
state1 = stack.state
selection2 = stack2([time_signatures[1]])
state2 = stack2.state
selection3 = stack([time_signatures[2]], previous_state=state1)
selection4 = stack2(time_signatures[3:], previous_state=state2)

selection = selection1 + selection2 + selection3 + selection4
staff = abjad.Staff(selection, name="staffname")
Ejemplo n.º 11
0
import abjad
import abjadext.rmakers as rmakers

selector = abjad.select().tuplets()[:-1]
selector = selector.map(abjad.select().note(-1))

rhythm_maker_voice_one = rmakers.stack(
    rmakers.talea(
        [3, 2, 1],  # counts
        8,  # denominator
    ),
    # rmakers.beam(),
    rmakers.extract_trivial(),
    # rmakers.tie(selector),
)

rhythm_maker_voice_two = rmakers.stack(
    rmakers.talea(
        [3, 1, 2],  # counts
        8,  # denominator
    ),
    # rmakers.beam(),
    rmakers.extract_trivial(),
    # rmakers.tie(selector),
)

rhythm_maker_voice_three = rmakers.stack(
    rmakers.talea(
        [1, 2, 3],  # counts
        8,  # denominator
    ),
Ejemplo n.º 12
0
    forget=False,
    name="guerrero_handler",
)

##
##

heterophony_maker = rmakers.stack(
    rmakers.talea(
        [
            4,
            1,
            3,
            5,
            4,
            6,
            7,
            3,
            2,
        ],
        8,
        extra_counts=[0, 0, 1, 0, 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()),
)

heterophony_handler = evans.RhythmHandler(
    rmaker=heterophony_maker,
Ejemplo n.º 13
0
def sforzando_exchange_rhythm(this_part):
    part_to_pattern = dict([
        (0, abjad.index([0, 15], period=18)),
        (1, abjad.index([0, 6, 8, 14, 16], period=24)),
        (2, abjad.index([0, 15], period=18)),
        (3, abjad.index([0, 6, 8, 14, 16], period=24)),
        (4, abjad.index([0, 15], period=18)),
        (5, abjad.index([0, 6, 8, 14, 16], period=24)),
        (6, abjad.index([0, 15], period=18)),
    ])

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

    sforzando_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)
            sforzando_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

    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 = part_to_counts[this_part]

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

    return baca.rhythm(
        rmakers.talea(counts, 16, extra_counts=[2], preamble=preamble),
        rmakers.beam(),
        rmakers.trivialize(),
        rmakers.extract_trivial(),
        rmakers.rewrite_meter(),
        rmakers.force_repeat_tie(),
        preprocessor=preprocessor,
        persist="sforzando_exchange_rhythm",
        tag=abjad.Tag("animales.sforzando_exchange_rhythm()"),
    )
Ejemplo n.º 14
0
import abjad
import evans
from abjadext import rmakers

rmaker_one = evans.RTMMaker(rtm=[
    "(1 ((3 (1 1 1)) 1 2 2))",
    "(1 (1 2 2 3))",
    "(1 ((2 (1 1)) 2 3 1))",
    "(1 ((2 (1 1)) 3 1 2))",
])

rmaker_two = rmakers.stack(
    rmakers.talea(
        [3, -1, 2, -2, 3, 1, 2, 2, -3, 1, -2, 2],
        4,
        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()),
)

rmaker_three = evans.RTMMaker(rtm=[
    "(1 (2 2 1 3))",
    "(1 (2 2 1 4))",
    "(1 (3 3 3 5))",
    "(1 (4 4 4 5))",
    "(1 (4 4 3 4))",
    # "(1 (5 4 4 5))",
    "(1 (2 1 1 2))",
# NOTE LIST VOICE FOUR SEGMENT IV END
# 4 _ _ _ 1 4 _ _ _ 1 4 _ _ _ 1 4 _ _ _ 1
#       3 _ _ 2 _ 3 _ _ 2 _
#           2 _ 2 _ 2 _ 2 _ 2

# 4 _ _ _ 4 _ \ _ _ 1 3 _ _ \ 1 3 _ _ 1 2 _ 1 2 _ 1 1
# 1 2 _ 1 2 _ \ 1 3 _ _ 1 3 \ _ _ 1 2 _ 1 2 _ 1 1
# 2 _ 3 _ _ 4 \ _ _ _ 1 3 _ \ _ 1 2 _ 1 2 _ 1 1

# TALEA RHYTHM MAKER
selector = abjad.select().tuplets()[:-1]
selector = selector.map(abjad.select().note(-1))
rhythm_maker_voice_two = rmakers.stack(
    rmakers.talea(
        [4, 3, 1, 3, 1, 3, 1, 2, 1, 2, 1, 1],  # counts
        8,  # denominator
    ),
    # rmakers.beam(),
    rmakers.extract_trivial(),
    rmakers.tie(selector),
)

rhythm_maker_voice_three = rmakers.stack(
    rmakers.talea(
        [1, 2, 1, 2, 1, 3, 1, 3, 1, 2, 1, 2, 1, 1],  # counts
        8,  # denominator
    ),
    # rmakers.beam(),
    rmakers.extract_trivial(),
    rmakers.tie(selector),
)
Ejemplo n.º 16
0
import abjad
import abjadext.rmakers as rmakers
import evans
import random

# THOSE CHORDS IN VOICE FIVE (once was one)
rhythm_maker_voice_five = rmakers.stack(
    rmakers.talea(
        [2, 1, 3],  # counts
        8,  # denominator
    ),
    # rmakers.beam(),
    rmakers.extract_trivial(),
    # rmakers.tie(selector),
)

# MATERIAL FROM SEGMENT 2 AND 3
# REST LIST
rest_list = evans.e_dovan_cycle(n=2, iters=16, first=1, second=1, modulus=5)
rest_list.sort(reverse=True)

# NOTE LIST VOICE TWO
note_list_voice_two = [4, 1]
non_cyc_generator = evans.CyclicList(lst=note_list_voice_two,
                                     continuous=False,
                                     count=1)
new_note_list_voice_two = non_cyc_generator(r=40)

# NOTE + REST = TALEA VOICE TWO
note_and_rest_voice_two = []
note_sublist_voice_two = []
Ejemplo n.º 17
0
    # 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(),
    


rhythm_maker_voice_one_old = rmakers.stack(
    rmakers.talea(
        [1],  # counts
        4,
        ),
    # rmakers.beam(),
    rmakers.extract_trivial(),
    # rmakers.tie(selector),
    )

rhythm_maker_voice_two = rmakers.stack(
    rmakers.talea(
        [2, 3],  # counts
        8, # denominator
        ),
    # rmakers.beam(),
    rmakers.extract_trivial(),
    # rmakers.tie(selector),
    )
Ejemplo n.º 18
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()"),
    )
Ejemplo n.º 19
0
time_signatures = []
for item in durations:
    if isinstance(item, list):
        for i in item:
            time_signatures.append(abjad.TimeSignature(i))
    else:
        time_signatures.append(abjad.TimeSignature(item))

# time_signatures = timespans.time_signatures()

# It is a list of durations where each one is annotated with
# the material name.

# Rhythms of each material
makers = {
    "matL": rmakers.stack(rmakers.talea([2, 1, -1], 16), rmakers.extract_trivial()),
    "matK": rmakers.stack(
        rmakers.talea([1, 1, 1, 1, 1], 32, extra_counts=[1]),
        rmakers.extract_trivial(),
    ),
    "matJ": rmakers.stack(
        rmakers.talea([-1, 1, -1], 8, extra_counts=[1]), rmakers.extract_trivial()
    ),
    "matI": rmakers.stack(
        rmakers.talea([1, 1, 1], 4, extra_counts=[1]), rmakers.extract_trivial()
    ),
    "matH": rmakers.stack(
        rmakers.talea([-3, -2, 1, -3, -3], 16, extra_counts=[4]),
        rmakers.extract_trivial(),
    ),
    "matG": rmakers.stack(
Ejemplo n.º 20
0
import abjad
import evans
from abjadext import rmakers

rmaker = rmakers.talea([1, 3, 2, 4, 5], 8, extra_counts=[1, 0, 1, 1, 2, 3, 4])


def quarters(divisions):
    divisions = evans.BacaSequence(divisions)
    divisions = evans.BacaSequence(
        evans.BacaSequence(_).quarters() for _ in divisions)
    divisions = evans.BacaSequence(divisions).flatten(depth=-1)
    return divisions


commands = [
    rmakers.trivialize(lambda _: abjad.Selection(_).tuplets()),
    rmakers.rewrite_rest_filled(lambda _: abjad.Selection(_).tuplets()),
    rmakers.rewrite_sustained(lambda _: abjad.Selection(_).tuplets()),
    rmakers.extract_trivial(),
    rmakers.RewriteMeterCommand(
        boundary_depth=-1,
        reference_meters=[
            abjad.Meter((6, 8)),
            abjad.Meter((9, 8)),
        ],
    ),
]

stack = rmakers.stack(
    rmaker,
import abjad
import abjadext.rmakers as rmakers
import evans
import random

# THOSE CHORDS IN VOICE ONE
rhythm_maker_voice_one = rmakers.stack(
    rmakers.talea(
        [2, 1, 3],  # counts
        8,  # denominator
        ),
    # rmakers.beam(),
    rmakers.extract_trivial(),
    # rmakers.tie(selector),
    )

# NEW MATERIAL
# REST LIST
rest_list = evans.e_dovan_cycle(
    n=2, iters=16, first=1, second=1, modulus=5)
rest_list.sort(reverse=True)

# NOTE LIST
note_list = [4, 1]
non_cyc_generator = evans.CyclicList(lst=note_list, continuous=False, count=1)
new_note_list = non_cyc_generator(r=40)
new_note_list

# NOTE + REST = TALEA
note_and_rest = []
note_sublist = []
Ejemplo n.º 22
0
import abjad
import abjadext.rmakers as rmakers
import muda

durations_general = [(4, 4)] * 32

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(
Ejemplo n.º 23
0
import abjad
import abjadext.rmakers as rmakers
import random
import organi

voz = abjad.Voice()
selector = abjad.select().tuplets()[:-1]
selector = selector.map(abjad.select().note(-1))
rhythm = rmakers.stack(
    rmakers.talea(
        [7, 7, 7, 7],  # counts
        8,  # denominator
    ),
    # rmakers.beam(),
    rmakers.denominator((1, 8)),
    rmakers.extract_trivial(),
    # rmakers.tie(selector),
)
divisions = [(4, 8)] * 7
measures = rhythm(divisions)
voz = abjad.Voice(
    measures)  # NEED TO PUT IN A CONTAINER TO SEPARATE WELL THE LOGICAL TIES
logical_ties = abjad.select(voz).leaves().logical_ties(pitched=True)
logical_ties

voz_time = abjad.Voice("s2 s2 s2 s2 s2 s2 s2 s2 s2 s2 s2 s2 s2 s2 s4 s1")
abjad.Staff(voz, voz_time)

time_signatures = []
for item in divisions:
    time_signatures.append(abjad.TimeSignature(item))