Exemplo n.º 1
0
    def test_multi_bar_beats_are_broken_down(self):
        duration = Beat(5, 1) + Beat(1, 2)
        result = duration.tie_split()

        expected = [
            Beat(1, 1),
            Beat(1, 1),
            Beat(1, 1),
            Beat(1, 1),
            Beat(1, 1),
            Beat(1, 2)
        ]
        self.assertEqual(expected, result)
Exemplo n.º 2
0
    def test_existing_ties_are_retained_on_uneven_beats(self):
        duration = Beat(2, 3, tie=True)
        result = duration.tie_split()

        self.assertEqual([Beat(1, 3, tie=True), Beat(1, 3, tie=True)], result)
Exemplo n.º 3
0
    def test_existing_ties_are_retained(self):
        duration = Beat(1, 4, tie=True)
        result = duration.tie_split()

        self.assertEqual([Beat(1, 4, tie=True)], result)
Exemplo n.º 4
0
    def test_does_convert_odd_thirty_second_note_triplets(self):
        duration = Beat(3, 48)
        result = duration.tie_split()

        self.assertEqual([Beat(1, 24), Beat(1, 48)], result)
Exemplo n.º 5
0
    def test_does_convert_odd_sixteenth_note_triplets(self):
        duration = Beat(3, 24)
        result = duration.tie_split()

        self.assertEqual([Beat(1, 12), Beat(1, 24)], result)
Exemplo n.º 6
0
    def test_does_convert_odd_eighth_note_triplets(self):
        duration = Beat(3, 12)
        result = duration.tie_split()

        self.assertEqual([Beat(1, 6), Beat(1, 12)], result)
Exemplo n.º 7
0
    def test_does_convert_odd_quarter_note_triplets(self):
        duration = Beat(3, 6)
        result = duration.tie_split()

        self.assertEqual([Beat(1, 3), Beat(1, 6)], result)
Exemplo n.º 8
0
    def test_does_not_convert_half_note_triplets(self):
        duration = Beat(1, 3)
        result = duration.tie_split()

        self.assertEqual([Beat(1, 3)], result)
Exemplo n.º 9
0
    def test_even_rests_are_not_split(self):
        duration = Beat(1, 4, rest=True)
        result = duration.tie_split()

        self.assertEqual([Beat(1, 4, rest=True)], result)
Exemplo n.º 10
0
    def test_odd_rests_can_be_split(self):
        duration = Beat(3, 4, rest=True)
        result = duration.tie_split()

        self.assertEqual([Beat(2, 4, rest=True),
                          Beat(1, 4, rest=True)], result)