Пример #1
0
def mfk_make_meters():
   '''Makes initial 360 Manifolds meters.
    '''

   numerators = [[2, 3, 5], [2, 4, 5], [2, 4, 4, 5]]
   numerators = tools.helianthate(numerators, -1, -1)
   numerators = sequencetools.flatten_sequence(numerators)
   numerators *= 3
   meters = [(numerator, 16) for numerator in numerators]

   assert len(meters) == 360
   assert meters[:6] == [(2, 16), (3, 16), (5, 16), (2, 16), (4, 16), (5, 16)]

   return meters
Пример #2
0
def _H(l):
    return tools.helianthate(l, 1, -1)
Пример #3
0
def H(l):
    return tools.helianthate(l, -1, -1)
Пример #4
0
        for (start, stop) in sequencetools.pairwise([eval(x) for x in line[1:]]):
            for i in range(start + 1, stop):
                prolongations.append(i)

violinStaff = staves[2]

for i, l in enumerate(instances(violinStaff, '_Leaf')):
    if l.kind('Note') and i in prolongations:
        l.prolongation = True
        l.formatter.right.append(
            r'^ \markup \with-color #blue \fontsize #3 { * }')

piano1Staff = staves[4]
piano2Staff = staves[5]

p1arity = tools.helianthate([[3, 3, 2], [4, 3, 2, 1]], 1, 1)

p2arity = tools.helianthate([[2, 2, 1], [3, 2, 1, 1]], 1, 1)

p1range = [585, 592]
p1range += range(592, 622 + 1)
p1range += range(631, 697 + 1)
p1range += range(705, 729 + 1)
p1range += range(734, 757 + 1)
p1range += range(764, 789 + 1)
p1range += [809, 810, 811]


p1prolongations = range(294, 312 + 1)
p1prolongations += range(451, 525 + 1)
p1prolongations += range(1057, 1073 + 1)
Пример #5
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)
Пример #6
0
def _Gt(l):
   unflattened = tools.helianthate(l, 1, 1, flattened = False)
   result = []
   for sublist in unflattened:
      result.extend(sublist)
   return result
Пример #7
0
def _G(l):
   return tools.helianthate(l, 1, 1)
Пример #8
0
# -*- coding: utf-8 -*-
from abjad.tools import sequencetools
from baca import tools


sixteenths = [[1, 1, 5], [1, 2, 4, 5]]
sixteenths = tools.helianthate(sixteenths, 1, 1)
sixteenths *= 3
# TODO: Unsure whether overhang should be True or False below
sixteenths = sequencetools.partition_by_lengths(
    sixteenths, 
    [2, 3], 
    cyclic=True, 
    overhang=True,
    )
sixteenths = [sum(part) for part in sixteenths]

pairs = [(n / 2, 8) if n % 2 == 0 else (n, 16) for n in sixteenths]
#durations = [duration.Duration(*p) for p in pairs]
durations = [Fraction(*p) for p in pairs]
directives = [r'\time %s/%s' % (p[0], p[1]) for p in pairs]

outer = [[2, 4, 4, 4], [2, 3, 4, 6], [2, 6, 6]] # valid
outer = tools.helianthate(outer, 1, 1)
#tools.segment(outer, sixteenths * 3, cycle = 'sheet')
#outer = tools.segment(outer, sixteenths * 5, cycle = 'sheet')
outer = sequencetools.repeat_list_to_weight(outer, sum(sixteenths * 5), remainder = 'more')
outer = sequencetools.partition_sequence_once_by_weights_at_least_without_overhang(outer, sixteenths * 5)

keys, shared, breath, rotation, distance = sequencetools.partition_by_lengths(
    outer, len(sixteenths), cyclic = False, overhang = False)