Пример #1
0
 def test_tuple_coercion(self):
     pyo = DummyPyoObject()
     player = PyoPlayer(pyo, interval=(1, 1),
                        clock=self.clock,
                        args={'freq': cycle([(1, 2)]).next})
     player.resumePlaying()
     self.runTicks(96)
     expected = [('setFreq', [1, 2]), ('setFreq', [1, 2])]
     self.assertEquals(pyo.calls, expected)
Пример #2
0
 def test_modulation(self):
     pyo = DummyPyoObject()
     player = PyoPlayer(pyo, interval=(1, 4),
                        clock=self.clock,
                        args={'freq': cycle([1, 2, 3]).next})
     player.resumePlaying()
     self.runTicks(96)
     expected = [('setFreq', 1), ('setFreq', 2), ('setFreq', 3),
                 ('setFreq', 1), ('setFreq', 2)]
     self.assertEqual(pyo.calls, expected)
     player.updateArgs(freq=cycle([4, 5, 6]).next,
                       mul=cycle([0.25, 0.125]).next)
     pyo.calls = []
     self.runTicks(96)
     expected = [('setMul', 0.25), ('setFreq', 4), ('setMul', 0.125),
                 ('setFreq', 5), ('setMul', 0.25), ('setFreq', 6),
                 ('setMul', 0.125), ('setFreq', 4)]