Пример #1
0
 def test_simple_four_four_even(self):
     '''1|1 -> 8|8 -> 4|4 + 4|4
     '''
     duration = Duration(1, 1)
     new_durations = bifurcate_duration(duration, even='allowed')
     test = [Duration(2, 4), Duration(2, 4)]
     self.assertEqual(new_durations, test)
 def test_simple_four_four_even(self):
     '''1|1 -> 8|8 -> 4|4 + 4|4
     '''
     duration = Duration(1, 1)
     new_durations = bifurcate_duration(duration, even='allowed')
     test = [Duration(2, 4), Duration(2, 4)]
     self.assertEqual(new_durations, test)
Пример #3
0
 def test_simple_four_four_default(self):
     ''' 1|1 -> 8|8 -> 5|8 + 3|8
     '''
     duration = Duration(1, 1)
     new_durations = bifurcate_duration(duration)
     test = [Duration(5, 8), Duration(3, 8)]
     self.assertEqual(new_durations, test)
 def test_simple_four_four_default(self):
     ''' 1|1 -> 8|8 -> 5|8 + 3|8
     '''
     duration = Duration(1, 1)
     new_durations = bifurcate_duration(duration)
     test = [Duration(5, 8), Duration(3, 8)]
     self.assertEqual(new_durations, test)
Пример #5
0
 def test_return_type(self):
     duration = Duration(1, 2)
     new_durations = bifurcate_duration(duration)
     self.assertIsInstance(new_durations, (list, Duration))
Пример #6
0
 def test_seven_eight_default(self):
     duration = Duration(7, 8)
     new_durations = bifurcate_duration(duration)
     test = [Duration(2, 4), Duration(3, 8)]
     self.assertEqual(new_durations, test)
Пример #7
0
 def test_five_four_default(self):
     duration = Duration(5, 4)
     new_durations = bifurcate_duration(duration)
     test = [Duration(3, 4), Duration(2, 4)]
     self.assertEqual(new_durations, test)
Пример #8
0
    float(stages[1][0] + stages[1][1] + stages[1][2]),
    float(stages[2][0] + stages[2][1] + stages[2][2] + stages[2][3]),
    float(stages[3][0] + stages[3][1] + stages[3][2]),
    float(stages[4][0] + stages[4][1]),
]

# print(stage_durations)

number_of_stages = len(stages)

# bifurcate abjad.Durations | division(subdivision(subdivision2,),))
divisions = []
for stage in stages:
    subdivisions = []
    for duration in stage:
        bifurcated_subdivisions = bifurcate_duration(duration)
        subdivisions.append(bifurcated_subdivisions)
    divisions.append(subdivisions)

# tally measures per section and subsection indices
measures_per_stage = []
for division in divisions:
    number_of_measures = 0
    for subdivision in division:
        for _ in subdivision:
            number_of_measures += 1
    measures_per_stage.append(number_of_measures)

# make time signatures from resulting divisions
time_signatures = []
for division in divisions:
 def test_return_type(self):
     duration = Duration(1, 2)
     new_durations = bifurcate_duration(duration)
     self.assertIsInstance(new_durations, (list, Duration))
 def test_seven_eight_default(self):
     duration = Duration(7, 8)
     new_durations = bifurcate_duration(duration)
     test = [Duration(2, 4), Duration(3, 8)]
     self.assertEqual(new_durations, test)
 def test_five_four_default(self):
     duration = Duration(5, 4)
     new_durations = bifurcate_duration(duration)
     test = [Duration(3, 4), Duration(2, 4)]
     self.assertEqual(new_durations, test)