예제 #1
0
파일: test_arp.py 프로젝트: csv/beatlounge
 def test_pattern_arp(self):
     pattern = [0, 1, 2, 0, 0, 3, 2]
     notes = [1, 2, 3, 4]
     arp = PatternArp(notes, pattern)
     played = [arp() for i in range(14)]
     self.assertEqual(played, [1, 2, 3, 1, 1, 4, 3] * 2)
     arp.resetPattern([0, 0, 1, 1])
     played = [arp() for i in range(4)]
     self.assertEqual(played, [1, 1, 2, 2])
     arp.resetPattern(cycle([0, 1, 2, 3]).next)
     played = [arp() for i in range(8)]
     self.assertEqual(played, [1, 2, 3, 4, 1, 2, 3, 4])
예제 #2
0
 def test_pattern_arp(self):
     pattern = [0, 1, 2, 0, 0, 3, 2]
     notes = [1, 2, 3, 4]
     arp = PatternArp(notes, pattern)
     played = [arp() for i in range(14)]
     self.assertEqual(played, [1, 2, 3, 1, 1, 4, 3] * 2)
     arp.resetPattern([0, 0, 1, 1])
     played = [arp() for i in range(4)]
     self.assertEqual(played, [1, 1, 2, 2])
     arp.resetPattern(cycle([0, 1, 2, 3]).next)
     played = [arp() for i in range(8)]
     self.assertEqual(played, [1, 2, 3, 4, 1, 2, 3, 4])
예제 #3
0
파일: test_arp.py 프로젝트: csv/beatlounge
 def test_chord_pattern_arp(self):
     pattern = [0, 1, 2, [1, 2, 3], 3, 2, 1]
     notes = [1, 2, 3, 4]
     arp = ChordPatternArp(notes, pattern)
     played = [arp() for i in range(14)]
     self.assertEqual(played,
                      [(1,), (2,), (3,), [2, 3, 4], (4,), (3,), (2,)] * 2)
예제 #4
0
 def test_chord_pattern_arp(self):
     pattern = [0, 1, 2, [1, 2, 3], 3, 2, 1]
     notes = [1, 2, 3, 4]
     arp = ChordPatternArp(notes, pattern)
     played = [arp() for i in range(14)]
     self.assertEqual(played, [(1, ), (2, ), (3, ), [2, 3, 4], (4, ), (3, ),
                               (2, )] * 2)