Example #1
0
from abjad.tools import sequencetools
from baca import tools


first = [[2, 3], [1, 2, 3], [1, 4]]
first = tools.helianthate(first, 1, 1)
first *= 2
w = sum(first)

assert w == 192
assert first[:10] == [2, 3, 1, 2, 3, 1, 4, 4, 1, 3]

s = [[0, -0.5], [0, 0, -0.5], [0, 0, 1]]
s = tools.helianthate(s, 1, 1)
first = sequencetools.increase_sequence_cyclically_by_addenda(first, s)
first = sequencetools.repeat_to_weight(first, w)

assert first[:10] == [2, 2.5, 1, 2, 2.5, 1, 4, 5, 2, 3]

second = [[2, 4, 4], [2, 3, 3, 5], [2, 3, 5]]
second = tools.helianthate(second, 1, 1)
second.extend(second[:20])
w = sum(second)

assert w == 462
assert second[:10] == [2, 4, 4, 2, 3, 3, 5, 2, 3, 5]

s = [[0, 0], [-0.5, -0.5], [0, 0, 0], [0, 1]]
s = tools.helianthate(s, 1, 1)
second = sequencetools.increase_sequence_cyclically_by_addenda(second, s)
second = sequencetools.repeat_to_weight(second, w)
Example #2
0
    ('piano-1', 'pitches-vl'),
    ('piano-1', 'breath'),
    ('piano-1', 'pitches-fl')],

   # 10
   [('piano-1', 'piano-2'),
    ('piano-1', 'bow'),
    ('piano-1', 'pitches-vl'),
    ('piano-1', 'breath'),
    ('piano-1', 'pitches-fl')]]

window = [0, 1, 1, 1, 0, 1, 1, 1, 1]
count = 12

mask = H([[1, 1, 2], [1, 2], [1, 2, 3]])
mask = sequencetools.repeat_to_weight(mask, measures * len(reflections))

#mask = tools.rout(mask, window)
window_period = len(window)
window_true_indices = sequencetools.true_indices(window)
mask = sequencetools.negate_elements(
    mask, 
    absolute=True, 
    window_true_indices=indices, 
    window_period=period,
    )

mask = sequencetools.split_sequence(mask, measures, cyclic=True, overhang=True)
mask = sequencetools.flatten_sequence(mask)
mask = sequencetools.split_sequence(mask, [count], cyclic=True, overhang=True)
mask = sequencetools.flatten_sequence(mask)